History

Merge tag 'acpi-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki: "These are ACPICA updates including ACPI 6.3 support among other things, APEI updates including the ARM Software Delegated Exception Interface (SDEI) support, ACPI EC driver fixes and cleanups and other assorted improvements. Specifics: - Update the ACPICA code in the kernel to upstream revision 20190215 including ACPI 6.3 support and more: * New predefined methods: _NBS, _NCH, _NIC, _NIH, and _NIG (Erik Schmauss). * Update of the PCC Identifier structure in PDTT (Erik Schmauss). * Support for new Generic Affinity Structure subtable in SRAT (Erik Schmauss). * New PCC operation region support (Erik Schmauss). * Support for GICC statistical profiling for MADT (Erik Schmauss). * New Error Disconnect Recover notification support (Erik Schmauss). * New PPTT Processor Structure Flags fields support (Erik Schmauss). * ACPI 6.3 HMAT updates (Erik Schmauss). * GTDT Revision 3 support (Erik Schmauss). * Legacy module-level code (MLC) support removal (Erik Schmauss). * Update/clarification of messages for control method failures (Bob Moore). * Warning on creation of a zero-length opregion (Bob Moore). * acpiexec option to dump extra info for memory leaks (Bob Moore). * More ACPI error to firmware error conversions (Bob Moore). * Debugger fix (Bob Moore). * Copyrights update (Bob Moore) - Clean up sleep states support code in ACPICA (Christoph Hellwig) - Rework in_nmi() handling in the APEI code and add suppor for the ARM Software Delegated Exception Interface (SDEI) to it (James Morse) - Fix possible out-of-bounds accesses in BERT-related core (Ross Lagerwall) - Fix the APEI code parsing HEST that includes a Deferred Machine Check subtable (Yazen Ghannam) - Use DEFINE_DEBUGFS_ATTRIBUTE for APEI-related debugfs files (YueHaibing) - Switch the APEI ERST code to the new generic UUID API (Andy Shevchenko) - Update the MAINTAINERS entry for APEI (Borislav Petkov) - Fix and clean up the ACPI EC driver (Rafael Wysocki, Zhang Rui) - Fix DMI checks handling in the ACPI backlight driver and add the "Lunch Box" chassis-type check to it (Hans de Goede) - Add support for using ACPI table overrides included in built-in initrd images (Shunyong Yang) - Update ACPI device enumeration to treat the PWM2 device as "always present" on Lenovo Yoga Book (Yauhen Kharuzhy) - Fix up the enumeration of device objects with the PRP0001 device ID (Andy Shevchenko) - Clean up PPTT parsing error messages (John Garry) - Clean up debugfs files creation handling (Greg Kroah-Hartman, Rafael Wysocki) - Clean up the ACPI DPTF Makefile (Masahiro Yamada)" * tag 'acpi-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (65 commits) ACPI / bus: Respect PRP0001 when retrieving device match data ACPICA: Update version to 20190215 ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formatting ACPICA: ACPI 6.3: add GTDT Revision 3 support ACPICA: ACPI 6.3: HMAT updates ACPICA: ACPI 6.3: PPTT add additional fields in Processor Structure Flags ACPICA: ACPI 6.3: add Error Disconnect Recover Notification value ACPICA: ACPI 6.3: MADT: add support for statistical profiling in GICC ACPICA: ACPI 6.3: add PCC operation region support for AML interpreter efi: cper: Fix possible out-of-bounds access ACPI: APEI: Fix possible out-of-bounds access to BERT region ACPICA: ACPI 6.3: SRAT: add Generic Affinity Structure subtable ACPICA: ACPI 6.3: Add Trigger order to PCC Identifier structure in PDTT ACPICA: ACPI 6.3: Adding predefined methods _NBS, _NCH, _NIC, _NIH, and _NIG ACPICA: Update/clarify messages for control method failures ACPICA: Debugger: Fix possible fault with the "test objects" command ACPICA: Interpreter: Emit warning for creation of a zero-length op region ACPICA: Remove legacy module-level code support ACPI / x86: Make PWM2 device always present at Lenovo Yoga Book ACPI / video: Extend chassis-type detection with a "Lunch Box" check ..

Linus Torvalds committed 7 years ago

Commit d2767092 parents ef80068 8167e00227 files · +1437 −1321Browse files

Unified · Split

227 files
  1. Documentation/acpi/initrd_table_override.txt +4 −0
  2. MAINTAINERS +1 −0
  3. arch/arm/include/asm/kvm_ras.h +14 −0
  4. arch/arm/include/asm/system_misc.h +0 −5
  5. arch/arm64/include/asm/acpi.h +3 −1
  6. arch/arm64/include/asm/daifflags.h +1 −0
  7. arch/arm64/include/asm/fixmap.h +5 −1
  8. arch/arm64/include/asm/kvm_ras.h +25 −0
  9. arch/arm64/include/asm/system_misc.h +0 −2
  10. arch/arm64/kernel/acpi.c +31 −0
  11. arch/arm64/mm/fault.c +5 −19
  12. drivers/acpi/Kconfig +10 −0
  13. drivers/acpi/acpi_dbg.c +9 −21
  14. drivers/acpi/acpi_video.c +14 −6
  15. drivers/acpi/acpica/acapps.h +2 −2
  16. drivers/acpi/acpica/accommon.h +1 −1
  17. drivers/acpi/acpica/acconvert.h +1 −1
  18. drivers/acpi/acpica/acdebug.h +3 −2
  19. drivers/acpi/acpica/acdispat.h +1 −1
  20. drivers/acpi/acpica/acevents.h +1 −1
  21. drivers/acpi/acpica/acglobal.h +2 −1
  22. drivers/acpi/acpica/achware.h +1 −1
  23. drivers/acpi/acpica/acinterp.h +1 −1
  24. drivers/acpi/acpica/aclocal.h +2 −2
  25. drivers/acpi/acpica/acmacros.h +2 −2
  26. drivers/acpi/acpica/acnamesp.h +1 −1
  27. drivers/acpi/acpica/acobject.h +2 −1
  28. drivers/acpi/acpica/acopcode.h +1 −1
  29. drivers/acpi/acpica/acparser.h +1 −1
  30. drivers/acpi/acpica/acpredef.h +16 −1
  31. drivers/acpi/acpica/acresrc.h +1 −1
  32. drivers/acpi/acpica/acstruct.h +1 −1
  33. drivers/acpi/acpica/actables.h +1 −1
  34. drivers/acpi/acpica/acutils.h +1 −1
  35. drivers/acpi/acpica/amlcode.h +1 −1
  36. drivers/acpi/acpica/amlresrc.h +1 −1
  37. drivers/acpi/acpica/dbdisply.c +2 −2
  38. drivers/acpi/acpica/dbexec.c +2 −2
  39. drivers/acpi/acpica/dbhistry.c +1 −1
  40. drivers/acpi/acpica/dbnames.c +1 −1
  41. drivers/acpi/acpica/dbobject.c +1 −1
  42. drivers/acpi/acpica/dbtest.c +98 −66
  43. drivers/acpi/acpica/dsargs.c +1 −1
  44. drivers/acpi/acpica/dscontrol.c +1 −1
  45. drivers/acpi/acpica/dsdebug.c +1 −1
  46. drivers/acpi/acpica/dsfield.c +8 −1
  47. drivers/acpi/acpica/dsinit.c +1 −1
  48. drivers/acpi/acpica/dsmethod.c +1 −1
  49. drivers/acpi/acpica/dsobject.c +1 −1
  50. drivers/acpi/acpica/dsopcode.c +20 −8
  51. drivers/acpi/acpica/dspkginit.c +1 −1
  52. drivers/acpi/acpica/dswexec.c +1 −1
  53. drivers/acpi/acpica/dswload.c +1 −1
  54. drivers/acpi/acpica/dswload2.c +2 −2
  55. drivers/acpi/acpica/dswscope.c +1 −1
  56. drivers/acpi/acpica/dswstate.c +1 −1
  57. drivers/acpi/acpica/evevent.c +1 −1
  58. drivers/acpi/acpica/evglock.c +1 −1
  59. drivers/acpi/acpica/evgpe.c +2 −2
  60. drivers/acpi/acpica/evgpeblk.c +1 −1
  61. drivers/acpi/acpica/evgpeinit.c +1 −1
  62. drivers/acpi/acpica/evgpeutil.c +1 −1
  63. drivers/acpi/acpica/evhandler.c +1 −1
  64. drivers/acpi/acpica/evmisc.c +1 −1
  65. drivers/acpi/acpica/evregion.c +2 −2
  66. drivers/acpi/acpica/evrgnini.c +1 −20
  67. drivers/acpi/acpica/evxface.c +1 −1
  68. drivers/acpi/acpica/evxfevnt.c +1 −1
  69. drivers/acpi/acpica/evxfgpe.c +3 −3
  70. drivers/acpi/acpica/evxfregn.c +1 −1
  71. drivers/acpi/acpica/exconcat.c +1 −1
  72. drivers/acpi/acpica/exconfig.c +1 −1
  73. drivers/acpi/acpica/exconvrt.c +2 −2
  74. drivers/acpi/acpica/excreate.c +1 −1
  75. drivers/acpi/acpica/exdebug.c +1 −1
  76. drivers/acpi/acpica/exdump.c +1 −1
  77. drivers/acpi/acpica/exfield.c +70 −1
  78. drivers/acpi/acpica/exfldio.c +1 −1
  79. drivers/acpi/acpica/exmisc.c +1 −1
  80. drivers/acpi/acpica/exmutex.c +1 −1
  81. drivers/acpi/acpica/exnames.c +1 −1
  82. drivers/acpi/acpica/exoparg1.c +1 −1
  83. drivers/acpi/acpica/exoparg2.c +5 −5
  84. drivers/acpi/acpica/exoparg3.c +1 −1
  85. drivers/acpi/acpica/exoparg6.c +1 −1
  86. drivers/acpi/acpica/exprep.c +1 −1
  87. drivers/acpi/acpica/exregion.c +1 −1
  88. drivers/acpi/acpica/exresnte.c +1 −1
  89. drivers/acpi/acpica/exresolv.c +1 −1
  90. drivers/acpi/acpica/exresop.c +1 −1
  91. drivers/acpi/acpica/exserial.c +2 −2
  92. drivers/acpi/acpica/exstore.c +1 −1
  93. drivers/acpi/acpica/exstoren.c +1 −1
  94. drivers/acpi/acpica/exstorob.c +1 −1
  95. drivers/acpi/acpica/exsystem.c +1 −1
  96. drivers/acpi/acpica/extrace.c +1 −1
  97. drivers/acpi/acpica/exutils.c +2 −2
  98. drivers/acpi/acpica/hwacpi.c +1 −1
  99. drivers/acpi/acpica/hwesleep.c +1 −1
  100. drivers/acpi/acpica/hwgpe.c +1 −1
  101. drivers/acpi/acpica/hwsleep.c +1 −1
  102. drivers/acpi/acpica/hwtimer.c +1 −1
  103. drivers/acpi/acpica/hwvalid.c +1 −1
  104. drivers/acpi/acpica/hwxface.c +1 −1
  105. drivers/acpi/acpica/hwxfsleep.c +19 −79
  106. drivers/acpi/acpica/nsarguments.c +1 −1
  107. drivers/acpi/acpica/nsconvert.c +1 −1
  108. drivers/acpi/acpica/nsdump.c +1 −1
  109. drivers/acpi/acpica/nsdumpdv.c +1 −1
  110. drivers/acpi/acpica/nsinit.c +1 −1
  111. drivers/acpi/acpica/nsload.c +2 −2
  112. drivers/acpi/acpica/nsparse.c +13 −55
  113. drivers/acpi/acpica/nspredef.c +1 −1
  114. drivers/acpi/acpica/nsprepkg.c +1 −1
  115. drivers/acpi/acpica/nsrepair.c +1 −1
  116. drivers/acpi/acpica/nsrepair2.c +1 −1
  117. drivers/acpi/acpica/nsutils.c +2 −2
  118. drivers/acpi/acpica/nswalk.c +1 −1
  119. drivers/acpi/acpica/nsxfname.c +1 −1
  120. drivers/acpi/acpica/psargs.c +1 −1
  121. drivers/acpi/acpica/psloop.c +1 −194
  122. drivers/acpi/acpica/psobject.c +1 −1
  123. drivers/acpi/acpica/psopcode.c +1 −1
  124. drivers/acpi/acpica/psopinfo.c +1 −1
  125. drivers/acpi/acpica/psparse.c +5 −5
  126. drivers/acpi/acpica/psscope.c +1 −1
  127. drivers/acpi/acpica/pstree.c +1 −1
  128. drivers/acpi/acpica/psutils.c +1 −1
  129. drivers/acpi/acpica/pswalk.c +1 −1
  130. drivers/acpi/acpica/psxface.c +1 −1
  131. drivers/acpi/acpica/rsdumpinfo.c +7 −7
  132. drivers/acpi/acpica/rsirq.c +4 −4
  133. drivers/acpi/acpica/rsserial.c +5 −5
  134. drivers/acpi/acpica/tbdata.c +1 −1
  135. drivers/acpi/acpica/tbfadt.c +2 −2
  136. drivers/acpi/acpica/tbfind.c +1 −1
  137. drivers/acpi/acpica/tbinstal.c +1 −1
  138. drivers/acpi/acpica/tbprint.c +1 −1
  139. drivers/acpi/acpica/tbutils.c +1 −1
  140. drivers/acpi/acpica/tbxface.c +3 −3
  141. drivers/acpi/acpica/tbxfload.c +11 −16
  142. drivers/acpi/acpica/tbxfroot.c +1 −1
  143. drivers/acpi/acpica/utaddress.c +1 −1
  144. drivers/acpi/acpica/utalloc.c +1 −1
  145. drivers/acpi/acpica/utascii.c +1 −1
  146. drivers/acpi/acpica/utbuffer.c +1 −1
  147. drivers/acpi/acpica/utcache.c +1 −1
  148. drivers/acpi/acpica/utcopy.c +1 −1
  149. drivers/acpi/acpica/utdebug.c +1 −1
  150. drivers/acpi/acpica/utdecode.c +11 −9
  151. drivers/acpi/acpica/utdelete.c +4 −0
  152. drivers/acpi/acpica/uterror.c +5 −4
  153. drivers/acpi/acpica/uteval.c +1 −1
  154. drivers/acpi/acpica/utglobal.c +1 −1
  155. drivers/acpi/acpica/uthex.c +1 −1
  156. drivers/acpi/acpica/utids.c +1 −1
  157. drivers/acpi/acpica/utinit.c +1 −1
  158. drivers/acpi/acpica/utlock.c +1 −1
  159. drivers/acpi/acpica/utobject.c +1 −1
  160. drivers/acpi/acpica/utosi.c +1 −1
  161. drivers/acpi/acpica/utpredef.c +1 −1
  162. drivers/acpi/acpica/utprint.c +1 −1
  163. drivers/acpi/acpica/uttrack.c +13 −1
  164. drivers/acpi/acpica/utuuid.c +1 −1
  165. drivers/acpi/acpica/utxface.c +1 −1
  166. drivers/acpi/acpica/utxferror.c +44 −0
  167. drivers/acpi/acpica/utxfinit.c +1 −1
  168. drivers/acpi/apei/Kconfig +1 −11
  169. drivers/acpi/apei/bert.c +10 −13
  170. drivers/acpi/apei/einj.c +25 −68
  171. drivers/acpi/apei/erst.c +12 −15
  172. drivers/acpi/apei/ghes.c +371 −284
  173. drivers/acpi/apei/hest.c +15 −1
  174. drivers/acpi/bus.c +14 −0
  175. drivers/acpi/custom_method.c +0 −6
  176. drivers/acpi/dptf/Makefile +0 −2
  177. drivers/acpi/dptf/int340x_thermal.c +1 −1
  178. drivers/acpi/ec.c +112 −96
  179. drivers/acpi/ec_sys.c +8 −28
  180. drivers/acpi/internal.h +2 −2
  181. drivers/acpi/irq.c +2 −2
  182. drivers/acpi/pci_link.c +4 −4
  183. drivers/acpi/pptt.c +9 −4
  184. drivers/acpi/resource.c +2 −2
  185. drivers/acpi/tables.c +10 −2
  186. drivers/acpi/x86/utils.c +5 −0
  187. drivers/firmware/arm_sdei.c +68 −0
  188. drivers/firmware/efi/cper.c +9 −4
  189. drivers/gpio/gpiolib-acpi.c +1 −1
  190. drivers/platform/x86/sony-laptop.c +4 −4
  191. drivers/pnp/pnpacpi/rsparser.c +7 −7
  192. include/acpi/acbuffer.h +1 −1
  193. include/acpi/acconfig.h +2 −2
  194. include/acpi/acexcep.h +3 −2
  195. include/acpi/acnames.h +1 −1
  196. include/acpi/acoutput.h +3 −1
  197. include/acpi/acpi.h +1 −1
  198. include/acpi/acpiosxf.h +1 −1
  199. include/acpi/acpixf.h +8 −10
  200. include/acpi/acrestyp.h +8 −8
  201. include/acpi/actbl.h +1 −1
  202. include/acpi/actbl1.h +12 −7
  203. include/acpi/actbl2.h +11 −6
  204. include/acpi/actbl3.h +19 −2
  205. include/acpi/actypes.h +3 −11
  206. include/acpi/acuuid.h +1 −1
  207. include/acpi/ghes.h +2 −2
  208. include/acpi/platform/acenv.h +1 −1
  209. include/acpi/platform/acenvex.h +1 −1
  210. include/acpi/platform/acgcc.h +1 −1
  211. include/acpi/platform/acgccex.h +1 −1
  212. include/acpi/platform/acintel.h +1 −1
  213. include/acpi/platform/aclinux.h +1 −1
  214. include/acpi/platform/aclinuxex.h +1 −1
  215. include/linux/arm_sdei.h +9 −0
  216. include/linux/initrd.h +3 −0
  217. tools/power/acpi/common/cmfsize.c +1 −1
  218. tools/power/acpi/common/getopt.c +1 −1
  219. tools/power/acpi/os_specific/service_layers/oslinuxtbl.c +1 −1
  220. tools/power/acpi/os_specific/service_layers/osunixdir.c +1 −1
  221. tools/power/acpi/os_specific/service_layers/osunixmap.c +1 −1
  222. tools/power/acpi/os_specific/service_layers/osunixxf.c +1 −1
  223. tools/power/acpi/tools/acpidump/acpidump.h +1 −1
  224. tools/power/acpi/tools/acpidump/apdump.c +1 −1
  225. tools/power/acpi/tools/acpidump/apfiles.c +1 −1
  226. tools/power/acpi/tools/acpidump/apmain.c +1 −1
  227. virt/kvm/arm/mmu.c +2 −2
Documentation/acpi/initrd_table_override.txt+4−0
@@ -14,6 +14,10 @@ upgrade the ACPI execution environment that is defined by the ACPI tables · 13 unmodified lines
1414 via upgrading the ACPI tables provided by the BIOS with an instrumented,
1515 modified, more recent version one, or installing brand new ACPI tables.
1616
17+When building initrd with kernel in a single image, option
18+ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD should also be true for this
19+feature to work.
20+
1721 For a full list of ACPI tables that can be upgraded/installed, take a look
1822 at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in
1923 drivers/acpi/tables.c.
MAINTAINERS+1−0
@@ -331,6 +331,7 @@ ACPI APEI · 330 unmodified lines
331331 M: "Rafael J. Wysocki" <rjw@rjwysocki.net>
332332 M: Len Brown <lenb@kernel.org>
333333 L: linux-acpi@vger.kernel.org
334+R: James Morse <james.morse@arm.com>
334335 R: Tony Luck <tony.luck@intel.com>
335336 R: Borislav Petkov <bp@alien8.de>
336337 F: drivers/acpi/apei/
arch/arm/include/asm/kvm_ras.h+14−0
@@ -0,0 +1,14 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/* Copyright (C) 2018 - Arm Ltd */
3+
4+#ifndef __ARM_KVM_RAS_H__
5+#define __ARM_KVM_RAS_H__
6+
7+#include <linux/types.h>
8+
9+static inline int kvm_handle_guest_sea(phys_addr_t addr, unsigned int esr)
10+{
11+ return -1;
12+}
13+
14+#endif /* __ARM_KVM_RAS_H__ */
arch/arm/include/asm/system_misc.h+0−5
@@ -38,11 +38,6 @@ static inline void harden_branch_predictor(void) · 37 unmodified lines
3838
3939 extern unsigned int user_debug;
4040
41−static inline int handle_guest_sea(phys_addr_t addr, unsigned int esr)
42−{
43− return -1;
44−}
45−
4641 #endif /* !__ASSEMBLY__ */
4742
4843 #endif /* __ASM_ARM_SYSTEM_MISC_H */
arch/arm64/include/asm/acpi.h+3−1
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818
1919 #include <asm/cputype.h>
2020 #include <asm/io.h>
21+#include <asm/ptrace.h>
2122 #include <asm/smp_plat.h>
2223 #include <asm/tlbflush.h>
2324
@@ -110,9 +111,10 @@ static inline u32 get_acpi_id_for_cpu(unsigned int cpu) · 86 unmodified lines
110111
111112 static inline void arch_fix_phys_package_id(int num, u32 slot) { }
112113 void __init acpi_init_cpus(void);
113−
114+int apei_claim_sea(struct pt_regs *regs);
114115 #else
115116 static inline void acpi_init_cpus(void) { }
117+static inline int apei_claim_sea(struct pt_regs *regs) { return -ENOENT; }
116118 #endif /* CONFIG_ACPI */
117119
118120 #ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
arch/arm64/include/asm/daifflags.h+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020
2121 #define DAIF_PROCCTX 0
2222 #define DAIF_PROCCTX_NOIRQ PSR_I_BIT
23+#define DAIF_ERRCTX (PSR_I_BIT | PSR_A_BIT)
2324
2425 /* mask/save/unmask/restore all exceptions, including interrupts. */
2526 static inline void local_daif_mask(void)
arch/arm64/include/asm/fixmap.h+5−1
@@ -55,7 +55,11 @@ enum fixed_addresses { · 54 unmodified lines
5555 #ifdef CONFIG_ACPI_APEI_GHES
5656 /* Used for GHES mapping from assorted contexts */
5757 FIX_APEI_GHES_IRQ,
58− FIX_APEI_GHES_NMI,
58+ FIX_APEI_GHES_SEA,
59+#ifdef CONFIG_ARM_SDE_INTERFACE
60+ FIX_APEI_GHES_SDEI_NORMAL,
61+ FIX_APEI_GHES_SDEI_CRITICAL,
62+#endif
5963 #endif /* CONFIG_ACPI_APEI_GHES */
6064
6165 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
arch/arm64/include/asm/kvm_ras.h+25−0
@@ -0,0 +1,25 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/* Copyright (C) 2018 - Arm Ltd */
3+
4+#ifndef __ARM64_KVM_RAS_H__
5+#define __ARM64_KVM_RAS_H__
6+
7+#include <linux/acpi.h>
8+#include <linux/errno.h>
9+#include <linux/types.h>
10+
11+#include <asm/acpi.h>
12+
13+/*
14+ * Was this synchronous external abort a RAS notification?
15+ * Returns '0' for errors handled by some RAS subsystem, or -ENOENT.
16+ */
17+static inline int kvm_handle_guest_sea(phys_addr_t addr, unsigned int esr)
18+{
19+ /* apei_claim_sea(NULL) expects to mask interrupts itself */
20+ lockdep_assert_irqs_enabled();
21+
22+ return apei_claim_sea(NULL);
23+}
24+
25+#endif /* __ARM64_KVM_RAS_H__ */
arch/arm64/include/asm/system_misc.h+0−2
@@ -46,8 +46,6 @@ extern void __show_regs(struct pt_regs *); · 45 unmodified lines
4646
4747 extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
4848
49−int handle_guest_sea(phys_addr_t addr, unsigned int esr);
50−
5149 #endif /* __ASSEMBLY__ */
5250
5351 #endif /* __ASM_SYSTEM_MISC_H */
arch/arm64/kernel/acpi.c+31−0
@@ -27,8 +27,10 @@ · 26 unmodified lines
2727 #include <linux/smp.h>
2828 #include <linux/serial_core.h>
2929
30+#include <acpi/ghes.h>
3031 #include <asm/cputype.h>
3132 #include <asm/cpu_ops.h>
33+#include <asm/daifflags.h>
3234 #include <asm/pgtable.h>
3335 #include <asm/smp_plat.h>
3436
@@ -256,3 +258,32 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr) · 221 unmodified lines
256258 return __pgprot(PROT_NORMAL_NC);
257259 return __pgprot(PROT_DEVICE_nGnRnE);
258260 }
261+
262+/*
263+ * Claim Synchronous External Aborts as a firmware first notification.
264+ *
265+ * Used by KVM and the arch do_sea handler.
266+ * @regs may be NULL when called from process context.
267+ */
268+int apei_claim_sea(struct pt_regs *regs)
269+{
270+ int err = -ENOENT;
271+ unsigned long current_flags;
272+
273+ if (!IS_ENABLED(CONFIG_ACPI_APEI_GHES))
274+ return err;
275+
276+ current_flags = arch_local_save_flags();
277+
278+ /*
279+ * SEA can interrupt SError, mask it and describe this as an NMI so
280+ * that APEI defers the handling.
281+ */
282+ local_daif_restore(DAIF_ERRCTX);
283+ nmi_enter();
284+ err = ghes_notify_sea();
285+ nmi_exit();
286+ local_daif_restore(current_flags);
287+
288+ return err;
289+}
arch/arm64/mm/fault.c+5−19
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1919 */
2020
21+#include <linux/acpi.h>
2122 #include <linux/extable.h>
2223 #include <linux/signal.h>
2324 #include <linux/mm.h>
@@ -33,6 +34,7 @@ · 9 unmodified lines
3334 #include <linux/preempt.h>
3435 #include <linux/hugetlb.h>
3536
37+#include <asm/acpi.h>
3638 #include <asm/bug.h>
3739 #include <asm/cmpxchg.h>
3840 #include <asm/cpufeature.h>
@@ -47,8 +49,6 @@ · 8 unmodified lines
4749 #include <asm/tlbflush.h>
4850 #include <asm/traps.h>
4951
50−#include <acpi/ghes.h>
51−
5252 struct fault_info {
5353 int (*fn)(unsigned long addr, unsigned int esr,
5454 struct pt_regs *regs);
@@ -643,19 +643,10 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) · 588 unmodified lines
643643 inf = esr_to_fault_info(esr);
644644
645645 /*
646− * Synchronous aborts may interrupt code which had interrupts masked.
647− * Before calling out into the wider kernel tell the interested
648− * subsystems.
646+ * Return value ignored as we rely on signal merging.
647+ * Future patches will make this more robust.
649648 */
650− if (IS_ENABLED(CONFIG_ACPI_APEI_SEA)) {
651− if (interrupts_enabled(regs))
652− nmi_enter();
653−
654− ghes_notify_sea();
655−
656− if (interrupts_enabled(regs))
657− nmi_exit();
658− }
649+ apei_claim_sea(regs);
659650
660651 if (esr & ESR_ELx_FnV)
661652 siaddr = NULL;
@@ -733,11 +724,6 @@ static const struct fault_info fault_info[] = { · 71 unmodified lines
733724 { do_bad, SIGKILL, SI_KERNEL, "unknown 63" },
734725 };
735726
736−int handle_guest_sea(phys_addr_t addr, unsigned int esr)
737−{
738− return ghes_notify_sea();
739−}
740−
741727 asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
742728 struct pt_regs *regs)
743729 {
drivers/acpi/Kconfig+10−0
@@ -357,6 +357,16 @@ config ACPI_TABLE_UPGRADE · 356 unmodified lines
357357 initrd, therefore it's safe to say Y.
358358 See Documentation/acpi/initrd_table_override.txt for details
359359
360+config ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD
361+ bool "Override ACPI tables from built-in initrd"
362+ depends on ACPI_TABLE_UPGRADE
363+ depends on INITRAMFS_SOURCE!="" && INITRAMFS_COMPRESSION=""
364+ help
365+ This option provides functionality to override arbitrary ACPI tables
366+ from built-in uncompressed initrd.
367+
368+ See Documentation/acpi/initrd_table_override.txt for details
369+
360370 config ACPI_DEBUG
361371 bool "Debug Statements"
362372 help
drivers/acpi/acpi_dbg.c+9−21
@@ -750,48 +750,36 @@ static const struct acpi_debugger_ops acpi_aml_debugger = { · 749 unmodified lines
750750
751751 int __init acpi_aml_init(void)
752752 {
753− int ret = 0;
754−
755− if (!acpi_debugfs_dir) {
756− ret = -ENOENT;
757− goto err_exit;
758− }
753+ int ret;
759754
760755 /* Initialize AML IO interface */
761756 mutex_init(&acpi_aml_io.lock);
762757 init_waitqueue_head(&acpi_aml_io.wait);
763758 acpi_aml_io.out_crc.buf = acpi_aml_io.out_buf;
764759 acpi_aml_io.in_crc.buf = acpi_aml_io.in_buf;
760+
765761 acpi_aml_dentry = debugfs_create_file("acpidbg",
766762 S_IFREG | S_IRUGO | S_IWUSR,
767763 acpi_debugfs_dir, NULL,
768764 &acpi_aml_operations);
769− if (acpi_aml_dentry == NULL) {
770− ret = -ENODEV;
771− goto err_exit;
772− }
773− ret = acpi_register_debugger(THIS_MODULE, &acpi_aml_debugger);
774− if (ret)
775− goto err_fs;
776− acpi_aml_initialized = true;
777765
778−err_fs:
766+ ret = acpi_register_debugger(THIS_MODULE, &acpi_aml_debugger);
779767 if (ret) {
780768 debugfs_remove(acpi_aml_dentry);
781769 acpi_aml_dentry = NULL;
770+ return ret;
782771 }
783−err_exit:
784− return ret;
772+
773+ acpi_aml_initialized = true;
774+ return 0;
785775 }
786776
787777 void __exit acpi_aml_exit(void)
788778 {
789779 if (acpi_aml_initialized) {
790780 acpi_unregister_debugger(&acpi_aml_debugger);
791− if (acpi_aml_dentry) {
792− debugfs_remove(acpi_aml_dentry);
793− acpi_aml_dentry = NULL;
794− }
781+ debugfs_remove(acpi_aml_dentry);
782+ acpi_aml_dentry = NULL;
795783 acpi_aml_initialized = false;
796784 }
797785 }
drivers/acpi/acpi_video.c+14−6
@@ -2124,21 +2124,29 @@ static int __init intel_opregion_present(void) · 2123 unmodified lines
21242124 return opregion;
21252125 }
21262126
2127+/* Check if the chassis-type indicates there is no builtin LCD panel */
21272128 static bool dmi_is_desktop(void)
21282129 {
21292130 const char *chassis_type;
2131+ unsigned long type;
21302132
21312133 chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
21322134 if (!chassis_type)
21332135 return false;
21342136
2135− if (!strcmp(chassis_type, "3") || /* 3: Desktop */
2136− !strcmp(chassis_type, "4") || /* 4: Low Profile Desktop */
2137− !strcmp(chassis_type, "5") || /* 5: Pizza Box */
2138− !strcmp(chassis_type, "6") || /* 6: Mini Tower */
2139− !strcmp(chassis_type, "7") || /* 7: Tower */
2140− !strcmp(chassis_type, "11")) /* 11: Main Server Chassis */
2137+ if (kstrtoul(chassis_type, 10, &type) != 0)
2138+ return false;
2139+
2140+ switch (type) {
2141+ case 0x03: /* Desktop */
2142+ case 0x04: /* Low Profile Desktop */
2143+ case 0x05: /* Pizza Box */
2144+ case 0x06: /* Mini Tower */
2145+ case 0x07: /* Tower */
2146+ case 0x10: /* Lunch Box */
2147+ case 0x11: /* Main Server Chassis */
21412148 return true;
2149+ }
21422150
21432151 return false;
21442152 }
drivers/acpi/acpica/acapps.h+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: acapps - common include for ACPI applications/tools
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -17,7 +17,7 @@ · 7 unmodified lines
1717 /* Common info for tool signons */
1818
1919 #define ACPICA_NAME "Intel ACPI Component Architecture"
20−#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2018 Intel Corporation"
20+#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2019 Intel Corporation"
2121
2222 #if ACPI_MACHINE_WIDTH == 64
2323 #define ACPI_WIDTH " (64-bit version)"
drivers/acpi/acpica/accommon.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: accommon.h - Common include files for generation of ACPICA source
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/acconvert.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: acapps - common include for ACPI applications/tools
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/acdebug.h+3−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acdebug.h - ACPI/AML debugger
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -16,7 +16,8 @@ · 6 unmodified lines
1616 #include "acdisasm.h"
1717 #endif
1818
19−#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
19+#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
20+#define ACPI_DEBUG_LENGTH_FORMAT " (%.4X bits, %.3X bytes)"
2021
2122 struct acpi_db_command_info {
2223 const char *name; /* Command Name */
drivers/acpi/acpica/acdispat.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acdispat.h - dispatcher (parser to interpreter interface)
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/acevents.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acevents.h - Event subcomponent prototypes and defines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/acglobal.h+2−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acglobal.h - Declarations for global variables
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -164,6 +164,7 @@ ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_global_list); · 154 unmodified lines
164164 ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_ns_node_list);
165165 ACPI_GLOBAL(u8, acpi_gbl_display_final_mem_stats);
166166 ACPI_GLOBAL(u8, acpi_gbl_disable_mem_tracking);
167+ACPI_GLOBAL(u8, acpi_gbl_verbose_leak_dump);
167168 #endif
168169
169170 /*****************************************************************************
drivers/acpi/acpica/achware.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: achware.h -- hardware specific interfaces
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/acinterp.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acinterp.h - Interpreter subcomponent prototypes and defines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/aclocal.h+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: aclocal.h - Internal data types used across the ACPI subsystem
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -802,7 +802,7 @@ struct acpi_comment_addr_node { · 792 unmodified lines
802802
803803 /*
804804 * File node - used for "Include" operator file stack and
805− * depdendency tree for the -ca option
805+ * dependency tree for the -ca option
806806 */
807807 struct acpi_file_node {
808808 void *file;
drivers/acpi/acpica/acmacros.h+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acmacros.h - C macros for the entire subsystem.
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -462,7 +462,7 @@ · 452 unmodified lines
462462 #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7'))
463463
464464 /*
465− * Macors used for the ASL-/ASL+ converter utility
465+ * Macros used for the ASL-/ASL+ converter utility
466466 */
467467 #ifdef ACPI_ASL_COMPILER
468468
drivers/acpi/acpica/acnamesp.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/acobject.h+2−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acobject.h - Definition of union acpi_operand_object (Internal object only)
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -239,6 +239,7 @@ struct acpi_object_region_field { · 229 unmodified lines
239239 union acpi_operand_object *region_obj; /* Containing op_region object */
240240 u8 *resource_buffer; /* resource_template for serial regions/fields */
241241 u16 pin_number_index; /* Index relative to previous Connection/Template */
242+ u8 *internal_pcc_buffer; /* Internal buffer for fields associated with PCC */
242243 };
243244
244245 struct acpi_object_bank_field {
drivers/acpi/acpica/acopcode.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acopcode.h - AML opcode information for the AML parser and interpreter
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/acparser.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: acparser.h - AML Parser subcomponent prototypes and defines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/acpredef.h+16−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acpredef - Information table for ACPI predefined methods and objects
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -631,6 +631,21 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = { · 621 unmodified lines
631631 {{"_MTL", METHOD_0ARGS, /* ACPI 6.0 */
632632 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
633633
634+ {{"_NBS", METHOD_0ARGS, /* ACPI 6.3 */
635+ METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
636+
637+ {{"_NCH", METHOD_0ARGS, /* ACPI 6.3 */
638+ METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
639+
640+ {{"_NIC", METHOD_0ARGS, /* ACPI 6.3 */
641+ METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
642+
643+ {{"_NIG", METHOD_1ARGS(ACPI_TYPE_BUFFER), /* ACPI 6.3 */
644+ METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
645+
646+ {{"_NIH", METHOD_0ARGS, /* ACPI 6.3 */
647+ METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
648+
634649 {{"_NTT", METHOD_0ARGS,
635650 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
636651
drivers/acpi/acpica/acresrc.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acresrc.h - Resource Manager function prototypes
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/acstruct.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acstruct.h - Internal structs
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/actables.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: actables.h - ACPI table management
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/acutils.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/amlcode.h+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 * Declarations and definitions contained herein are derived
66 * directly from the ACPI specification.
77 *
8− * Copyright (C) 2000 - 2018, Intel Corp.
8+ * Copyright (C) 2000 - 2019, Intel Corp.
99 *
1010 *****************************************************************************/
1111
drivers/acpi/acpica/amlresrc.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: amlresrc.h - AML resource descriptors
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/dbdisply.c+2−2
@@ -237,7 +237,7 @@ void acpi_db_decode_and_display_object(char *target, char *output_type) · 236 unmodified lines
237237
238238 default:
239239
240− /* Is not a recognizeable object */
240+ /* Is not a recognizable object */
241241
242242 acpi_os_printf
243243 ("Not a known ACPI internal object, descriptor type %2.2X\n",
@@ -647,7 +647,7 @@ void acpi_db_display_object_type(char *object_arg) · 403 unmodified lines
647647 *
648648 * DESCRIPTION: Display the result of an AML opcode
649649 *
650− * Note: Curently only displays the result object if we are single stepping.
650+ * Note: Currently only displays the result object if we are single stepping.
651651 * However, this output may be useful in other contexts and could be enabled
652652 * to do so if needed.
653653 *
drivers/acpi/acpica/dbexec.c+2−2
@@ -160,12 +160,12 @@ acpi_db_execute_method(struct acpi_db_method_info *info, · 159 unmodified lines
160160 }
161161
162162 ACPI_EXCEPTION((AE_INFO, status,
163− "while executing %s from debugger",
163+ "while executing %s from AML Debugger",
164164 info->pathname));
165165
166166 if (status == AE_BUFFER_OVERFLOW) {
167167 ACPI_ERROR((AE_INFO,
168− "Possible overflow of internal debugger "
168+ "Possible buffer overflow within AML Debugger "
169169 "buffer (size 0x%X needed 0x%X)",
170170 ACPI_DEBUG_BUFFER_SIZE,
171171 (u32)return_obj->length));
drivers/acpi/acpica/dbhistry.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dbhistry - debugger HISTORY command
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/dbnames.c+1−1
@@ -904,7 +904,7 @@ acpi_db_bus_walk(acpi_handle obj_handle, · 903 unmodified lines
904904 *
905905 * RETURN: None
906906 *
907− * DESCRIPTION: Display info about system busses.
907+ * DESCRIPTION: Display info about system buses.
908908 *
909909 ******************************************************************************/
910910
drivers/acpi/acpica/dbobject.c+1−1
@@ -243,7 +243,7 @@ acpi_db_display_internal_object(union acpi_operand_object *obj_desc, · 242 unmodified lines
243243 acpi_os_printf("[%s] ",
244244 acpi_ut_get_reference_name(obj_desc));
245245
246− /* Decode the refererence */
246+ /* Decode the reference */
247247
248248 switch (obj_desc->reference.class) {
249249 case ACPI_REFCLASS_LOCAL:
drivers/acpi/acpica/dbtest.c+98−66
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include "acdebug.h"
1111 #include "acnamesp.h"
1212 #include "acpredef.h"
13+#include "acinterp.h"
1314
1415 #define _COMPONENT ACPI_CA_DEBUGGER
1516 ACPI_MODULE_NAME("dbtest")
@@ -32,6 +33,9 @@ acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length); · 16 unmodified lines
3233
3334 static acpi_status acpi_db_test_package_type(struct acpi_namespace_node *node);
3435
36+static acpi_status
37+acpi_db_test_field_unit_type(union acpi_operand_object *obj_desc);
38+
3539 static acpi_status
3640 acpi_db_read_from_object(struct acpi_namespace_node *node,
3741 acpi_object_type expected_type,
@@ -74,7 +78,7 @@ static struct acpi_db_argument_info acpi_db_test_types[] = { · 36 unmodified lines
7478 static acpi_handle read_handle = NULL;
7579 static acpi_handle write_handle = NULL;
7680
77−/* ASL Definitions of the debugger read/write control methods */
81+/* ASL Definitions of the debugger read/write control methods. AML below. */
7882
7983 #if 0
8084 definition_block("ssdt.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001)
@@ -227,10 +231,8 @@ static void acpi_db_test_all_objects(void) · 146 unmodified lines
227231 * RETURN: Status
228232 *
229233 * DESCRIPTION: Test one namespace object. Supported types are Integer,
230− * String, Buffer, buffer_field, and field_unit. All other object
231− * types are simply ignored.
232− *
233− * Note: Support for Packages is not implemented.
234+ * String, Buffer, Package, buffer_field, and field_unit.
235+ * All other object types are simply ignored.
234236 *
235237 ******************************************************************************/
236238
@@ -240,7 +242,6 @@ acpi_db_test_one_object(acpi_handle obj_handle, · 3 unmodified lines
240242 {
241243 struct acpi_namespace_node *node;
242244 union acpi_operand_object *obj_desc;
243− union acpi_operand_object *region_obj;
244245 acpi_object_type local_type;
245246 u32 bit_length = 0;
246247 u32 byte_length = 0;
@@ -281,18 +282,21 @@ acpi_db_test_one_object(acpi_handle obj_handle, · 34 unmodified lines
281282 break;
282283
283284 case ACPI_TYPE_FIELD_UNIT:
284− case ACPI_TYPE_BUFFER_FIELD:
285285 case ACPI_TYPE_LOCAL_REGION_FIELD:
286286 case ACPI_TYPE_LOCAL_INDEX_FIELD:
287287 case ACPI_TYPE_LOCAL_BANK_FIELD:
288288
289+ local_type = ACPI_TYPE_FIELD_UNIT;
290+ break;
291+
292+ case ACPI_TYPE_BUFFER_FIELD:
293+ /*
294+ * The returned object will be a Buffer if the field length
295+ * is larger than the size of an Integer (32 or 64 bits
296+ * depending on the DSDT version).
297+ */
289298 local_type = ACPI_TYPE_INTEGER;
290299 if (obj_desc) {
291− /*
292− * Returned object will be a Buffer if the field length
293− * is larger than the size of an Integer (32 or 64 bits
294− * depending on the DSDT version).
295− */
296300 bit_length = obj_desc->common_field.bit_length;
297301 byte_length = ACPI_ROUND_BITS_UP_TO_BYTES(bit_length);
298302 if (bit_length > acpi_gbl_integer_bit_width) {
@@ -303,7 +307,7 @@ acpi_db_test_one_object(acpi_handle obj_handle, · 4 unmodified lines
303307
304308 default:
305309
306− /* Ignore all other types */
310+ /* Ignore all non-data types - Methods, Devices, Scopes, etc. */
307311
308312 return (AE_OK);
309313 }
@@ -314,40 +318,10 @@ acpi_db_test_one_object(acpi_handle obj_handle, · 4 unmodified lines
314318 acpi_ut_get_type_name(node->type), node->name.ascii);
315319
316320 if (!obj_desc) {
317− acpi_os_printf(" Ignoring, no attached object\n");
321+ acpi_os_printf(" No attached sub-object, ignoring\n");
318322 return (AE_OK);
319323 }
320324
321− /*
322− * Check for unsupported region types. Note: acpi_exec simulates
323− * access to system_memory, system_IO, PCI_Config, and EC.
324− */
325− switch (node->type) {
326− case ACPI_TYPE_LOCAL_REGION_FIELD:
327−
328− region_obj = obj_desc->field.region_obj;
329− switch (region_obj->region.space_id) {
330− case ACPI_ADR_SPACE_SYSTEM_MEMORY:
331− case ACPI_ADR_SPACE_SYSTEM_IO:
332− case ACPI_ADR_SPACE_PCI_CONFIG:
333−
334− break;
335−
336− default:
337−
338− acpi_os_printf
339− (" %s space is not supported in this command [%4.4s]\n",
340− acpi_ut_get_region_name(region_obj->region.
341− space_id),
342− region_obj->region.node->name.ascii);
343− return (AE_OK);
344− }
345− break;
346−
347− default:
348− break;
349− }
350−
351325 /* At this point, we have resolved the object to one of the major types */
352326
353327 switch (local_type) {
@@ -371,6 +345,11 @@ acpi_db_test_one_object(acpi_handle obj_handle, · 17 unmodified lines
371345 status = acpi_db_test_package_type(node);
372346 break;
373347
348+ case ACPI_TYPE_FIELD_UNIT:
349+
350+ status = acpi_db_test_field_unit_type(obj_desc);
351+ break;
352+
374353 default:
375354
376355 acpi_os_printf(" Ignoring, type not implemented (%2.2X)",
@@ -382,24 +361,8 @@ acpi_db_test_one_object(acpi_handle obj_handle, · 5 unmodified lines
382361
383362 if (ACPI_FAILURE(status)) {
384363 status = AE_OK;
385− goto exit;
386− }
387−
388− switch (node->type) {
389− case ACPI_TYPE_LOCAL_REGION_FIELD:
390−
391− region_obj = obj_desc->field.region_obj;
392− acpi_os_printf(" (%s)",
393− acpi_ut_get_region_name(region_obj->region.
394− space_id));
395−
396− break;
397−
398− default:
399− break;
400364 }
401365
402−exit:
403366 acpi_os_printf("\n");
404367 return (status);
405368 }
@@ -444,7 +407,7 @@ acpi_db_test_integer_type(struct acpi_namespace_node *node, u32 bit_length) · 38 unmodified lines
444407 return (status);
445408 }
446409
447− acpi_os_printf(" (%4.4X/%3.3X) %8.8X%8.8X",
410+ acpi_os_printf(ACPI_DEBUG_LENGTH_FORMAT " %8.8X%8.8X",
448411 bit_length, ACPI_ROUND_BITS_UP_TO_BYTES(bit_length),
449412 ACPI_FORMAT_UINT64(temp1->integer.value));
450413
@@ -558,8 +521,9 @@ acpi_db_test_buffer_type(struct acpi_namespace_node *node, u32 bit_length) · 107 unmodified lines
558521
559522 /* Emit a few bytes of the buffer */
560523
561− acpi_os_printf(" (%4.4X/%3.3X)", bit_length, temp1->buffer.length);
562− for (i = 0; ((i < 4) && (i < byte_length)); i++) {
524+ acpi_os_printf(ACPI_DEBUG_LENGTH_FORMAT, bit_length,
525+ temp1->buffer.length);
526+ for (i = 0; ((i < 8) && (i < byte_length)); i++) {
563527 acpi_os_printf(" %2.2X", temp1->buffer.pointer[i]);
564528 }
565529 acpi_os_printf("... ");
@@ -665,8 +629,9 @@ acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length) · 99 unmodified lines
665629 return (status);
666630 }
667631
668− acpi_os_printf(" (%4.4X/%3.3X) \"%s\"", (temp1->string.length * 8),
669− temp1->string.length, temp1->string.pointer);
632+ acpi_os_printf(ACPI_DEBUG_LENGTH_FORMAT " \"%s\"",
633+ (temp1->string.length * 8), temp1->string.length,
634+ temp1->string.pointer);
670635
671636 /* Write a new value */
672637
@@ -750,11 +715,78 @@ static acpi_status acpi_db_test_package_type(struct acpi_namespace_node *node) · 77 unmodified lines
750715 return (status);
751716 }
752717
753− acpi_os_printf(" %8.8X Elements", temp1->package.count);
718+ acpi_os_printf(" %.2X Elements", temp1->package.count);
754719 acpi_os_free(temp1);
755720 return (status);
756721 }
757722
723+/*******************************************************************************
724+ *
725+ * FUNCTION: acpi_db_test_field_unit_type
726+ *
727+ * PARAMETERS: obj_desc - A field unit object
728+ *
729+ * RETURN: Status
730+ *
731+ * DESCRIPTION: Test read/write on a named field unit.
732+ *
733+ ******************************************************************************/
734+
735+static acpi_status
736+acpi_db_test_field_unit_type(union acpi_operand_object *obj_desc)
737+{
738+ union acpi_operand_object *region_obj;
739+ u32 bit_length = 0;
740+ u32 byte_length = 0;
741+ acpi_status status = AE_OK;
742+ union acpi_operand_object *ret_buffer_desc;
743+
744+ /* Supported spaces are memory/io/pci_config */
745+
746+ region_obj = obj_desc->field.region_obj;
747+ switch (region_obj->region.space_id) {
748+ case ACPI_ADR_SPACE_SYSTEM_MEMORY:
749+ case ACPI_ADR_SPACE_SYSTEM_IO:
750+ case ACPI_ADR_SPACE_PCI_CONFIG:
751+
752+ /* Need the interpreter to execute */
753+
754+ acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);
755+ acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
756+
757+ /* Exercise read-then-write */
758+
759+ status =
760+ acpi_ex_read_data_from_field(NULL, obj_desc,
761+ &ret_buffer_desc);
762+ if (status == AE_OK) {
763+ acpi_ex_write_data_to_field(ret_buffer_desc, obj_desc,
764+ NULL);
765+ acpi_ut_remove_reference(ret_buffer_desc);
766+ }
767+
768+ acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
769+ acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);
770+
771+ bit_length = obj_desc->common_field.bit_length;
772+ byte_length = ACPI_ROUND_BITS_UP_TO_BYTES(bit_length);
773+
774+ acpi_os_printf(ACPI_DEBUG_LENGTH_FORMAT " [%s]", bit_length,
775+ byte_length,
776+ acpi_ut_get_region_name(region_obj->region.
777+ space_id));
778+ return (status);
779+
780+ default:
781+
782+ acpi_os_printf
783+ (" %s address space is not supported in this command [%4.4s]",
784+ acpi_ut_get_region_name(region_obj->region.space_id),
785+ region_obj->region.node->name.ascii);
786+ return (AE_OK);
787+ }
788+}
789+
758790 /*******************************************************************************
759791 *
760792 * FUNCTION: acpi_db_read_from_object
drivers/acpi/acpica/dsargs.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Module Name: dsargs - Support for execution of dynamic arguments for static
55 * objects (regions, fields, buffer fields, etc.)
66 *
7− * Copyright (C) 2000 - 2018, Intel Corp.
7+ * Copyright (C) 2000 - 2019, Intel Corp.
88 *
99 *****************************************************************************/
1010
drivers/acpi/acpica/dscontrol.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Module Name: dscontrol - Support for execution control opcodes -
55 * if/else/while/return
66 *
7− * Copyright (C) 2000 - 2018, Intel Corp.
7+ * Copyright (C) 2000 - 2019, Intel Corp.
88 *
99 *****************************************************************************/
1010
drivers/acpi/acpica/dsdebug.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dsdebug - Parser/Interpreter interface - debugging
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/dsfield.c+8−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dsfield - Dispatcher field routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -518,6 +518,13 @@ acpi_ds_create_field(union acpi_parse_object *op, · 508 unmodified lines
518518 info.region_node = region_node;
519519
520520 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
521+ if (info.region_node->object->region.space_id ==
522+ ACPI_ADR_SPACE_PLATFORM_COMM
523+ && !(region_node->object->field.internal_pcc_buffer =
524+ ACPI_ALLOCATE_ZEROED(info.region_node->object->region.
525+ length))) {
526+ return_ACPI_STATUS(AE_NO_MEMORY);
527+ }
521528 return_ACPI_STATUS(status);
522529 }
523530
drivers/acpi/acpica/dsinit.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dsinit - Object initialization namespace walk
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/dsmethod.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/dsobject.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dsobject - Dispatcher object management routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/dsopcode.c+20−8
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dsopcode - Dispatcher support for regions and fields
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -130,8 +130,8 @@ acpi_ds_init_buffer_field(u16 aml_opcode, · 120 unmodified lines
130130 /* Must have a valid (>0) bit count */
131131
132132 if (bit_count == 0) {
133− ACPI_ERROR((AE_INFO,
134− "Attempt to CreateField of length zero"));
133+ ACPI_BIOS_ERROR((AE_INFO,
134+ "Attempt to CreateField of length zero"));
135135 status = AE_AML_OPERAND_VALUE;
136136 goto cleanup;
137137 }
@@ -194,12 +194,13 @@ acpi_ds_init_buffer_field(u16 aml_opcode, · 56 unmodified lines
194194 /* Entire field must fit within the current length of the buffer */
195195
196196 if ((bit_offset + bit_count) > (8 * (u32)buffer_desc->buffer.length)) {
197− ACPI_ERROR((AE_INFO,
198− "Field [%4.4s] at bit offset/length %u/%u "
199− "exceeds size of target Buffer (%u bits)",
200− acpi_ut_get_node_name(result_desc), bit_offset,
201− bit_count, 8 * (u32)buffer_desc->buffer.length));
202197 status = AE_AML_BUFFER_LIMIT;
198+ ACPI_BIOS_EXCEPTION((AE_INFO, status,
199+ "Field [%4.4s] at bit offset/length %u/%u "
200+ "exceeds size of target Buffer (%u bits)",
201+ acpi_ut_get_node_name(result_desc),
202+ bit_offset, bit_count,
203+ 8 * (u32)buffer_desc->buffer.length));
203204 goto cleanup;
204205 }
205206
@@ -355,6 +356,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, · 149 unmodified lines
355356 union acpi_operand_object *operand_desc;
356357 struct acpi_namespace_node *node;
357358 union acpi_parse_object *next_op;
359+ acpi_adr_space_type space_id;
358360
359361 ACPI_FUNCTION_TRACE_PTR(ds_eval_region_operands, op);
360362
@@ -367,6 +369,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, · 6 unmodified lines
367369 /* next_op points to the op that holds the space_ID */
368370
369371 next_op = op->common.value.arg;
372+ space_id = (acpi_adr_space_type)next_op->common.value.integer;
370373
371374 /* next_op points to address op */
372375
@@ -402,6 +405,15 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, · 29 unmodified lines
402405 obj_desc->region.length = (u32) operand_desc->integer.value;
403406 acpi_ut_remove_reference(operand_desc);
404407
408+ /* A zero-length operation region is unusable. Just warn */
409+
410+ if (!obj_desc->region.length
411+ && (space_id < ACPI_NUM_PREDEFINED_REGIONS)) {
412+ ACPI_WARNING((AE_INFO,
413+ "Operation Region [%4.4s] has zero length (SpaceId %X)",
414+ node->name.ascii, space_id));
415+ }
416+
405417 /*
406418 * Get the address and save it
407419 * (at top of stack - 1)
drivers/acpi/acpica/dspkginit.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dspkginit - Completion of deferred package initialization
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/dswexec.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Module Name: dswexec - Dispatcher method execution callbacks;
55 * dispatch to interpreter.
66 *
7− * Copyright (C) 2000 - 2018, Intel Corp.
7+ * Copyright (C) 2000 - 2019, Intel Corp.
88 *
99 *****************************************************************************/
1010
drivers/acpi/acpica/dswload.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dswload - Dispatcher first pass namespace load callbacks
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/dswload2.c+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dswload2 - Dispatcher second pass namespace load callbacks
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -24,7 +24,7 @@ ACPI_MODULE_NAME("dswload2") · 14 unmodified lines
2424 * FUNCTION: acpi_ds_load2_begin_op
2525 *
2626 * PARAMETERS: walk_state - Current state of the parse tree walk
27− * out_op - Wher to return op if a new one is created
27+ * out_op - Where to return op if a new one is created
2828 *
2929 * RETURN: Status
3030 *
drivers/acpi/acpica/dswscope.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dswscope - Scope stack manipulation
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/dswstate.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: dswstate - Dispatcher parse tree walk management routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/evevent.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evevent - Fixed Event handling and dispatch
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/evglock.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evglock - Global Lock support
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/evgpe.c+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evgpe - General Purpose Event handling and dispatch
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -801,7 +801,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, · 791 unmodified lines
801801 dispatch.handler->
802802 context);
803803
804− /* If requested, clear (if level-triggered) and reenable the GPE */
804+ /* If requested, clear (if level-triggered) and re-enable the GPE */
805805
806806 if (return_value & ACPI_REENABLE_GPE) {
807807 (void)acpi_ev_finish_gpe(gpe_event_info);
drivers/acpi/acpica/evgpeblk.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evgpeblk - GPE block creation and initialization.
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/evgpeinit.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evgpeinit - System GPE initialization and update
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/evgpeutil.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evgpeutil - GPE utilities
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/evhandler.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evhandler - Support for Address Space handlers
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/evmisc.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evmisc - Miscellaneous event manager support functions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/evregion.c+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evregion - Operation Region support
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -250,7 +250,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, · 240 unmodified lines
250250 /*
251251 * For handlers other than the default (supplied) handlers, we must
252252 * exit the interpreter because the handler *might* block -- we don't
253− * know what it will do, so we can't hold the lock on the intepreter.
253+ * know what it will do, so we can't hold the lock on the interpreter.
254254 */
255255 acpi_ex_exit_interpreter();
256256 }
drivers/acpi/acpica/evrgnini.c+1−20
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evrgnini- ACPI address_space (op_region) init
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -516,25 +516,6 @@ acpi_status acpi_ev_initialize_region(union acpi_operand_object *region_obj) · 506 unmodified lines
516516 handler_obj = obj_desc->common_notify.handler;
517517 break;
518518
519− case ACPI_TYPE_METHOD:
520− /*
521− * If we are executing module level code, the original
522− * Node's object was replaced by this Method object and we
523− * saved the handler in the method object.
524− *
525− * Note: Only used for the legacy MLC support. Will
526− * be removed in the future.
527− *
528− * See acpi_ns_exec_module_code
529− */
530− if (!acpi_gbl_execute_tables_as_methods &&
531− obj_desc->method.
532− info_flags & ACPI_METHOD_MODULE_LEVEL) {
533− handler_obj =
534− obj_desc->method.dispatch.handler;
535− }
536− break;
537−
538519 default:
539520
540521 /* Ignore other objects */
drivers/acpi/acpica/evxface.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evxface - External interfaces for ACPI events
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/evxfevnt.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/evxfgpe.c+3−3
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: evxfgpe - External Interfaces for General Purpose Events (GPEs)
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -669,9 +669,9 @@ ACPI_EXPORT_SYMBOL(acpi_dispatch_gpe) · 659 unmodified lines
669669 *
670670 * RETURN: Status
671671 *
672− * DESCRIPTION: Clear and conditionally reenable a GPE. This completes the GPE
672+ * DESCRIPTION: Clear and conditionally re-enable a GPE. This completes the GPE
673673 * processing. Intended for use by asynchronous host-installed
674− * GPE handlers. The GPE is only reenabled if the enable_for_run bit
674+ * GPE handlers. The GPE is only re-enabled if the enable_for_run bit
675675 * is set in the GPE info.
676676 *
677677 ******************************************************************************/
drivers/acpi/acpica/evxfregn.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
55 * Address Spaces.
66 *
7− * Copyright (C) 2000 - 2018, Intel Corp.
7+ * Copyright (C) 2000 - 2019, Intel Corp.
88 *
99 *****************************************************************************/
1010
drivers/acpi/acpica/exconcat.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exconcat - Concatenate-type AML operators
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exconfig.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exconvrt.c+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exconvrt - Object conversion routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -520,7 +520,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, · 510 unmodified lines
520520 for (i = 0; i < obj_desc->buffer.length; i++) {
521521 if (base == 16) {
522522
523− /* Emit 0x prefix for explict/implicit hex conversion */
523+ /* Emit 0x prefix for explicit/implicit hex conversion */
524524
525525 *new_buf++ = '0';
526526 *new_buf++ = 'x';
drivers/acpi/acpica/excreate.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: excreate - Named object creation
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exdebug.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exdebug - Support for stores to the AML Debug Object
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exdump.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exdump - Interpreter debug output routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exfield.c+70−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exfield - AML execution - field_unit read/write
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -41,6 +41,17 @@ const u8 acpi_protocol_lengths[] = { · 31 unmodified lines
4141 0xFF /* F - ATTRIB_RAW_PROCESS_BYTES */
4242 };
4343
44+#define PCC_MASTER_SUBSPACE 3
45+
46+/*
47+ * The following macros determine a given offset is a COMD field.
48+ * According to the specification, generic subspaces (types 0-2) contains a
49+ * 2-byte COMD field at offset 4 and master subspaces (type 3) contains a 4-byte
50+ * COMD field starting at offset 12.
51+ */
52+#define GENERIC_SUBSPACE_COMMAND(a) (4 == a || a == 5)
53+#define MASTER_SUBSPACE_COMMAND(a) (12 <= a && a <= 15)
54+
4455 /*******************************************************************************
4556 *
4657 * FUNCTION: acpi_ex_get_protocol_buffer_length
@@ -177,6 +188,25 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, · 130 unmodified lines
177188
178189 status = acpi_ex_read_gpio(obj_desc, buffer);
179190 goto exit;
191+ } else if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
192+ (obj_desc->field.region_obj->region.space_id ==
193+ ACPI_ADR_SPACE_PLATFORM_COMM)) {
194+ /*
195+ * Reading from a PCC field unit does not require the handler because
196+ * it only requires reading from the internal_pcc_buffer.
197+ */
198+ ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
199+ "PCC FieldRead bits %u\n",
200+ obj_desc->field.bit_length));
201+
202+ memcpy(buffer,
203+ obj_desc->field.region_obj->field.internal_pcc_buffer +
204+ obj_desc->field.base_byte_offset,
205+ (acpi_size)ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.
206+ bit_length));
207+
208+ *ret_buffer_desc = buffer_desc;
209+ return AE_OK;
180210 }
181211
182212 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
@@ -229,6 +259,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, · 46 unmodified lines
229259 {
230260 acpi_status status;
231261 u32 buffer_length;
262+ u32 data_length;
232263 void *buffer;
233264
234265 ACPI_FUNCTION_TRACE_PTR(ex_write_data_to_field, obj_desc);
@@ -272,6 +303,44 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, · 37 unmodified lines
272303 acpi_ex_write_serial_bus(source_desc, obj_desc,
273304 result_desc);
274305 return_ACPI_STATUS(status);
306+ } else if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
307+ (obj_desc->field.region_obj->region.space_id ==
308+ ACPI_ADR_SPACE_PLATFORM_COMM)) {
309+ /*
310+ * According to the spec a write to the COMD field will invoke the
311+ * region handler. Otherwise, write to the pcc_internal buffer. This
312+ * implementation will use the offsets specified rather than the name
313+ * of the field. This is considered safer because some firmware tools
314+ * are known to obfiscate named objects.
315+ */
316+ data_length =
317+ (acpi_size)ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.
318+ bit_length);
319+ memcpy(obj_desc->field.region_obj->field.internal_pcc_buffer +
320+ obj_desc->field.base_byte_offset,
321+ source_desc->buffer.pointer, data_length);
322+
323+ if ((obj_desc->field.region_obj->region.address ==
324+ PCC_MASTER_SUBSPACE
325+ && MASTER_SUBSPACE_COMMAND(obj_desc->field.
326+ base_byte_offset))
327+ || GENERIC_SUBSPACE_COMMAND(obj_desc->field.
328+ base_byte_offset)) {
329+
330+ /* Perform the write */
331+
332+ ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
333+ "PCC COMD field has been written. Invoking PCC handler now.\n"));
334+
335+ status =
336+ acpi_ex_access_region(obj_desc, 0,
337+ (u64 *)obj_desc->field.
338+ region_obj->field.
339+ internal_pcc_buffer,
340+ ACPI_WRITE);
341+ return_ACPI_STATUS(status);
342+ }
343+ return (AE_OK);
275344 }
276345
277346 /* Get a pointer to the data to be written */
drivers/acpi/acpica/exfldio.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exfldio - Aml Field I/O
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exmisc.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exmutex.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exmutex - ASL Mutex Acquire/Release functions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exnames.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exnames - interpreter/scanner name load/execute
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exoparg1.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exoparg1 - AML execution - opcodes with 1 argument
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exoparg2.c+5−5
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exoparg2 - AML execution - opcodes with 2 arguments
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -390,10 +390,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) · 380 unmodified lines
390390 /* Failure means that the Index was beyond the end of the object */
391391
392392 if (ACPI_FAILURE(status)) {
393− ACPI_EXCEPTION((AE_INFO, status,
394− "Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
395− ACPI_FORMAT_UINT64(index),
396− (u32)length));
393+ ACPI_BIOS_EXCEPTION((AE_INFO, status,
394+ "Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
395+ ACPI_FORMAT_UINT64(index),
396+ (u32)length));
397397 goto cleanup;
398398 }
399399
drivers/acpi/acpica/exoparg3.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exoparg3 - AML execution - opcodes with 3 arguments
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exoparg6.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exoparg6 - AML execution - opcodes with 6 arguments
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exprep.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exprep - ACPI AML field prep utilities
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exregion.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exregion - ACPI default op_region (address space) handlers
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exresnte.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exresnte - AML Interpreter object resolution
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exresolv.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exresolv - AML Interpreter object resolution
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exresop.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exresop - AML Interpreter operand/object resolution
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exserial.c+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exserial - field_unit support for serial address spaces
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -21,7 +21,7 @@ ACPI_MODULE_NAME("exserial") · 11 unmodified lines
2121 * FUNCTION: acpi_ex_read_gpio
2222 *
2323 * PARAMETERS: obj_desc - The named field to read
24− * buffer - Where the return data is returnd
24+ * buffer - Where the return data is returned
2525 *
2626 * RETURN: Status
2727 *
drivers/acpi/acpica/exstore.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exstore - AML Interpreter object store support
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exstoren.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Module Name: exstoren - AML Interpreter object store support,
55 * Store to Node (namespace object)
66 *
7− * Copyright (C) 2000 - 2018, Intel Corp.
7+ * Copyright (C) 2000 - 2019, Intel Corp.
88 *
99 *****************************************************************************/
1010
drivers/acpi/acpica/exstorob.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exstorob - AML object store support, store to object
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exsystem.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exsystem - Interface to OS services
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/extrace.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: extrace - Support for interpreter execution tracing
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/exutils.c+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: exutils - interpreter/scanner utilities
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -160,7 +160,7 @@ u8 acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc) · 150 unmodified lines
160160 * RETURN: None
161161 *
162162 * DESCRIPTION: Obtain the ACPI hardware Global Lock, only if the field
163− * flags specifiy that it is to be obtained before field access.
163+ * flags specify that it is to be obtained before field access.
164164 *
165165 ******************************************************************************/
166166
drivers/acpi/acpica/hwacpi.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/hwesleep.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the
55 * extended FADT-V5 sleep registers.
66 *
7− * Copyright (C) 2000 - 2018, Intel Corp.
7+ * Copyright (C) 2000 - 2019, Intel Corp.
88 *
99 *****************************************************************************/
1010
drivers/acpi/acpica/hwgpe.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: hwgpe - Low level GPE enable/disable/clear functions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/hwsleep.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Name: hwsleep.c - ACPI Hardware Sleep/Wake Support functions for the
55 * original/legacy sleep/PM registers.
66 *
7− * Copyright (C) 2000 - 2018, Intel Corp.
7+ * Copyright (C) 2000 - 2019, Intel Corp.
88 *
99 *****************************************************************************/
1010
drivers/acpi/acpica/hwtimer.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: hwtimer.c - ACPI Power Management Timer Interface
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/hwvalid.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: hwvalid - I/O request validation
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/hwxface.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: hwxface - Public ACPICA hardware interfaces
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/hwxfsleep.c+19−79
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -23,33 +23,6 @@ acpi_hw_set_firmware_waking_vector(struct acpi_table_facs *facs, · 13 unmodified lines
2323 acpi_physical_address physical_address64);
2424 #endif
2525
26−static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
27−
28−/*
29− * Dispatch table used to efficiently branch to the various sleep
30− * functions.
31− */
32−#define ACPI_SLEEP_FUNCTION_ID 0
33−#define ACPI_WAKE_PREP_FUNCTION_ID 1
34−#define ACPI_WAKE_FUNCTION_ID 2
35−
36−/* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
37−
38−static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
39− {ACPI_STRUCT_INIT(legacy_function,
40− ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep)),
41− ACPI_STRUCT_INIT(extended_function,
42− acpi_hw_extended_sleep)},
43− {ACPI_STRUCT_INIT(legacy_function,
44− ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep)),
45− ACPI_STRUCT_INIT(extended_function,
46− acpi_hw_extended_wake_prep)},
47− {ACPI_STRUCT_INIT(legacy_function,
48− ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake)),
49− ACPI_STRUCT_INIT(extended_function,
50− acpi_hw_extended_wake)}
51−};
52−
5326 /*
5427 * These functions are removed for the ACPI_REDUCED_HARDWARE case:
5528 * acpi_set_firmware_waking_vector
@@ -209,53 +182,6 @@ acpi_status acpi_enter_sleep_state_s4bios(void) · 153 unmodified lines
209182
210183 ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
211184 #endif /* !ACPI_REDUCED_HARDWARE */
212−/*******************************************************************************
213− *
214− * FUNCTION: acpi_hw_sleep_dispatch
215− *
216− * PARAMETERS: sleep_state - Which sleep state to enter/exit
217− * function_id - Sleep, wake_prep, or Wake
218− *
219− * RETURN: Status from the invoked sleep handling function.
220− *
221− * DESCRIPTION: Dispatch a sleep/wake request to the appropriate handling
222− * function.
223− *
224− ******************************************************************************/
225−static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id)
226−{
227− acpi_status status;
228− struct acpi_sleep_functions *sleep_functions =
229− &acpi_sleep_dispatch[function_id];
230−
231−#if (!ACPI_REDUCED_HARDWARE)
232− /*
233− * If the Hardware Reduced flag is set (from the FADT), we must
234− * use the extended sleep registers (FADT). Note: As per the ACPI
235− * specification, these extended registers are to be used for HW-reduced
236− * platforms only. They are not general-purpose replacements for the
237− * legacy PM register sleep support.
238− */
239− if (acpi_gbl_reduced_hardware) {
240− status = sleep_functions->extended_function(sleep_state);
241− } else {
242− /* Legacy sleep */
243−
244− status = sleep_functions->legacy_function(sleep_state);
245− }
246−
247− return (status);
248−
249−#else
250− /*
251− * For the case where reduced-hardware-only code is being generated,
252− * we know that only the extended sleep registers are available
253− */
254− status = sleep_functions->extended_function(sleep_state);
255− return (status);
256−
257−#endif /* !ACPI_REDUCED_HARDWARE */
258−}
259185
260186 /*******************************************************************************
261187 *
@@ -362,7 +288,12 @@ acpi_status acpi_enter_sleep_state(u8 sleep_state) · 100 unmodified lines
362288 return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
363289 }
364290
365− status = acpi_hw_sleep_dispatch(sleep_state, ACPI_SLEEP_FUNCTION_ID);
291+#if !ACPI_REDUCED_HARDWARE
292+ if (!acpi_gbl_reduced_hardware)
293+ status = acpi_hw_legacy_sleep(sleep_state);
294+ else
295+#endif
296+ status = acpi_hw_extended_sleep(sleep_state);
366297 return_ACPI_STATUS(status);
367298 }
368299
@@ -388,8 +319,12 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state) · 19 unmodified lines
388319
389320 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep);
390321
391− status =
392− acpi_hw_sleep_dispatch(sleep_state, ACPI_WAKE_PREP_FUNCTION_ID);
322+#if !ACPI_REDUCED_HARDWARE
323+ if (!acpi_gbl_reduced_hardware)
324+ status = acpi_hw_legacy_wake_prep(sleep_state);
325+ else
326+#endif
327+ status = acpi_hw_extended_wake_prep(sleep_state);
393328 return_ACPI_STATUS(status);
394329 }
395330
@@ -413,7 +348,12 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) · 17 unmodified lines
413348
414349 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
415350
416− status = acpi_hw_sleep_dispatch(sleep_state, ACPI_WAKE_FUNCTION_ID);
351+#if !ACPI_REDUCED_HARDWARE
352+ if (!acpi_gbl_reduced_hardware)
353+ status = acpi_hw_legacy_wake(sleep_state);
354+ else
355+#endif
356+ status = acpi_hw_extended_wake(sleep_state);
417357 return_ACPI_STATUS(status);
418358 }
419359
drivers/acpi/acpica/nsarguments.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: nsarguments - Validation of args for ACPI predefined methods
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/nsconvert.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Module Name: nsconvert - Object conversions for objects returned by
55 * predefined methods
66 *
7− * Copyright (C) 2000 - 2018, Intel Corp.
7+ * Copyright (C) 2000 - 2019, Intel Corp.
88 *
99 *****************************************************************************/
1010
drivers/acpi/acpica/nsdump.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: nsdump - table dumping routines for debug
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/nsdumpdv.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: nsdump - table dumping routines for debug
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/nsinit.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: nsinit - namespace initialization
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/nsload.c+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: nsload - namespace loading/expanding/contracting procedures
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -75,7 +75,7 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node) · 65 unmodified lines
7575 /*
7676 * On error, delete any namespace objects created by this table.
7777 * We cannot initialize these objects, so delete them. There are
78− * a couple of expecially bad cases:
78+ * a couple of especially bad cases:
7979 * AE_ALREADY_EXISTS - namespace collision.
8080 * AE_NOT_FOUND - the target of a Scope operator does not
8181 * exist. This target of Scope must already exist in the
drivers/acpi/acpica/nsparse.c+13−55
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: nsparse - namespace interface to AML parser
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -253,61 +253,19 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node) · 243 unmodified lines
253253
254254 ACPI_FUNCTION_TRACE(ns_parse_table);
255255
256− if (acpi_gbl_execute_tables_as_methods) {
257− /*
258− * This case executes the AML table as one large control method.
259− * The point of this is to execute any module-level code in-place
260− * as the table is parsed. Some AML code depends on this behavior.
261− *
262− * It is a run-time option at this time, but will eventually become
263− * the default.
264− *
265− * Note: This causes the table to only have a single-pass parse.
266− * However, this is compatible with other ACPI implementations.
267− */
268− ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
269− "%s: **** Start table execution pass\n",
270− ACPI_GET_FUNCTION_NAME));
271−
272− status = acpi_ns_execute_table(table_index, start_node);
273− if (ACPI_FAILURE(status)) {
274− return_ACPI_STATUS(status);
275− }
276− } else {
277− /*
278− * AML Parse, pass 1
279− *
280− * In this pass, we load most of the namespace. Control methods
281− * are not parsed until later. A parse tree is not created.
282− * Instead, each Parser Op subtree is deleted when it is finished.
283− * This saves a great deal of memory, and allows a small cache of
284− * parse objects to service the entire parse. The second pass of
285− * the parse then performs another complete parse of the AML.
286− */
287− ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n"));
288−
289− status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1,
290− table_index, start_node);
291− if (ACPI_FAILURE(status)) {
292− return_ACPI_STATUS(status);
293− }
256+ /*
257+ * Executes the AML table as one large control method.
258+ * The point of this is to execute any module-level code in-place
259+ * as the table is parsed. Some AML code depends on this behavior.
260+ *
261+ * Note: This causes the table to only have a single-pass parse.
262+ * However, this is compatible with other ACPI implementations.
263+ */
264+ ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
265+ "%s: **** Start table execution pass\n",
266+ ACPI_GET_FUNCTION_NAME));
294267
295− /*
296− * AML Parse, pass 2
297− *
298− * In this pass, we resolve forward references and other things
299− * that could not be completed during the first pass.
300− * Another complete parse of the AML is performed, but the
301− * overhead of this is compensated for by the fact that the
302− * parse objects are all cached.
303− */
304− ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n"));
305− status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2,
306− table_index, start_node);
307− if (ACPI_FAILURE(status)) {
308− return_ACPI_STATUS(status);
309− }
310− }
268+ status = acpi_ns_execute_table(table_index, start_node);
311269
312270 return_ACPI_STATUS(status);
313271 }
drivers/acpi/acpica/nspredef.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: nspredef - Validation of ACPI predefined methods and objects
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/nsprepkg.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: nsprepkg - Validation of package objects for predefined names
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/nsrepair.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: nsrepair - Repair for objects returned by predefined methods
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/nsrepair2.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Module Name: nsrepair2 - Repair for objects returned by specific
55 * predefined methods
66 *
7− * Copyright (C) 2000 - 2018, Intel Corp.
7+ * Copyright (C) 2000 - 2019, Intel Corp.
88 *
99 *****************************************************************************/
1010
drivers/acpi/acpica/nsutils.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
55 * parents and siblings and Scope manipulation
66 *
7− * Copyright (C) 2000 - 2018, Intel Corp.
7+ * Copyright (C) 2000 - 2019, Intel Corp.
88 *
99 *****************************************************************************/
1010
@@ -350,7 +350,7 @@ acpi_ns_internalize_name(const char *external_name, char **converted_name) · 339 unmodified lines
350350 *
351351 * FUNCTION: acpi_ns_externalize_name
352352 *
353− * PARAMETERS: internal_name_length - Lenth of the internal name below
353+ * PARAMETERS: internal_name_length - Length of the internal name below
354354 * internal_name - Internal representation of name
355355 * converted_name_length - Where the length is returned
356356 * converted_name - Where the resulting external name
drivers/acpi/acpica/nswalk.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: nswalk - Functions for walking the ACPI namespace
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/nsxfname.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Module Name: nsxfname - Public interfaces to the ACPI subsystem
55 * ACPI Namespace oriented interfaces
66 *
7− * Copyright (C) 2000 - 2018, Intel Corp.
7+ * Copyright (C) 2000 - 2019, Intel Corp.
88 *
99 *****************************************************************************/
1010
drivers/acpi/acpica/psargs.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: psargs - Parse AML opcode arguments
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/psloop.c+1−194
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: psloop - Main AML parse loop
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -32,10 +32,6 @@ static acpi_status · 22 unmodified lines
3232 acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
3333 u8 * aml_op_start, union acpi_parse_object *op);
3434
35−static void
36−acpi_ps_link_module_code(union acpi_parse_object *parent_op,
37− u8 *aml_start, u32 aml_length, acpi_owner_id owner_id);
38−
3935 /*******************************************************************************
4036 *
4137 * FUNCTION: acpi_ps_get_arguments
@@ -56,7 +52,6 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state, · 14 unmodified lines
5652 {
5753 acpi_status status = AE_OK;
5854 union acpi_parse_object *arg = NULL;
59− const struct acpi_opcode_info *op_info;
6055
6156 ACPI_FUNCTION_TRACE_PTR(ps_get_arguments, walk_state);
6257
@@ -136,96 +131,6 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state, · 73 unmodified lines
136131 walk_state->arg_count,
137132 walk_state->pass_number));
138133
139− /*
140− * This case handles the legacy option that groups all module-level
141− * code blocks together and defers execution until all of the tables
142− * are loaded. Execute all of these blocks at this time.
143− * Execute any module-level code that was detected during the table
144− * load phase.
145− *
146− * Note: this option is deprecated and will be eliminated in the
147− * future. Use of this option can cause problems with AML code that
148− * depends upon in-order immediate execution of module-level code.
149− */
150− if (!acpi_gbl_execute_tables_as_methods &&
151− (walk_state->pass_number <= ACPI_IMODE_LOAD_PASS2) &&
152− ((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) == 0)) {
153− /*
154− * We want to skip If/Else/While constructs during Pass1 because we
155− * want to actually conditionally execute the code during Pass2.
156− *
157− * Except for disassembly, where we always want to walk the
158− * If/Else/While packages
159− */
160− switch (op->common.aml_opcode) {
161− case AML_IF_OP:
162− case AML_ELSE_OP:
163− case AML_WHILE_OP:
164− /*
165− * Currently supported module-level opcodes are:
166− * IF/ELSE/WHILE. These appear to be the most common,
167− * and easiest to support since they open an AML
168− * package.
169− */
170− if (walk_state->pass_number ==
171− ACPI_IMODE_LOAD_PASS1) {
172− acpi_ps_link_module_code(op->common.
173− parent,
174− aml_op_start,
175− (u32)
176− (walk_state->
177− parser_state.
178− pkg_end -
179− aml_op_start),
180− walk_state->
181− owner_id);
182− }
183−
184− ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
185− "Pass1: Skipping an If/Else/While body\n"));
186−
187− /* Skip body of if/else/while in pass 1 */
188−
189− walk_state->parser_state.aml =
190− walk_state->parser_state.pkg_end;
191− walk_state->arg_count = 0;
192− break;
193−
194− default:
195− /*
196− * Check for an unsupported executable opcode at module
197− * level. We must be in PASS1, the parent must be a SCOPE,
198− * The opcode class must be EXECUTE, and the opcode must
199− * not be an argument to another opcode.
200− */
201− if ((walk_state->pass_number ==
202− ACPI_IMODE_LOAD_PASS1)
203− && (op->common.parent->common.aml_opcode ==
204− AML_SCOPE_OP)) {
205− op_info =
206− acpi_ps_get_opcode_info(op->common.
207− aml_opcode);
208− if ((op_info->class ==
209− AML_CLASS_EXECUTE) && (!arg)) {
210− ACPI_WARNING((AE_INFO,
211− "Unsupported module-level executable opcode "
212− "0x%.2X at table offset 0x%.4X",
213− op->common.
214− aml_opcode,
215− (u32)
216− (ACPI_PTR_DIFF
217− (aml_op_start,
218− walk_state->
219− parser_state.
220− aml_start) +
221− sizeof(struct
222− acpi_table_header))));
223− }
224− }
225− break;
226− }
227− }
228−
229134 /* Special processing for certain opcodes */
230135
231136 switch (op->common.aml_opcode) {
@@ -300,104 +205,6 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state, · 68 unmodified lines
300205 return_ACPI_STATUS(AE_OK);
301206 }
302207
303−/*******************************************************************************
304− *
305− * FUNCTION: acpi_ps_link_module_code
306− *
307− * PARAMETERS: parent_op - Parent parser op
308− * aml_start - Pointer to the AML
309− * aml_length - Length of executable AML
310− * owner_id - owner_id of module level code
311− *
312− * RETURN: None.
313− *
314− * DESCRIPTION: Wrap the module-level code with a method object and link the
315− * object to the global list. Note, the mutex field of the method
316− * object is used to link multiple module-level code objects.
317− *
318− * NOTE: In this legacy option, each block of detected executable AML
319− * code that is outside of any control method is wrapped with a temporary
320− * control method object and placed on a global list below.
321− *
322− * This function executes the module-level code for all tables only after
323− * all of the tables have been loaded. It is a legacy option and is
324− * not compatible with other ACPI implementations. See acpi_ns_load_table.
325− *
326− * This function will be removed when the legacy option is removed.
327− *
328− ******************************************************************************/
329−
330−static void
331−acpi_ps_link_module_code(union acpi_parse_object *parent_op,
332− u8 *aml_start, u32 aml_length, acpi_owner_id owner_id)
333−{
334− union acpi_operand_object *prev;
335− union acpi_operand_object *next;
336− union acpi_operand_object *method_obj;
337− struct acpi_namespace_node *parent_node;
338−
339− ACPI_FUNCTION_TRACE(ps_link_module_code);
340−
341− /* Get the tail of the list */
342−
343− prev = next = acpi_gbl_module_code_list;
344− while (next) {
345− prev = next;
346− next = next->method.mutex;
347− }
348−
349− /*
350− * Insert the module level code into the list. Merge it if it is
351− * adjacent to the previous element.
352− */
353− if (!prev ||
354− ((prev->method.aml_start + prev->method.aml_length) != aml_start)) {
355−
356− /* Create, initialize, and link a new temporary method object */
357−
358− method_obj = acpi_ut_create_internal_object(ACPI_TYPE_METHOD);
359− if (!method_obj) {
360− return_VOID;
361− }
362−
363− ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
364− "Create/Link new code block: %p\n",
365− method_obj));
366−
367− if (parent_op->common.node) {
368− parent_node = parent_op->common.node;
369− } else {
370− parent_node = acpi_gbl_root_node;
371− }
372−
373− method_obj->method.aml_start = aml_start;
374− method_obj->method.aml_length = aml_length;
375− method_obj->method.owner_id = owner_id;
376− method_obj->method.info_flags |= ACPI_METHOD_MODULE_LEVEL;
377−
378− /*
379− * Save the parent node in next_object. This is cheating, but we
380− * don't want to expand the method object.
381− */
382− method_obj->method.next_object =
383− ACPI_CAST_PTR(union acpi_operand_object, parent_node);
384−
385− if (!prev) {
386− acpi_gbl_module_code_list = method_obj;
387− } else {
388− prev->method.mutex = method_obj;
389− }
390− } else {
391− ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
392− "Appending to existing code block: %p\n",
393− prev));
394−
395− prev->method.aml_length += aml_length;
396− }
397−
398− return_VOID;
399−}
400−
401208 /*******************************************************************************
402209 *
403210 * FUNCTION: acpi_ps_parse_loop
drivers/acpi/acpica/psobject.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: psobject - Support for parse objects
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/psopcode.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: psopcode - Parser/Interpreter opcode information table
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/psopinfo.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: psopinfo - AML opcode information functions and dispatch tables
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/psparse.c+5−5
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: psparse - Parser top level AML parse routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -523,12 +523,12 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) · 513 unmodified lines
523523 if (status == AE_ABORT_METHOD) {
524524 acpi_ns_print_node_pathname(walk_state->
525525 method_node,
526− "Method aborted:");
526+ "Aborting method");
527527 acpi_os_printf("\n");
528528 } else {
529− ACPI_ERROR_METHOD
530− ("Method parse/execution failed",
531− walk_state->method_node, NULL, status);
529+ ACPI_ERROR_METHOD("Aborting method",
530+ walk_state->method_node, NULL,
531+ status);
532532 }
533533 acpi_ex_enter_interpreter();
534534
drivers/acpi/acpica/psscope.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: psscope - Parser scope stack management routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/pstree.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: pstree - Parser op tree manipulation/traversal/search
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/psutils.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: psutils - Parser miscellaneous utilities (Parser only)
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/pswalk.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: pswalk - Parser routines to walk parsed op tree(s)
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/psxface.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: psxface - Parser external interfaces
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/rsdumpinfo.c+7−7
@@ -32,7 +32,7 @@ struct acpi_rsdump_info acpi_rs_dump_irq[7] = { · 31 unmodified lines
3232 acpi_gbl_he_decode},
3333 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.polarity), "Polarity",
3434 acpi_gbl_ll_decode},
35− {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(irq.sharable), "Sharing",
35+ {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(irq.shareable), "Sharing",
3636 acpi_gbl_shr_decode},
3737 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.interrupt_count),
3838 "Interrupt Count", NULL},
@@ -222,7 +222,7 @@ struct acpi_rsdump_info acpi_rs_dump_ext_irq[8] = { · 183 unmodified lines
222222 "Triggering", acpi_gbl_he_decode},
223223 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.polarity), "Polarity",
224224 acpi_gbl_ll_decode},
225− {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(extended_irq.sharable), "Sharing",
225+ {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(extended_irq.shareable), "Sharing",
226226 acpi_gbl_shr_decode},
227227 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(extended_irq.resource_source), NULL,
228228 NULL},
@@ -255,7 +255,7 @@ struct acpi_rsdump_info acpi_rs_dump_gpio[16] = { · 26 unmodified lines
255255 "ProducerConsumer", acpi_gbl_consume_decode},
256256 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.pin_config), "PinConfig",
257257 acpi_gbl_ppc_decode},
258− {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.sharable), "Sharing",
258+ {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.shareable), "Sharing",
259259 acpi_gbl_shr_decode},
260260 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.io_restriction),
261261 "IoRestriction", acpi_gbl_ior_decode},
@@ -285,7 +285,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_function[10] = { · 23 unmodified lines
285285 "RevisionId", NULL},
286286 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_function.pin_config), "PinConfig",
287287 acpi_gbl_ppc_decode},
288− {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_function.sharable), "Sharing",
288+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_function.shareable), "Sharing",
289289 acpi_gbl_shr_decode},
290290 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.function_number),
291291 "FunctionNumber", NULL},
@@ -308,7 +308,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_config[11] = { · 16 unmodified lines
308308 NULL},
309309 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.producer_consumer),
310310 "ProducerConsumer", acpi_gbl_consume_decode},
311− {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.sharable), "Sharing",
311+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.shareable), "Sharing",
312312 acpi_gbl_shr_decode},
313313 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_config.pin_config_type),
314314 "PinConfigType", NULL},
@@ -353,7 +353,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_group_function[9] = { · 38 unmodified lines
353353 {ACPI_RSD_1BITFLAG,
354354 ACPI_RSD_OFFSET(pin_group_function.producer_consumer),
355355 "ProducerConsumer", acpi_gbl_consume_decode},
356− {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_function.sharable),
356+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_function.shareable),
357357 "Sharing", acpi_gbl_shr_decode},
358358 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_function.function_number),
359359 "FunctionNumber", NULL},
@@ -375,7 +375,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_group_config[10] = { · 15 unmodified lines
375375 "RevisionId", NULL},
376376 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.producer_consumer),
377377 "ProducerConsumer", acpi_gbl_consume_decode},
378− {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.sharable),
378+ {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.shareable),
379379 "Sharing", acpi_gbl_shr_decode},
380380 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_config.pin_config_type),
381381 "PinConfigType", NULL},
drivers/acpi/acpica/rsirq.c+4−4
@@ -54,7 +54,7 @@ struct acpi_rsconvert_info acpi_rs_get_irq[9] = { · 53 unmodified lines
5454 AML_OFFSET(irq.flags),
5555 3},
5656
57− {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
57+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.shareable),
5858 AML_OFFSET(irq.flags),
5959 4},
6060
@@ -92,7 +92,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[14] = { · 31 unmodified lines
9292 AML_OFFSET(irq.flags),
9393 3},
9494
95− {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable),
95+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.shareable),
9696 AML_OFFSET(irq.flags),
9797 4},
9898
@@ -139,7 +139,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[14] = { · 40 unmodified lines
139139 ACPI_ACTIVE_HIGH},
140140
141141 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
142− ACPI_RS_OFFSET(data.irq.sharable),
142+ ACPI_RS_OFFSET(data.irq.shareable),
143143 ACPI_EXCLUSIVE},
144144
145145 /* We can optimize to a 2-byte irq_no_flags() descriptor */
@@ -178,7 +178,7 @@ struct acpi_rsconvert_info acpi_rs_convert_ext_irq[10] = { · 32 unmodified lines
178178 AML_OFFSET(extended_irq.flags),
179179 2},
180180
181− {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable),
181+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.shareable),
182182 AML_OFFSET(extended_irq.flags),
183183 3},
184184
drivers/acpi/acpica/rsserial.c+5−5
@@ -39,7 +39,7 @@ struct acpi_rsconvert_info acpi_rs_convert_gpio[18] = { · 38 unmodified lines
3939 AML_OFFSET(gpio.flags),
4040 0},
4141
42− {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.sharable),
42+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.shareable),
4343 AML_OFFSET(gpio.int_flags),
4444 3},
4545
@@ -128,7 +128,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_function[13] = { · 82 unmodified lines
128128 AML_OFFSET(pin_function.revision_id),
129129 1},
130130
131− {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_function.sharable),
131+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_function.shareable),
132132 AML_OFFSET(pin_function.flags),
133133 0},
134134
@@ -518,7 +518,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_config[14] = { · 383 unmodified lines
518518 AML_OFFSET(pin_config.revision_id),
519519 1},
520520
521− {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_config.sharable),
521+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_config.shareable),
522522 AML_OFFSET(pin_config.flags),
523523 0},
524524
@@ -658,7 +658,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_group_function[13] = { · 133 unmodified lines
658658 AML_OFFSET(pin_group_function.revision_id),
659659 1},
660660
661− {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_function.sharable),
661+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_function.shareable),
662662 AML_OFFSET(pin_group_function.flags),
663663 0},
664664
@@ -735,7 +735,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_group_config[14] = { · 70 unmodified lines
735735 AML_OFFSET(pin_group_config.revision_id),
736736 1},
737737
738− {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_config.sharable),
738+ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_config.shareable),
739739 AML_OFFSET(pin_group_config.flags),
740740 0},
741741
drivers/acpi/acpica/tbdata.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: tbdata - Table manager data structure functions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/tbfadt.c+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: tbfadt - FADT table utilities
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -556,7 +556,7 @@ static void acpi_tb_convert_fadt(void) · 546 unmodified lines
556556 * 64-bit X length field.
557557 * Note: If the legacy length field is > 0xFF bits, ignore
558558 * this check. (GPE registers can be larger than the
559− * 64-bit GAS structure can accomodate, 0xFF bits).
559+ * 64-bit GAS structure can accommodate, 0xFF bits).
560560 */
561561 if ((ACPI_MUL_8(length) <= ACPI_UINT8_MAX) &&
562562 (address64->bit_width !=
drivers/acpi/acpica/tbfind.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: tbfind - find table
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/tbinstal.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: tbinstal - ACPI table installation and removal
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/tbprint.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: tbprint - Table output utilities
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/tbutils.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: tbutils - ACPI Table utilities
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/tbxface.c+3−3
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: tbxface - ACPI table-oriented external interfaces
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -108,7 +108,7 @@ acpi_initialize_tables(struct acpi_table_desc *initial_table_array, · 98 unmodified lines
108108 /*
109109 * Get the root table (RSDT or XSDT) and extract all entries to the local
110110 * Root Table Array. This array contains the information of the RSDT/XSDT
111− * in a common, more useable format.
111+ * in a common, more usable format.
112112 */
113113 status = acpi_tb_parse_root_table(rsdp_address);
114114 return_ACPI_STATUS(status);
@@ -169,7 +169,7 @@ acpi_status ACPI_INIT_FUNCTION acpi_reallocate_root_table(void) · 54 unmodified lines
169169 if (!acpi_gbl_enable_table_validation) {
170170 /*
171171 * Now it's safe to do full table validation. We can do deferred
172− * table initilization here once the flag is set.
172+ * table initialization here once the flag is set.
173173 */
174174 acpi_gbl_enable_table_validation = TRUE;
175175 for (i = 0; i < acpi_gbl_root_table_list.current_table_count;
drivers/acpi/acpica/tbxfload.c+11−16
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: tbxfload - Table load/unload external interfaces
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -69,23 +69,18 @@ acpi_status ACPI_INIT_FUNCTION acpi_load_tables(void) · 59 unmodified lines
6969 "While loading namespace from ACPI tables"));
7070 }
7171
72− if (acpi_gbl_execute_tables_as_methods) {
73− /*
74− * If the module-level code support is enabled, initialize the objects
75− * in the namespace that remain uninitialized. This runs the executable
76− * AML that may be part of the declaration of these name objects:
77− * operation_regions, buffer_fields, Buffers, and Packages.
78− *
79− * Note: The module-level code is optional at this time, but will
80− * become the default in the future.
81− */
82− status = acpi_ns_initialize_objects();
83− if (ACPI_FAILURE(status)) {
84− return_ACPI_STATUS(status);
85− }
72+ /*
73+ * Initialize the objects in the namespace that remain uninitialized.
74+ * This runs the executable AML that may be part of the declaration of
75+ * these name objects:
76+ * operation_regions, buffer_fields, Buffers, and Packages.
77+ *
78+ */
79+ status = acpi_ns_initialize_objects();
80+ if (ACPI_SUCCESS(status)) {
81+ acpi_gbl_namespace_initialized = TRUE;
8682 }
8783
88− acpi_gbl_namespace_initialized = TRUE;
8984 return_ACPI_STATUS(status);
9085 }
9186
drivers/acpi/acpica/tbxfroot.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: tbxfroot - Find the root ACPI table (RSDT)
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utaddress.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utaddress - op_region address range check
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utalloc.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utalloc - local memory allocation routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utascii.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utascii - Utility ascii functions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utbuffer.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utbuffer - Buffer dump routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utcache.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utcache - local cache allocation routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utcopy.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utcopy - Internal to external object translation utilities
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utdebug.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utdebug - Debug print/trace routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utdecode.c+11−9
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utdecode - Utility decoding routines (value-to-string)
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -284,7 +284,7 @@ const char *acpi_ut_get_node_name(void *object) · 274 unmodified lines
284284
285285 static const char *acpi_gbl_desc_type_names[] = {
286286 /* 00 */ "Not a Descriptor",
287− /* 01 */ "Cached",
287+ /* 01 */ "Cached Object",
288288 /* 02 */ "State-Generic",
289289 /* 03 */ "State-Update",
290290 /* 04 */ "State-Package",
@@ -295,10 +295,10 @@ static const char *acpi_gbl_desc_type_names[] = { · 4 unmodified lines
295295 /* 09 */ "State-Result",
296296 /* 10 */ "State-Notify",
297297 /* 11 */ "State-Thread",
298− /* 12 */ "Walk",
299− /* 13 */ "Parser",
300− /* 14 */ "Operand",
301− /* 15 */ "Node"
298+ /* 12 */ "Tree Walk State",
299+ /* 13 */ "Parse Tree Op",
300+ /* 14 */ "Operand Object",
301+ /* 15 */ "Namespace Node"
302302 };
303303
304304 const char *acpi_ut_get_descriptor_name(void *object)
@@ -430,8 +430,10 @@ static const char *acpi_gbl_generic_notify[ACPI_GENERIC_NOTIFY_MAX + 1] = { · 125 unmodified lines
430430 /* 0C */ "Reserved (was previously Shutdown Request)",
431431 /* Reserved in ACPI 6.0 */
432432 /* 0D */ "System Resource Affinity Update",
433− /* 0E */ "Heterogeneous Memory Attributes Update"
433+ /* 0E */ "Heterogeneous Memory Attributes Update",
434434 /* ACPI 6.2 */
435+ /* 0F */ "Error Disconnect Recover"
436+ /* ACPI 6.3 */
435437 };
436438
437439 static const char *acpi_gbl_device_notify[5] = {
@@ -461,13 +463,13 @@ static const char *acpi_gbl_thermal_notify[5] = { · 23 unmodified lines
461463 const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type)
462464 {
463465
464− /* 00 - 0D are "common to all object types" (from ACPI Spec) */
466+ /* 00 - 0F are "common to all object types" (from ACPI Spec) */
465467
466468 if (notify_value <= ACPI_GENERIC_NOTIFY_MAX) {
467469 return (acpi_gbl_generic_notify[notify_value]);
468470 }
469471
470− /* 0E - 7F are reserved */
472+ /* 10 - 7F are reserved */
471473
472474 if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
473475 return ("Reserved");
drivers/acpi/acpica/utdelete.c+4−0
@@ -257,6 +257,10 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) · 256 unmodified lines
257257
258258 acpi_ut_delete_object_desc(second_desc);
259259 }
260+ if (object->field.internal_pcc_buffer) {
261+ ACPI_FREE(object->field.internal_pcc_buffer);
262+ }
263+
260264 break;
261265
262266 case ACPI_TYPE_BUFFER_FIELD:
drivers/acpi/acpica/uterror.c+5−4
@@ -183,19 +183,19 @@ acpi_ut_prefixed_namespace_error(const char *module_name, · 182 unmodified lines
183183 case AE_ALREADY_EXISTS:
184184
185185 acpi_os_printf(ACPI_MSG_BIOS_ERROR);
186− message = "Failure creating";
186+ message = "Failure creating named object";
187187 break;
188188
189189 case AE_NOT_FOUND:
190190
191191 acpi_os_printf(ACPI_MSG_BIOS_ERROR);
192− message = "Could not resolve";
192+ message = "Could not resolve symbol";
193193 break;
194194
195195 default:
196196
197197 acpi_os_printf(ACPI_MSG_ERROR);
198− message = "Failure resolving";
198+ message = "Failure resolving symbol";
199199 break;
200200 }
201201
@@ -317,7 +317,8 @@ acpi_ut_method_error(const char *module_name, · 115 unmodified lines
317317 }
318318
319319 acpi_ns_print_node_pathname(node, message);
320− acpi_os_printf(", %s", acpi_format_exception(method_status));
320+ acpi_os_printf(" due to previous error (%s)",
321+ acpi_format_exception(method_status));
321322
322323 ACPI_MSG_SUFFIX;
323324 ACPI_MSG_REDIRECT_END;
drivers/acpi/acpica/uteval.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: uteval - Object evaluation
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utglobal.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utglobal - Global variables for the ACPI subsystem
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/uthex.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: uthex -- Hex/ASCII support functions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utids.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utids - support for device Ids - HID, UID, CID, SUB, CLS
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utinit.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utinit - Common ACPI subsystem initialization
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utlock.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utlock - Reader/Writer lock interfaces
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utobject.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utobject - ACPI object create/delete/size/cache routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utosi.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utosi - Support for the _OSI predefined control method
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utpredef.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utpredef - support functions for predefined names
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utprint.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utprint - Formatted printing routines
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/uttrack.c+13−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: uttrack - Memory allocation tracking routines (debug only)
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -588,6 +588,18 @@ void acpi_ut_dump_allocations(u32 component, const char *module) · 578 unmodified lines
588588 acpi_ut_get_descriptor_name
589589 (descriptor));
590590
591+ /* Optional object hex dump */
592+
593+ if (acpi_gbl_verbose_leak_dump) {
594+ acpi_os_printf("\n");
595+ acpi_ut_dump_buffer((u8 *)
596+ descriptor,
597+ element->
598+ size,
599+ DB_BYTE_DISPLAY,
600+ 0);
601+ }
602+
591603 /* Validate the descriptor type using Type field and length */
592604
593605 descriptor_type = 0; /* Not a valid descriptor type */
drivers/acpi/acpica/utuuid.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utuuid -- UUID support functions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utxface.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utxface - External interfaces, miscellaneous utility functions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/acpica/utxferror.c+44−0
@@ -185,6 +185,50 @@ acpi_bios_error(const char *module_name, · 184 unmodified lines
185185
186186 ACPI_EXPORT_SYMBOL(acpi_bios_error)
187187
188+/*******************************************************************************
189+ *
190+ * FUNCTION: acpi_bios_exception
191+ *
192+ * PARAMETERS: module_name - Caller's module name (for error output)
193+ * line_number - Caller's line number (for error output)
194+ * status - Status value to be decoded/formatted
195+ * format - Printf format string + additional args
196+ *
197+ * RETURN: None
198+ *
199+ * DESCRIPTION: Print an "ACPI Firmware Error" message with module/line/version
200+ * info as well as decoded acpi_status.
201+ *
202+ ******************************************************************************/
203+void ACPI_INTERNAL_VAR_XFACE
204+acpi_bios_exception(const char *module_name,
205+ u32 line_number,
206+ acpi_status status, const char *format, ...)
207+{
208+ va_list arg_list;
209+
210+ ACPI_MSG_REDIRECT_BEGIN;
211+
212+ /* For AE_OK, just print the message */
213+
214+ if (ACPI_SUCCESS(status)) {
215+ acpi_os_printf(ACPI_MSG_BIOS_ERROR);
216+
217+ } else {
218+ acpi_os_printf(ACPI_MSG_BIOS_ERROR "%s, ",
219+ acpi_format_exception(status));
220+ }
221+
222+ va_start(arg_list, format);
223+ acpi_os_vprintf(format, arg_list);
224+ ACPI_MSG_SUFFIX;
225+ va_end(arg_list);
226+
227+ ACPI_MSG_REDIRECT_END;
228+}
229+
230+ACPI_EXPORT_SYMBOL(acpi_bios_exception)
231+
188232 /*******************************************************************************
189233 *
190234 * FUNCTION: acpi_bios_warning
drivers/acpi/acpica/utxfinit.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: utxfinit - External interfaces for ACPICA initialization
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
drivers/acpi/apei/Kconfig+1−11
@@ -41,19 +41,9 @@ config ACPI_APEI_PCIEAER · 40 unmodified lines
4141 Turn on this option to enable the corresponding support.
4242
4343 config ACPI_APEI_SEA
44− bool "APEI Synchronous External Abort logging/recovering support"
44+ bool
4545 depends on ARM64 && ACPI_APEI_GHES
4646 default y
47− help
48− This option should be enabled if the system supports
49− firmware first handling of SEA (Synchronous External Abort).
50− SEA happens with certain faults of data abort or instruction
51− abort synchronous exceptions on ARMv8 systems. If a system
52− supports firmware first handling of SEA, the platform analyzes
53− and handles hardware error notifications from SEA, and it may then
54− form a HW error record for the OS to parse and handle. This
55− option allows the OS to look for such hardware error record, and
56− take appropriate action.
5747
5848 config ACPI_APEI_MEMORY_FAILURE
5949 bool "APEI memory error recovering support"
drivers/acpi/apei/bert.c+10−13
@@ -42,15 +42,7 @@ static void __init bert_print_all(struct acpi_bert_region *region, · 41 unmodified lines
4242 int remain = region_len;
4343 u32 estatus_len;
4444
45− if (!estatus->block_status)
46− return;
47−
48− while (remain > sizeof(struct acpi_bert_region)) {
49− if (cper_estatus_check(estatus)) {
50− pr_err(FW_BUG "Invalid error record.\n");
51− return;
52− }
53−
45+ while (remain >= sizeof(struct acpi_bert_region)) {
5446 estatus_len = cper_estatus_len(estatus);
5547 if (remain < estatus_len) {
5648 pr_err(FW_BUG "Truncated status block (length: %u).\n",
@@ -58,6 +50,15 @@ static void __init bert_print_all(struct acpi_bert_region *region, · 1 unmodified line
5850 return;
5951 }
6052
53+ /* No more error records. */
54+ if (!estatus->block_status)
55+ return;
56+
57+ if (cper_estatus_check(estatus)) {
58+ pr_err(FW_BUG "Invalid error record.\n");
59+ return;
60+ }
61+
6162 pr_info_once("Error records from previous boot:\n");
6263
6364 cper_estatus_print(KERN_INFO HW_ERR, estatus);
@@ -70,10 +71,6 @@ static void __init bert_print_all(struct acpi_bert_region *region, · 6 unmodified lines
7071 estatus->block_status = 0;
7172
7273 estatus = (void *)estatus + estatus_len;
73− /* No more error records. */
74− if (!estatus->block_status)
75− return;
76−
7774 remain -= estatus_len;
7875 }
7976 }
drivers/acpi/apei/einj.c+25−68
@@ -644,8 +644,8 @@ static int error_type_set(void *data, u64 val) · 643 unmodified lines
644644 return 0;
645645 }
646646
647−DEFINE_SIMPLE_ATTRIBUTE(error_type_fops, error_type_get,
648− error_type_set, "0x%llx\n");
647+DEFINE_DEBUGFS_ATTRIBUTE(error_type_fops, error_type_get, error_type_set,
648+ "0x%llx\n");
649649
650650 static int error_inject_set(void *data, u64 val)
651651 {
@@ -656,8 +656,7 @@ static int error_inject_set(void *data, u64 val) · 4 unmodified lines
656656 error_param3, error_param4);
657657 }
658658
659−DEFINE_SIMPLE_ATTRIBUTE(error_inject_fops, NULL,
660− error_inject_set, "%llu\n");
659+DEFINE_DEBUGFS_ATTRIBUTE(error_inject_fops, NULL, error_inject_set, "%llu\n");
661660
662661 static int einj_check_table(struct acpi_table_einj *einj_tab)
663662 {
@@ -679,7 +678,6 @@ static int __init einj_init(void) · 15 unmodified lines
679678 {
680679 int rc;
681680 acpi_status status;
682− struct dentry *fentry;
683681 struct apei_exec_context ctx;
684682
685683 if (acpi_disabled) {
@@ -707,25 +705,13 @@ static int __init einj_init(void) · 21 unmodified lines
707705
708706 rc = -ENOMEM;
709707 einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir());
710− if (!einj_debug_dir) {
711− pr_err("Error creating debugfs node.\n");
712− goto err_cleanup;
713− }
714708
715− fentry = debugfs_create_file("available_error_type", S_IRUSR,
716− einj_debug_dir, NULL,
717− &available_error_type_fops);
718− if (!fentry)
719− goto err_cleanup;
720−
721− fentry = debugfs_create_file("error_type", S_IRUSR | S_IWUSR,
722− einj_debug_dir, NULL, &error_type_fops);
723− if (!fentry)
724− goto err_cleanup;
725− fentry = debugfs_create_file("error_inject", S_IWUSR,
726− einj_debug_dir, NULL, &error_inject_fops);
727− if (!fentry)
728− goto err_cleanup;
709+ debugfs_create_file("available_error_type", S_IRUSR, einj_debug_dir,
710+ NULL, &available_error_type_fops);
711+ debugfs_create_file_unsafe("error_type", 0600, einj_debug_dir,
712+ NULL, &error_type_fops);
713+ debugfs_create_file_unsafe("error_inject", 0200, einj_debug_dir,
714+ NULL, &error_inject_fops);
729715
730716 apei_resources_init(&einj_resources);
731717 einj_exec_ctx_init(&ctx);
@@ -750,66 +736,37 @@ static int __init einj_init(void) · 18 unmodified lines
750736 rc = -ENOMEM;
751737 einj_param = einj_get_parameter_address();
752738 if ((param_extension || acpi5) && einj_param) {
753− fentry = debugfs_create_x32("flags", S_IRUSR | S_IWUSR,
754− einj_debug_dir, &error_flags);
755− if (!fentry)
756− goto err_unmap;
757− fentry = debugfs_create_x64("param1", S_IRUSR | S_IWUSR,
758− einj_debug_dir, &error_param1);
759− if (!fentry)
760− goto err_unmap;
761− fentry = debugfs_create_x64("param2", S_IRUSR | S_IWUSR,
762− einj_debug_dir, &error_param2);
763− if (!fentry)
764− goto err_unmap;
765− fentry = debugfs_create_x64("param3", S_IRUSR | S_IWUSR,
766− einj_debug_dir, &error_param3);
767− if (!fentry)
768− goto err_unmap;
769− fentry = debugfs_create_x64("param4", S_IRUSR | S_IWUSR,
770− einj_debug_dir, &error_param4);
771− if (!fentry)
772− goto err_unmap;
773−
774− fentry = debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
775− einj_debug_dir, &notrigger);
776− if (!fentry)
777− goto err_unmap;
739+ debugfs_create_x32("flags", S_IRUSR | S_IWUSR, einj_debug_dir,
740+ &error_flags);
741+ debugfs_create_x64("param1", S_IRUSR | S_IWUSR, einj_debug_dir,
742+ &error_param1);
743+ debugfs_create_x64("param2", S_IRUSR | S_IWUSR, einj_debug_dir,
744+ &error_param2);
745+ debugfs_create_x64("param3", S_IRUSR | S_IWUSR, einj_debug_dir,
746+ &error_param3);
747+ debugfs_create_x64("param4", S_IRUSR | S_IWUSR, einj_debug_dir,
748+ &error_param4);
749+ debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
750+ einj_debug_dir, &notrigger);
778751 }
779752
780753 if (vendor_dev[0]) {
781754 vendor_blob.data = vendor_dev;
782755 vendor_blob.size = strlen(vendor_dev);
783− fentry = debugfs_create_blob("vendor", S_IRUSR,
784− einj_debug_dir, &vendor_blob);
785− if (!fentry)
786− goto err_unmap;
787− fentry = debugfs_create_x32("vendor_flags", S_IRUSR | S_IWUSR,
788− einj_debug_dir, &vendor_flags);
789− if (!fentry)
790− goto err_unmap;
756+ debugfs_create_blob("vendor", S_IRUSR, einj_debug_dir,
757+ &vendor_blob);
758+ debugfs_create_x32("vendor_flags", S_IRUSR | S_IWUSR,
759+ einj_debug_dir, &vendor_flags);
791760 }
792761
793762 pr_info("Error INJection is initialized.\n");
794763
795764 return 0;
796765
797−err_unmap:
798− if (einj_param) {
799− acpi_size size = (acpi5) ?
800− sizeof(struct set_error_type_with_address) :
801− sizeof(struct einj_parameter);
802−
803− acpi_os_unmap_iomem(einj_param, size);
804− pr_err("Error creating param extension debugfs nodes.\n");
805− }
806− apei_exec_post_unmap_gars(&ctx);
807766 err_release:
808767 apei_resources_release(&einj_resources);
809768 err_fini:
810769 apei_resources_fini(&einj_resources);
811−err_cleanup:
812− pr_err("Error creating primary debugfs nodes.\n");
813770 debugfs_remove_recursive(einj_debug_dir);
814771
815772 return rc;
drivers/acpi/apei/erst.c+12−15
@@ -938,17 +938,17 @@ static struct pstore_info erst_info = { · 937 unmodified lines
938938 };
939939
940940 #define CPER_CREATOR_PSTORE \
941− UUID_LE(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c, \
942− 0x64, 0x90, 0xb8, 0x9d)
941+ GUID_INIT(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c, \
942+ 0x64, 0x90, 0xb8, 0x9d)
943943 #define CPER_SECTION_TYPE_DMESG \
944− UUID_LE(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54, \
945− 0x94, 0x19, 0xeb, 0x12)
944+ GUID_INIT(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54, \
945+ 0x94, 0x19, 0xeb, 0x12)
946946 #define CPER_SECTION_TYPE_DMESG_Z \
947− UUID_LE(0x4f118707, 0x04dd, 0x4055, 0xb5, 0xdd, 0x95, 0x6d, \
948− 0x34, 0xdd, 0xfa, 0xc6)
947+ GUID_INIT(0x4f118707, 0x04dd, 0x4055, 0xb5, 0xdd, 0x95, 0x6d, \
948+ 0x34, 0xdd, 0xfa, 0xc6)
949949 #define CPER_SECTION_TYPE_MCE \
950− UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \
951− 0x04, 0x4a, 0x38, 0xfc)
950+ GUID_INIT(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \
951+ 0x04, 0x4a, 0x38, 0xfc)
952952
953953 struct cper_pstore_record {
954954 struct cper_record_header hdr;
@@ -1012,7 +1012,7 @@ skip: · 57 unmodified lines
10121012 rc = -EIO;
10131013 goto out;
10141014 }
1015− if (uuid_le_cmp(rcd->hdr.creator_id, CPER_CREATOR_PSTORE) != 0)
1015+ if (!guid_equal(&rcd->hdr.creator_id, &CPER_CREATOR_PSTORE))
10161016 goto skip;
10171017
10181018 record->buf = kmalloc(len, GFP_KERNEL);
@@ -1024,15 +1024,12 @@ skip: · 5 unmodified lines
10241024 record->id = record_id;
10251025 record->compressed = false;
10261026 record->ecc_notice_size = 0;
1027− if (uuid_le_cmp(rcd->sec_hdr.section_type,
1028− CPER_SECTION_TYPE_DMESG_Z) == 0) {
1027+ if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG_Z)) {
10291028 record->type = PSTORE_TYPE_DMESG;
10301029 record->compressed = true;
1031− } else if (uuid_le_cmp(rcd->sec_hdr.section_type,
1032− CPER_SECTION_TYPE_DMESG) == 0)
1030+ } else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG))
10331031 record->type = PSTORE_TYPE_DMESG;
1034− else if (uuid_le_cmp(rcd->sec_hdr.section_type,
1035− CPER_SECTION_TYPE_MCE) == 0)
1032+ else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_MCE))
10361033 record->type = PSTORE_TYPE_MCE;
10371034 else
10381035 record->type = PSTORE_TYPE_MAX;
drivers/acpi/apei/ghes.c+371−284
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 * GNU General Public License for more details.
2626 */
2727
28+#include <linux/arm_sdei.h>
2829 #include <linux/kernel.h>
2930 #include <linux/moduleparam.h>
3031 #include <linux/init.h>
@@ -33,7 +34,6 @@ · 2 unmodified lines
3334 #include <linux/interrupt.h>
3435 #include <linux/timer.h>
3536 #include <linux/cper.h>
36−#include <linux/kdebug.h>
3737 #include <linux/platform_device.h>
3838 #include <linux/mutex.h>
3939 #include <linux/ratelimit.h>
@@ -42,6 +42,7 @@ · 2 unmodified lines
4242 #include <linux/llist.h>
4343 #include <linux/genalloc.h>
4444 #include <linux/pci.h>
45+#include <linux/pfn.h>
4546 #include <linux/aer.h>
4647 #include <linux/nmi.h>
4748 #include <linux/sched/clock.h>
@@ -85,6 +86,15 @@ · 37 unmodified lines
8586 ((struct acpi_hest_generic_status *) \
8687 ((struct ghes_estatus_node *)(estatus_node) + 1))
8788
89+/*
90+ * NMI-like notifications vary by architecture, before the compiler can prune
91+ * unused static functions it needs a value for these enums.
92+ */
93+#ifndef CONFIG_ARM_SDE_INTERFACE
94+#define FIX_APEI_GHES_SDEI_NORMAL __end_of_fixed_addresses
95+#define FIX_APEI_GHES_SDEI_CRITICAL __end_of_fixed_addresses
96+#endif
97+
8898 static inline bool is_hest_type_generic_v2(struct ghes *ghes)
8999 {
90100 return ghes->generic->header.type == ACPI_HEST_TYPE_GENERIC_ERROR_V2;
@@ -115,11 +125,10 @@ static DEFINE_MUTEX(ghes_list_mutex); · 24 unmodified lines
115125 * handler, but general ioremap can not be used in atomic context, so
116126 * the fixmap is used instead.
117127 *
118− * These 2 spinlocks are used to prevent the fixmap entries from being used
128+ * This spinlock is used to prevent the fixmap entry from being used
119129 * simultaneously.
120130 */
121−static DEFINE_RAW_SPINLOCK(ghes_ioremap_lock_nmi);
122−static DEFINE_SPINLOCK(ghes_ioremap_lock_irq);
131+static DEFINE_SPINLOCK(ghes_notify_lock_irq);
123132
124133 static struct gen_pool *ghes_estatus_pool;
125134 static unsigned long ghes_estatus_pool_size_request;
@@ -129,82 +138,49 @@ static atomic_t ghes_estatus_cache_alloced; · 3 unmodified lines
129138
130139 static int ghes_panic_timeout __read_mostly = 30;
131140
132−static void __iomem *ghes_ioremap_pfn_nmi(u64 pfn)
141+static void __iomem *ghes_map(u64 pfn, enum fixed_addresses fixmap_idx)
133142 {
134143 phys_addr_t paddr;
135144 pgprot_t prot;
136145
137− paddr = pfn << PAGE_SHIFT;
146+ paddr = PFN_PHYS(pfn);
138147 prot = arch_apei_get_mem_attribute(paddr);
139− __set_fixmap(FIX_APEI_GHES_NMI, paddr, prot);
148+ __set_fixmap(fixmap_idx, paddr, prot);
140149
141− return (void __iomem *) fix_to_virt(FIX_APEI_GHES_NMI);
150+ return (void __iomem *) __fix_to_virt(fixmap_idx);
142151 }
143152
144−static void __iomem *ghes_ioremap_pfn_irq(u64 pfn)
153+static void ghes_unmap(void __iomem *vaddr, enum fixed_addresses fixmap_idx)
145154 {
146− phys_addr_t paddr;
147− pgprot_t prot;
148−
149− paddr = pfn << PAGE_SHIFT;
150− prot = arch_apei_get_mem_attribute(paddr);
151− __set_fixmap(FIX_APEI_GHES_IRQ, paddr, prot);
152−
153− return (void __iomem *) fix_to_virt(FIX_APEI_GHES_IRQ);
154−}
155+ int _idx = virt_to_fix((unsigned long)vaddr);
155156
156−static void ghes_iounmap_nmi(void)
157−{
158− clear_fixmap(FIX_APEI_GHES_NMI);
157+ WARN_ON_ONCE(fixmap_idx != _idx);
158+ clear_fixmap(fixmap_idx);
159159 }
160160
161−static void ghes_iounmap_irq(void)
161+int ghes_estatus_pool_init(int num_ghes)
162162 {
163− clear_fixmap(FIX_APEI_GHES_IRQ);
164−}
163+ unsigned long addr, len;
165164
166−static int ghes_estatus_pool_init(void)
167−{
168165 ghes_estatus_pool = gen_pool_create(GHES_ESTATUS_POOL_MIN_ALLOC_ORDER, -1);
169166 if (!ghes_estatus_pool)
170167 return -ENOMEM;
171− return 0;
172−}
173168
174−static void ghes_estatus_pool_free_chunk_page(struct gen_pool *pool,
175− struct gen_pool_chunk *chunk,
176− void *data)
177−{
178− free_page(chunk->start_addr);
179−}
180−
181−static void ghes_estatus_pool_exit(void)
182−{
183− gen_pool_for_each_chunk(ghes_estatus_pool,
184− ghes_estatus_pool_free_chunk_page, NULL);
185− gen_pool_destroy(ghes_estatus_pool);
186−}
169+ len = GHES_ESTATUS_CACHE_AVG_SIZE * GHES_ESTATUS_CACHE_ALLOCED_MAX;
170+ len += (num_ghes * GHES_ESOURCE_PREALLOC_MAX_SIZE);
187171
188−static int ghes_estatus_pool_expand(unsigned long len)
189−{
190− unsigned long i, pages, size, addr;
191− int ret;
172+ ghes_estatus_pool_size_request = PAGE_ALIGN(len);
173+ addr = (unsigned long)vmalloc(PAGE_ALIGN(len));
174+ if (!addr)
175+ return -ENOMEM;
192176
193− ghes_estatus_pool_size_request += PAGE_ALIGN(len);
194− size = gen_pool_size(ghes_estatus_pool);
195− if (size >= ghes_estatus_pool_size_request)
196− return 0;
197− pages = (ghes_estatus_pool_size_request - size) / PAGE_SIZE;
198− for (i = 0; i < pages; i++) {
199− addr = __get_free_page(GFP_KERNEL);
200− if (!addr)
201− return -ENOMEM;
202− ret = gen_pool_add(ghes_estatus_pool, addr, PAGE_SIZE, -1);
203− if (ret)
204− return ret;
205− }
177+ /*
178+ * New allocation must be visible in all pgd before it can be found by
179+ * an NMI allocating from the pool.
180+ */
181+ vmalloc_sync_all();
206182
207− return 0;
183+ return gen_pool_add(ghes_estatus_pool, addr, PAGE_ALIGN(len), -1);
208184 }
209185
210186 static int map_gen_v2(struct ghes *ghes)
@@ -217,6 +193,21 @@ static void unmap_gen_v2(struct ghes *ghes) · 6 unmodified lines
217193 apei_unmap_generic_address(&ghes->generic_v2->read_ack_register);
218194 }
219195
196+static void ghes_ack_error(struct acpi_hest_generic_v2 *gv2)
197+{
198+ int rc;
199+ u64 val = 0;
200+
201+ rc = apei_read(&val, &gv2->read_ack_register);
202+ if (rc)
203+ return;
204+
205+ val &= gv2->read_ack_preserve << gv2->read_ack_register.bit_offset;
206+ val |= gv2->read_ack_write << gv2->read_ack_register.bit_offset;
207+
208+ apei_write(val, &gv2->read_ack_register);
209+}
210+
220211 static struct ghes *ghes_new(struct acpi_hest_generic *generic)
221212 {
222213 struct ghes *ghes;
@@ -289,23 +280,16 @@ static inline int ghes_severity(int severity) · 66 unmodified lines
289280 }
290281
291282 static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len,
292− int from_phys)
283+ int from_phys,
284+ enum fixed_addresses fixmap_idx)
293285 {
294286 void __iomem *vaddr;
295− unsigned long flags = 0;
296− int in_nmi = in_nmi();
297287 u64 offset;
298288 u32 trunk;
299289
300290 while (len > 0) {
301291 offset = paddr - (paddr & PAGE_MASK);
302− if (in_nmi) {
303− raw_spin_lock(&ghes_ioremap_lock_nmi);
304− vaddr = ghes_ioremap_pfn_nmi(paddr >> PAGE_SHIFT);
305− } else {
306− spin_lock_irqsave(&ghes_ioremap_lock_irq, flags);
307− vaddr = ghes_ioremap_pfn_irq(paddr >> PAGE_SHIFT);
308− }
292+ vaddr = ghes_map(PHYS_PFN(paddr), fixmap_idx);
309293 trunk = PAGE_SIZE - offset;
310294 trunk = min(trunk, len);
311295 if (from_phys)
@@ -315,72 +299,114 @@ static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len, · 3 unmodified lines
315299 len -= trunk;
316300 paddr += trunk;
317301 buffer += trunk;
318− if (in_nmi) {
319− ghes_iounmap_nmi();
320− raw_spin_unlock(&ghes_ioremap_lock_nmi);
321− } else {
322− ghes_iounmap_irq();
323− spin_unlock_irqrestore(&ghes_ioremap_lock_irq, flags);
324− }
302+ ghes_unmap(vaddr, fixmap_idx);
303+ }
304+}
305+
306+/* Check the top-level record header has an appropriate size. */
307+static int __ghes_check_estatus(struct ghes *ghes,
308+ struct acpi_hest_generic_status *estatus)
309+{
310+ u32 len = cper_estatus_len(estatus);
311+
312+ if (len < sizeof(*estatus)) {
313+ pr_warn_ratelimited(FW_WARN GHES_PFX "Truncated error status block!\n");
314+ return -EIO;
315+ }
316+
317+ if (len > ghes->generic->error_block_length) {
318+ pr_warn_ratelimited(FW_WARN GHES_PFX "Invalid error status block length!\n");
319+ return -EIO;
320+ }
321+
322+ if (cper_estatus_check_header(estatus)) {
323+ pr_warn_ratelimited(FW_WARN GHES_PFX "Invalid CPER header!\n");
324+ return -EIO;
325325 }
326+
327+ return 0;
326328 }
327329
328−static int ghes_read_estatus(struct ghes *ghes, int silent)
330+/* Read the CPER block, returning its address, and header in estatus. */
331+static int __ghes_peek_estatus(struct ghes *ghes,
332+ struct acpi_hest_generic_status *estatus,
333+ u64 *buf_paddr, enum fixed_addresses fixmap_idx)
329334 {
330335 struct acpi_hest_generic *g = ghes->generic;
331− u64 buf_paddr;
332− u32 len;
333336 int rc;
334337
335− rc = apei_read(&buf_paddr, &g->error_status_address);
338+ rc = apei_read(buf_paddr, &g->error_status_address);
336339 if (rc) {
337− if (!silent && printk_ratelimit())
338− pr_warning(FW_WARN GHES_PFX
340+ *buf_paddr = 0;
341+ pr_warn_ratelimited(FW_WARN GHES_PFX
339342 "Failed to read error status block address for hardware error source: %d.\n",
340343 g->header.source_id);
341344 return -EIO;
342345 }
343− if (!buf_paddr)
346+ if (!*buf_paddr)
344347 return -ENOENT;
345348
346− ghes_copy_tofrom_phys(ghes->estatus, buf_paddr,
347− sizeof(*ghes->estatus), 1);
348− if (!ghes->estatus->block_status)
349+ ghes_copy_tofrom_phys(estatus, *buf_paddr, sizeof(*estatus), 1,
350+ fixmap_idx);
351+ if (!estatus->block_status) {
352+ *buf_paddr = 0;
349353 return -ENOENT;
354+ }
350355
351− ghes->buffer_paddr = buf_paddr;
352− ghes->flags |= GHES_TO_CLEAR;
356+ return __ghes_check_estatus(ghes, estatus);
357+}
353358
354− rc = -EIO;
355− len = cper_estatus_len(ghes->estatus);
356− if (len < sizeof(*ghes->estatus))
357− goto err_read_block;
358− if (len > ghes->generic->error_block_length)
359− goto err_read_block;
360− if (cper_estatus_check_header(ghes->estatus))
361− goto err_read_block;
362− ghes_copy_tofrom_phys(ghes->estatus + 1,
363− buf_paddr + sizeof(*ghes->estatus),
364− len - sizeof(*ghes->estatus), 1);
365− if (cper_estatus_check(ghes->estatus))
366− goto err_read_block;
367− rc = 0;
368−
369−err_read_block:
370− if (rc && !silent && printk_ratelimit())
371− pr_warning(FW_WARN GHES_PFX
372− "Failed to read error status block!\n");
373− return rc;
359+static int __ghes_read_estatus(struct acpi_hest_generic_status *estatus,
360+ u64 buf_paddr, enum fixed_addresses fixmap_idx,
361+ size_t buf_len)
362+{
363+ ghes_copy_tofrom_phys(estatus, buf_paddr, buf_len, 1, fixmap_idx);
364+ if (cper_estatus_check(estatus)) {
365+ pr_warn_ratelimited(FW_WARN GHES_PFX
366+ "Failed to read error status block!\n");
367+ return -EIO;
368+ }
369+
370+ return 0;
374371 }
375372
376−static void ghes_clear_estatus(struct ghes *ghes)
373+static int ghes_read_estatus(struct ghes *ghes,
374+ struct acpi_hest_generic_status *estatus,
375+ u64 *buf_paddr, enum fixed_addresses fixmap_idx)
377376 {
378− ghes->estatus->block_status = 0;
379− if (!(ghes->flags & GHES_TO_CLEAR))
377+ int rc;
378+
379+ rc = __ghes_peek_estatus(ghes, estatus, buf_paddr, fixmap_idx);
380+ if (rc)
381+ return rc;
382+
383+ rc = __ghes_check_estatus(ghes, estatus);
384+ if (rc)
385+ return rc;
386+
387+ return __ghes_read_estatus(estatus, *buf_paddr, fixmap_idx,
388+ cper_estatus_len(estatus));
389+}
390+
391+static void ghes_clear_estatus(struct ghes *ghes,
392+ struct acpi_hest_generic_status *estatus,
393+ u64 buf_paddr, enum fixed_addresses fixmap_idx)
394+{
395+ estatus->block_status = 0;
396+
397+ if (!buf_paddr)
380398 return;
381− ghes_copy_tofrom_phys(ghes->estatus, ghes->buffer_paddr,
382− sizeof(ghes->estatus->block_status), 0);
383− ghes->flags &= ~GHES_TO_CLEAR;
399+
400+ ghes_copy_tofrom_phys(estatus, buf_paddr,
401+ sizeof(estatus->block_status), 0,
402+ fixmap_idx);
403+
404+ /*
405+ * GHESv2 type HEST entries introduce support for error acknowledgment,
406+ * so only acknowledge the error if this support is present.
407+ */
408+ if (is_hest_type_generic_v2(ghes))
409+ ghes_ack_error(ghes->generic_v2);
384410 }
385411
386412 static void ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, int sev)
@@ -672,26 +698,13 @@ static void ghes_estatus_cache_add( · 285 unmodified lines
672698 rcu_read_unlock();
673699 }
674700
675−static int ghes_ack_error(struct acpi_hest_generic_v2 *gv2)
701+static void __ghes_panic(struct ghes *ghes,
702+ struct acpi_hest_generic_status *estatus,
703+ u64 buf_paddr, enum fixed_addresses fixmap_idx)
676704 {
677− int rc;
678− u64 val = 0;
705+ __ghes_print_estatus(KERN_EMERG, ghes->generic, estatus);
679706
680− rc = apei_read(&val, &gv2->read_ack_register);
681− if (rc)
682− return rc;
683−
684− val &= gv2->read_ack_preserve << gv2->read_ack_register.bit_offset;
685− val |= gv2->read_ack_write << gv2->read_ack_register.bit_offset;
686−
687− return apei_write(val, &gv2->read_ack_register);
688−}
689−
690−static void __ghes_panic(struct ghes *ghes)
691−{
692− __ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus);
693−
694− ghes_clear_estatus(ghes);
707+ ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx);
695708
696709 /* reboot to log the error! */
697710 if (!panic_timeout)
@@ -701,34 +714,25 @@ static void __ghes_panic(struct ghes *ghes) · 3 unmodified lines
701714
702715 static int ghes_proc(struct ghes *ghes)
703716 {
717+ struct acpi_hest_generic_status *estatus = ghes->estatus;
718+ u64 buf_paddr;
704719 int rc;
705720
706− rc = ghes_read_estatus(ghes, 0);
721+ rc = ghes_read_estatus(ghes, estatus, &buf_paddr, FIX_APEI_GHES_IRQ);
707722 if (rc)
708723 goto out;
709724
710− if (ghes_severity(ghes->estatus->error_severity) >= GHES_SEV_PANIC) {
711− __ghes_panic(ghes);
712− }
725+ if (ghes_severity(estatus->error_severity) >= GHES_SEV_PANIC)
726+ __ghes_panic(ghes, estatus, buf_paddr, FIX_APEI_GHES_IRQ);
713727
714− if (!ghes_estatus_cached(ghes->estatus)) {
715− if (ghes_print_estatus(NULL, ghes->generic, ghes->estatus))
716− ghes_estatus_cache_add(ghes->generic, ghes->estatus);
728+ if (!ghes_estatus_cached(estatus)) {
729+ if (ghes_print_estatus(NULL, ghes->generic, estatus))
730+ ghes_estatus_cache_add(ghes->generic, estatus);
717731 }
718− ghes_do_proc(ghes, ghes->estatus);
732+ ghes_do_proc(ghes, estatus);
719733
720734 out:
721− ghes_clear_estatus(ghes);
722−
723− if (rc == -ENOENT)
724− return rc;
725−
726− /*
727− * GHESv2 type HEST entries introduce support for error acknowledgment,
728− * so only acknowledge the error if this support is present.
729− */
730− if (is_hest_type_generic_v2(ghes))
731− return ghes_ack_error(ghes->generic_v2);
735+ ghes_clear_estatus(ghes, estatus, buf_paddr, FIX_APEI_GHES_IRQ);
732736
733737 return rc;
734738 }
@@ -751,8 +755,11 @@ static void ghes_add_timer(struct ghes *ghes) · 16 unmodified lines
751755 static void ghes_poll_func(struct timer_list *t)
752756 {
753757 struct ghes *ghes = from_timer(ghes, t, timer);
758+ unsigned long flags;
754759
760+ spin_lock_irqsave(&ghes_notify_lock_irq, flags);
755761 ghes_proc(ghes);
762+ spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
756763 if (!(ghes->flags & GHES_EXITING))
757764 ghes_add_timer(ghes);
758765 }
@@ -760,9 +767,12 @@ static void ghes_poll_func(struct timer_list *t) · 1 unmodified line
760767 static irqreturn_t ghes_irq_func(int irq, void *data)
761768 {
762769 struct ghes *ghes = data;
770+ unsigned long flags;
763771 int rc;
764772
773+ spin_lock_irqsave(&ghes_notify_lock_irq, flags);
765774 rc = ghes_proc(ghes);
775+ spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
766776 if (rc)
767777 return IRQ_NONE;
768778
@@ -773,14 +783,17 @@ static int ghes_notify_hed(struct notifier_block *this, unsigned long event, · 4 unmodified lines
773783 void *data)
774784 {
775785 struct ghes *ghes;
786+ unsigned long flags;
776787 int ret = NOTIFY_DONE;
777788
789+ spin_lock_irqsave(&ghes_notify_lock_irq, flags);
778790 rcu_read_lock();
779791 list_for_each_entry_rcu(ghes, &ghes_hed, list) {
780792 if (!ghes_proc(ghes))
781793 ret = NOTIFY_OK;
782794 }
783795 rcu_read_unlock();
796+ spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
784797
785798 return ret;
786799 }
@@ -789,66 +802,20 @@ static struct notifier_block ghes_notifier_hed = { · 2 unmodified lines
789802 .notifier_call = ghes_notify_hed,
790803 };
791804
792−#ifdef CONFIG_ACPI_APEI_SEA
793−static LIST_HEAD(ghes_sea);
794−
795−/*
796− * Return 0 only if one of the SEA error sources successfully reported an error
797− * record sent from the firmware.
798− */
799−int ghes_notify_sea(void)
800−{
801− struct ghes *ghes;
802− int ret = -ENOENT;
803−
804− rcu_read_lock();
805− list_for_each_entry_rcu(ghes, &ghes_sea, list) {
806− if (!ghes_proc(ghes))
807− ret = 0;
808− }
809− rcu_read_unlock();
810− return ret;
811−}
812−
813−static void ghes_sea_add(struct ghes *ghes)
814−{
815− mutex_lock(&ghes_list_mutex);
816− list_add_rcu(&ghes->list, &ghes_sea);
817− mutex_unlock(&ghes_list_mutex);
818−}
819−
820−static void ghes_sea_remove(struct ghes *ghes)
821−{
822− mutex_lock(&ghes_list_mutex);
823− list_del_rcu(&ghes->list);
824− mutex_unlock(&ghes_list_mutex);
825− synchronize_rcu();
826−}
827−#else /* CONFIG_ACPI_APEI_SEA */
828−static inline void ghes_sea_add(struct ghes *ghes) { }
829−static inline void ghes_sea_remove(struct ghes *ghes) { }
830−#endif /* CONFIG_ACPI_APEI_SEA */
831−
832−#ifdef CONFIG_HAVE_ACPI_APEI_NMI
833805 /*
834− * printk is not safe in NMI context. So in NMI handler, we allocate
835− * required memory from lock-less memory allocator
836− * (ghes_estatus_pool), save estatus into it, put them into lock-less
837− * list (ghes_estatus_llist), then delay printk into IRQ context via
838− * irq_work (ghes_proc_irq_work). ghes_estatus_size_request record
839− * required pool size by all NMI error source.
806+ * Handlers for CPER records may not be NMI safe. For example,
807+ * memory_failure_queue() takes spinlocks and calls schedule_work_on().
808+ * In any NMI-like handler, memory from ghes_estatus_pool is used to save
809+ * estatus, and added to the ghes_estatus_llist. irq_work_queue() causes
810+ * ghes_proc_in_irq() to run in IRQ context where each estatus in
811+ * ghes_estatus_llist is processed.
812+ *
813+ * Memory from the ghes_estatus_pool is also used with the ghes_estatus_cache
814+ * to suppress frequent messages.
840815 */
841816 static struct llist_head ghes_estatus_llist;
842817 static struct irq_work ghes_proc_irq_work;
843818
844−/*
845− * NMI may be triggered on any CPU, so ghes_in_nmi is used for
846− * having only one concurrent reader.
847− */
848−static atomic_t ghes_in_nmi = ATOMIC_INIT(0);
849−
850−static LIST_HEAD(ghes_nmi);
851−
852819 static void ghes_proc_in_irq(struct irq_work *irq_work)
853820 {
854821 struct llist_node *llnode, *next;
@@ -905,96 +872,154 @@ static void ghes_print_queued_estatus(void) · 50 unmodified lines
905872 }
906873 }
907874
908−/* Save estatus for further processing in IRQ context */
909−static void __process_error(struct ghes *ghes)
875+static int ghes_in_nmi_queue_one_entry(struct ghes *ghes,
876+ enum fixed_addresses fixmap_idx)
910877 {
911−#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
912− u32 len, node_len;
878+ struct acpi_hest_generic_status *estatus, tmp_header;
913879 struct ghes_estatus_node *estatus_node;
914− struct acpi_hest_generic_status *estatus;
880+ u32 len, node_len;
881+ u64 buf_paddr;
882+ int sev, rc;
915883
916− if (ghes_estatus_cached(ghes->estatus))
917− return;
884+ if (!IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG))
885+ return -EOPNOTSUPP;
918886
919− len = cper_estatus_len(ghes->estatus);
920− node_len = GHES_ESTATUS_NODE_LEN(len);
887+ rc = __ghes_peek_estatus(ghes, &tmp_header, &buf_paddr, fixmap_idx);
888+ if (rc) {
889+ ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx);
890+ return rc;
891+ }
921892
893+ rc = __ghes_check_estatus(ghes, &tmp_header);
894+ if (rc) {
895+ ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx);
896+ return rc;
897+ }
898+
899+ len = cper_estatus_len(&tmp_header);
900+ node_len = GHES_ESTATUS_NODE_LEN(len);
922901 estatus_node = (void *)gen_pool_alloc(ghes_estatus_pool, node_len);
923902 if (!estatus_node)
924− return;
903+ return -ENOMEM;
925904
926905 estatus_node->ghes = ghes;
927906 estatus_node->generic = ghes->generic;
928907 estatus = GHES_ESTATUS_FROM_NODE(estatus_node);
929− memcpy(estatus, ghes->estatus, len);
930− llist_add(&estatus_node->llnode, &ghes_estatus_llist);
931−#endif
932−}
933908
934−static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
935−{
936− struct ghes *ghes;
937− int sev, ret = NMI_DONE;
909+ if (__ghes_read_estatus(estatus, buf_paddr, fixmap_idx, len)) {
910+ ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx);
911+ rc = -ENOENT;
912+ goto no_work;
913+ }
938914
939− if (!atomic_add_unless(&ghes_in_nmi, 1, 1))
940− return ret;
915+ sev = ghes_severity(estatus->error_severity);
916+ if (sev >= GHES_SEV_PANIC) {
917+ ghes_print_queued_estatus();
918+ __ghes_panic(ghes, estatus, buf_paddr, fixmap_idx);
919+ }
941920
942− list_for_each_entry_rcu(ghes, &ghes_nmi, list) {
943− if (ghes_read_estatus(ghes, 1)) {
944− ghes_clear_estatus(ghes);
945− continue;
946− } else {
947− ret = NMI_HANDLED;
948− }
921+ ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx);
949922
950− sev = ghes_severity(ghes->estatus->error_severity);
951− if (sev >= GHES_SEV_PANIC) {
952− oops_begin();
953− ghes_print_queued_estatus();
954− __ghes_panic(ghes);
955− }
923+ /* This error has been reported before, don't process it again. */
924+ if (ghes_estatus_cached(estatus))
925+ goto no_work;
956926
957− if (!(ghes->flags & GHES_TO_CLEAR))
958− continue;
927+ llist_add(&estatus_node->llnode, &ghes_estatus_llist);
928+
929+ return rc;
930+
931+no_work:
932+ gen_pool_free(ghes_estatus_pool, (unsigned long)estatus_node,
933+ node_len);
934+
935+ return rc;
936+}
959937
960− __process_error(ghes);
961− ghes_clear_estatus(ghes);
938+static int ghes_in_nmi_spool_from_list(struct list_head *rcu_list,
939+ enum fixed_addresses fixmap_idx)
940+{
941+ int ret = -ENOENT;
942+ struct ghes *ghes;
943+
944+ rcu_read_lock();
945+ list_for_each_entry_rcu(ghes, rcu_list, list) {
946+ if (!ghes_in_nmi_queue_one_entry(ghes, fixmap_idx))
947+ ret = 0;
962948 }
949+ rcu_read_unlock();
963950
964−#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG
965− if (ret == NMI_HANDLED)
951+ if (IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG) && !ret)
966952 irq_work_queue(&ghes_proc_irq_work);
967−#endif
968− atomic_dec(&ghes_in_nmi);
953+
969954 return ret;
970955 }
971956
972−static unsigned long ghes_esource_prealloc_size(
973− const struct acpi_hest_generic *generic)
957+#ifdef CONFIG_ACPI_APEI_SEA
958+static LIST_HEAD(ghes_sea);
959+
960+/*
961+ * Return 0 only if one of the SEA error sources successfully reported an error
962+ * record sent from the firmware.
963+ */
964+int ghes_notify_sea(void)
974965 {
975− unsigned long block_length, prealloc_records, prealloc_size;
966+ static DEFINE_RAW_SPINLOCK(ghes_notify_lock_sea);
967+ int rv;
976968
977− block_length = min_t(unsigned long, generic->error_block_length,
978− GHES_ESTATUS_MAX_SIZE);
979− prealloc_records = max_t(unsigned long,
980− generic->records_to_preallocate, 1);
981− prealloc_size = min_t(unsigned long, block_length * prealloc_records,
982− GHES_ESOURCE_PREALLOC_MAX_SIZE);
969+ raw_spin_lock(&ghes_notify_lock_sea);
970+ rv = ghes_in_nmi_spool_from_list(&ghes_sea, FIX_APEI_GHES_SEA);
971+ raw_spin_unlock(&ghes_notify_lock_sea);
983972
984− return prealloc_size;
973+ return rv;
985974 }
986975
987−static void ghes_estatus_pool_shrink(unsigned long len)
976+static void ghes_sea_add(struct ghes *ghes)
988977 {
989− ghes_estatus_pool_size_request -= PAGE_ALIGN(len);
978+ mutex_lock(&ghes_list_mutex);
979+ list_add_rcu(&ghes->list, &ghes_sea);
980+ mutex_unlock(&ghes_list_mutex);
990981 }
991982
992−static void ghes_nmi_add(struct ghes *ghes)
983+static void ghes_sea_remove(struct ghes *ghes)
993984 {
994− unsigned long len;
985+ mutex_lock(&ghes_list_mutex);
986+ list_del_rcu(&ghes->list);
987+ mutex_unlock(&ghes_list_mutex);
988+ synchronize_rcu();
989+}
990+#else /* CONFIG_ACPI_APEI_SEA */
991+static inline void ghes_sea_add(struct ghes *ghes) { }
992+static inline void ghes_sea_remove(struct ghes *ghes) { }
993+#endif /* CONFIG_ACPI_APEI_SEA */
994+
995+#ifdef CONFIG_HAVE_ACPI_APEI_NMI
996+/*
997+ * NMI may be triggered on any CPU, so ghes_in_nmi is used for
998+ * having only one concurrent reader.
999+ */
1000+static atomic_t ghes_in_nmi = ATOMIC_INIT(0);
1001+
1002+static LIST_HEAD(ghes_nmi);
1003+
1004+static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
1005+{
1006+ static DEFINE_RAW_SPINLOCK(ghes_notify_lock_nmi);
1007+ int ret = NMI_DONE;
1008+
1009+ if (!atomic_add_unless(&ghes_in_nmi, 1, 1))
1010+ return ret;
1011+
1012+ raw_spin_lock(&ghes_notify_lock_nmi);
1013+ if (!ghes_in_nmi_spool_from_list(&ghes_nmi, FIX_APEI_GHES_NMI))
1014+ ret = NMI_HANDLED;
1015+ raw_spin_unlock(&ghes_notify_lock_nmi);
9951016
996− len = ghes_esource_prealloc_size(ghes->generic);
997− ghes_estatus_pool_expand(len);
1017+ atomic_dec(&ghes_in_nmi);
1018+ return ret;
1019+}
1020+
1021+static void ghes_nmi_add(struct ghes *ghes)
1022+{
9981023 mutex_lock(&ghes_list_mutex);
9991024 if (list_empty(&ghes_nmi))
10001025 register_nmi_handler(NMI_LOCAL, ghes_notify_nmi, 0, "ghes");
@@ -1004,8 +1029,6 @@ static void ghes_nmi_add(struct ghes *ghes) · 3 unmodified lines
10041029
10051030 static void ghes_nmi_remove(struct ghes *ghes)
10061031 {
1007− unsigned long len;
1008−
10091032 mutex_lock(&ghes_list_mutex);
10101033 list_del_rcu(&ghes->list);
10111034 if (list_empty(&ghes_nmi))
@@ -1016,24 +1039,79 @@ static void ghes_nmi_remove(struct ghes *ghes) · 4 unmodified lines
10161039 * freed after NMI handler finishes.
10171040 */
10181041 synchronize_rcu();
1019− len = ghes_esource_prealloc_size(ghes->generic);
1020− ghes_estatus_pool_shrink(len);
10211042 }
1043+#else /* CONFIG_HAVE_ACPI_APEI_NMI */
1044+static inline void ghes_nmi_add(struct ghes *ghes) { }
1045+static inline void ghes_nmi_remove(struct ghes *ghes) { }
1046+#endif /* CONFIG_HAVE_ACPI_APEI_NMI */
10221047
10231048 static void ghes_nmi_init_cxt(void)
10241049 {
10251050 init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq);
10261051 }
1027−#else /* CONFIG_HAVE_ACPI_APEI_NMI */
1028−static inline void ghes_nmi_add(struct ghes *ghes) { }
1029−static inline void ghes_nmi_remove(struct ghes *ghes) { }
1030−static inline void ghes_nmi_init_cxt(void) { }
1031−#endif /* CONFIG_HAVE_ACPI_APEI_NMI */
1052+
1053+static int __ghes_sdei_callback(struct ghes *ghes,
1054+ enum fixed_addresses fixmap_idx)
1055+{
1056+ if (!ghes_in_nmi_queue_one_entry(ghes, fixmap_idx)) {
1057+ irq_work_queue(&ghes_proc_irq_work);
1058+
1059+ return 0;
1060+ }
1061+
1062+ return -ENOENT;
1063+}
1064+
1065+static int ghes_sdei_normal_callback(u32 event_num, struct pt_regs *regs,
1066+ void *arg)
1067+{
1068+ static DEFINE_RAW_SPINLOCK(ghes_notify_lock_sdei_normal);
1069+ struct ghes *ghes = arg;
1070+ int err;
1071+
1072+ raw_spin_lock(&ghes_notify_lock_sdei_normal);
1073+ err = __ghes_sdei_callback(ghes, FIX_APEI_GHES_SDEI_NORMAL);
1074+ raw_spin_unlock(&ghes_notify_lock_sdei_normal);
1075+
1076+ return err;
1077+}
1078+
1079+static int ghes_sdei_critical_callback(u32 event_num, struct pt_regs *regs,
1080+ void *arg)
1081+{
1082+ static DEFINE_RAW_SPINLOCK(ghes_notify_lock_sdei_critical);
1083+ struct ghes *ghes = arg;
1084+ int err;
1085+
1086+ raw_spin_lock(&ghes_notify_lock_sdei_critical);
1087+ err = __ghes_sdei_callback(ghes, FIX_APEI_GHES_SDEI_CRITICAL);
1088+ raw_spin_unlock(&ghes_notify_lock_sdei_critical);
1089+
1090+ return err;
1091+}
1092+
1093+static int apei_sdei_register_ghes(struct ghes *ghes)
1094+{
1095+ if (!IS_ENABLED(CONFIG_ARM_SDE_INTERFACE))
1096+ return -EOPNOTSUPP;
1097+
1098+ return sdei_register_ghes(ghes, ghes_sdei_normal_callback,
1099+ ghes_sdei_critical_callback);
1100+}
1101+
1102+static int apei_sdei_unregister_ghes(struct ghes *ghes)
1103+{
1104+ if (!IS_ENABLED(CONFIG_ARM_SDE_INTERFACE))
1105+ return -EOPNOTSUPP;
1106+
1107+ return sdei_unregister_ghes(ghes);
1108+}
10321109
10331110 static int ghes_probe(struct platform_device *ghes_dev)
10341111 {
10351112 struct acpi_hest_generic *generic;
10361113 struct ghes *ghes = NULL;
1114+ unsigned long flags;
10371115
10381116 int rc = -EINVAL;
10391117
@@ -1064,6 +1142,13 @@ static int ghes_probe(struct platform_device *ghes_dev) · 24 unmodified lines
10641142 goto err;
10651143 }
10661144 break;
1145+ case ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED:
1146+ if (!IS_ENABLED(CONFIG_ARM_SDE_INTERFACE)) {
1147+ pr_warn(GHES_PFX "Generic hardware error source: %d notified via SDE Interface is not supported!\n",
1148+ generic->header.source_id);
1149+ goto err;
1150+ }
1151+ break;
10671152 case ACPI_HEST_NOTIFY_LOCAL:
10681153 pr_warning(GHES_PFX "Generic hardware error source: %d notified via local interrupt is not supported!\n",
10691154 generic->header.source_id);
@@ -1127,6 +1212,11 @@ static int ghes_probe(struct platform_device *ghes_dev) · 57 unmodified lines
11271212 case ACPI_HEST_NOTIFY_NMI:
11281213 ghes_nmi_add(ghes);
11291214 break;
1215+ case ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED:
1216+ rc = apei_sdei_register_ghes(ghes);
1217+ if (rc)
1218+ goto err;
1219+ break;
11301220 default:
11311221 BUG();
11321222 }
@@ -1136,7 +1226,9 @@ static int ghes_probe(struct platform_device *ghes_dev) · 3 unmodified lines
11361226 ghes_edac_register(ghes, &ghes_dev->dev);
11371227
11381228 /* Handle any pending errors right away */
1229+ spin_lock_irqsave(&ghes_notify_lock_irq, flags);
11391230 ghes_proc(ghes);
1231+ spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
11401232
11411233 return 0;
11421234
@@ -1150,6 +1242,7 @@ err: · 7 unmodified lines
11501242
11511243 static int ghes_remove(struct platform_device *ghes_dev)
11521244 {
1245+ int rc;
11531246 struct ghes *ghes;
11541247 struct acpi_hest_generic *generic;
11551248
@@ -1182,6 +1275,11 @@ static int ghes_remove(struct platform_device *ghes_dev) · 26 unmodified lines
11821275 case ACPI_HEST_NOTIFY_NMI:
11831276 ghes_nmi_remove(ghes);
11841277 break;
1278+ case ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED:
1279+ rc = apei_sdei_unregister_ghes(ghes);
1280+ if (rc)
1281+ return rc;
1282+ break;
11851283 default:
11861284 BUG();
11871285 break;
@@ -1230,18 +1328,9 @@ static int __init ghes_init(void) · 42 unmodified lines
12301328
12311329 ghes_nmi_init_cxt();
12321330
1233− rc = ghes_estatus_pool_init();
1234− if (rc)
1235− goto err;
1236−
1237− rc = ghes_estatus_pool_expand(GHES_ESTATUS_CACHE_AVG_SIZE *
1238− GHES_ESTATUS_CACHE_ALLOCED_MAX);
1239− if (rc)
1240− goto err_pool_exit;
1241−
12421331 rc = platform_driver_register(&ghes_platform_driver);
12431332 if (rc)
1244− goto err_pool_exit;
1333+ goto err;
12451334
12461335 rc = apei_osc_setup();
12471336 if (rc == 0 && osc_sb_apei_support_acked)
@@ -1254,8 +1343,6 @@ static int __init ghes_init(void) · 6 unmodified lines
12541343 pr_info(GHES_PFX "Failed to enable APEI firmware first mode.\n");
12551344
12561345 return 0;
1257−err_pool_exit:
1258− ghes_estatus_pool_exit();
12591346 err:
12601347 return rc;
12611348 }
drivers/acpi/apei/hest.c+15−1
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <linux/io.h>
3333 #include <linux/platform_device.h>
3434 #include <acpi/apei.h>
35+#include <acpi/ghes.h>
3536
3637 #include "apei-internal.h"
3738
@@ -53,6 +54,7 @@ static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = { · 15 unmodified lines
5354 [ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
5455 [ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
5556 [ACPI_HEST_TYPE_GENERIC_ERROR_V2] = sizeof(struct acpi_hest_generic_v2),
57+ [ACPI_HEST_TYPE_IA32_DEFERRED_CHECK] = -1,
5658 };
5759
5860 static int hest_esrc_len(struct acpi_hest_header *hest_hdr)
@@ -75,6 +77,11 @@ static int hest_esrc_len(struct acpi_hest_header *hest_hdr) · 16 unmodified lines
7577 mc = (struct acpi_hest_ia_machine_check *)hest_hdr;
7678 len = sizeof(*mc) + mc->num_hardware_banks *
7779 sizeof(struct acpi_hest_ia_error_bank);
80+ } else if (hest_type == ACPI_HEST_TYPE_IA32_DEFERRED_CHECK) {
81+ struct acpi_hest_ia_deferred_check *mc;
82+ mc = (struct acpi_hest_ia_deferred_check *)hest_hdr;
83+ len = sizeof(*mc) + mc->num_hardware_banks *
84+ sizeof(struct acpi_hest_ia_error_bank);
7885 }
7986 BUG_ON(len == -1);
8087
@@ -203,6 +210,11 @@ static int __init hest_ghes_dev_register(unsigned int ghes_count) · 122 unmodified lines
203210 rc = apei_hest_parse(hest_parse_ghes, &ghes_arr);
204211 if (rc)
205212 goto err;
213+
214+ rc = ghes_estatus_pool_init(ghes_count);
215+ if (rc)
216+ goto err;
217+
206218 out:
207219 kfree(ghes_arr.ghes_devs);
208220 return rc;
@@ -251,7 +263,9 @@ void __init acpi_hest_init(void) · 42 unmodified lines
251263 rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
252264 if (rc)
253265 goto err;
254− rc = hest_ghes_dev_register(ghes_count);
266+
267+ if (ghes_count)
268+ rc = hest_ghes_dev_register(ghes_count);
255269 if (rc)
256270 goto err;
257271 }
drivers/acpi/bus.c+14−0
@@ -799,10 +799,24 @@ const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, · 798 unmodified lines
799799 }
800800 EXPORT_SYMBOL_GPL(acpi_match_device);
801801
802+static const void *acpi_of_device_get_match_data(const struct device *dev)
803+{
804+ struct acpi_device *adev = ACPI_COMPANION(dev);
805+ const struct of_device_id *match = NULL;
806+
807+ if (!acpi_of_match_device(adev, dev->driver->of_match_table, &match))
808+ return NULL;
809+
810+ return match->data;
811+}
812+
802813 const void *acpi_device_get_match_data(const struct device *dev)
803814 {
804815 const struct acpi_device_id *match;
805816
817+ if (!dev->driver->acpi_match_table)
818+ return acpi_of_device_get_match_data(dev);
819+
806820 match = acpi_match_device(dev->driver->acpi_match_table, dev);
807821 if (!match)
808822 return NULL;
drivers/acpi/custom_method.c+0−6
@@ -79,14 +79,8 @@ static const struct file_operations cm_fops = { · 78 unmodified lines
7979
8080 static int __init acpi_custom_method_init(void)
8181 {
82− if (acpi_debugfs_dir == NULL)
83− return -ENOENT;
84−
8582 cm_dentry = debugfs_create_file("custom_method", S_IWUSR,
8683 acpi_debugfs_dir, NULL, &cm_fops);
87− if (cm_dentry == NULL)
88− return -ENODEV;
89−
9084 return 0;
9185 }
9286
drivers/acpi/dptf/Makefile+0−2
@@ -1,4 +1,2 @@
11 obj-$(CONFIG_ACPI) += int340x_thermal.o
22 obj-$(CONFIG_DPTF_POWER) += dptf_power.o
3−
4−ccflags-y += -Idrivers/acpi
drivers/acpi/dptf/int340x_thermal.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include <linux/acpi.h>
1313 #include <linux/module.h>
1414
15−#include "internal.h"
15+#include "../internal.h"
1616
1717 #define INT3401_DEVICE 0X01
1818 static const struct acpi_device_id int340x_thermal_device_ids[] = {
drivers/acpi/ec.c+112−96
@@ -186,14 +186,17 @@ static void advance_transaction(struct acpi_ec *ec); · 185 unmodified lines
186186 static void acpi_ec_event_handler(struct work_struct *work);
187187 static void acpi_ec_event_processor(struct work_struct *work);
188188
189−struct acpi_ec *boot_ec, *first_ec;
189+struct acpi_ec *first_ec;
190190 EXPORT_SYMBOL(first_ec);
191+
192+static struct acpi_ec *boot_ec;
191193 static bool boot_ec_is_ecdt = false;
192194 static struct workqueue_struct *ec_query_wq;
193195
194196 static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */
195197 static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */
196198 static int EC_FLAGS_IGNORE_DSDT_GPE; /* Needs ECDT GPE as correction setting */
199+static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
197200
198201 /* --------------------------------------------------------------------------
199202 * Logging/Debugging
@@ -499,6 +502,26 @@ static inline void __acpi_ec_disable_event(struct acpi_ec *ec) · 299 unmodified lines
499502 ec_log_drv("event blocked");
500503 }
501504
505+/*
506+ * Process _Q events that might have accumulated in the EC.
507+ * Run with locked ec mutex.
508+ */
509+static void acpi_ec_clear(struct acpi_ec *ec)
510+{
511+ int i, status;
512+ u8 value = 0;
513+
514+ for (i = 0; i < ACPI_EC_CLEAR_MAX; i++) {
515+ status = acpi_ec_query(ec, &value);
516+ if (status || !value)
517+ break;
518+ }
519+ if (unlikely(i == ACPI_EC_CLEAR_MAX))
520+ pr_warn("Warning: Maximum of %d stale EC events cleared\n", i);
521+ else
522+ pr_info("%d stale EC events cleared\n", i);
523+}
524+
502525 static void acpi_ec_enable_event(struct acpi_ec *ec)
503526 {
504527 unsigned long flags;
@@ -507,6 +530,10 @@ static void acpi_ec_enable_event(struct acpi_ec *ec) · 2 unmodified lines
507530 if (acpi_ec_started(ec))
508531 __acpi_ec_enable_event(ec);
509532 spin_unlock_irqrestore(&ec->lock, flags);
533+
534+ /* Drain additional events if hardware requires that */
535+ if (EC_FLAGS_CLEAR_ON_RESUME)
536+ acpi_ec_clear(ec);
510537 }
511538
512539 #ifdef CONFIG_PM_SLEEP
@@ -1539,49 +1566,6 @@ static int acpi_ec_setup(struct acpi_ec *ec, bool handle_events) · 1026 unmodified lines
15391566 return ret;
15401567 }
15411568
1542−static int acpi_config_boot_ec(struct acpi_ec *ec, acpi_handle handle,
1543− bool handle_events, bool is_ecdt)
1544−{
1545− int ret;
1546−
1547− /*
1548− * Changing the ACPI handle results in a re-configuration of the
1549− * boot EC. And if it happens after the namespace initialization,
1550− * it causes _REG evaluations.
1551− */
1552− if (boot_ec && boot_ec->handle != handle)
1553− ec_remove_handlers(boot_ec);
1554−
1555− /* Unset old boot EC */
1556− if (boot_ec != ec)
1557− acpi_ec_free(boot_ec);
1558−
1559− /*
1560− * ECDT device creation is split into acpi_ec_ecdt_probe() and
1561− * acpi_ec_ecdt_start(). This function takes care of completing the
1562− * ECDT parsing logic as the handle update should be performed
1563− * between the installation/uninstallation of the handlers.
1564− */
1565− if (ec->handle != handle)
1566− ec->handle = handle;
1567−
1568− ret = acpi_ec_setup(ec, handle_events);
1569− if (ret)
1570− return ret;
1571−
1572− /* Set new boot EC */
1573− if (!boot_ec) {
1574− boot_ec = ec;
1575− boot_ec_is_ecdt = is_ecdt;
1576− }
1577−
1578− acpi_handle_info(boot_ec->handle,
1579− "Used as boot %s EC to handle transactions%s\n",
1580− is_ecdt ? "ECDT" : "DSDT",
1581− handle_events ? " and events" : "");
1582− return ret;
1583−}
1584−
15851569 static bool acpi_ec_ecdt_get_handle(acpi_handle *phandle)
15861570 {
15871571 struct acpi_table_ecdt *ecdt_ptr;
@@ -1601,43 +1585,34 @@ static bool acpi_ec_ecdt_get_handle(acpi_handle *phandle) · 13 unmodified lines
16011585 return true;
16021586 }
16031587
1604−static bool acpi_is_boot_ec(struct acpi_ec *ec)
1605−{
1606− if (!boot_ec)
1607− return false;
1608− if (ec->command_addr == boot_ec->command_addr &&
1609− ec->data_addr == boot_ec->data_addr)
1610− return true;
1611− return false;
1612−}
1613−
16141588 static int acpi_ec_add(struct acpi_device *device)
16151589 {
16161590 struct acpi_ec *ec = NULL;
1617− int ret;
1618− bool is_ecdt = false;
1591+ bool dep_update = true;
16191592 acpi_status status;
1593+ int ret;
16201594
16211595 strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
16221596 strcpy(acpi_device_class(device), ACPI_EC_CLASS);
16231597
16241598 if (!strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) {
1625− is_ecdt = true;
1599+ boot_ec_is_ecdt = true;
16261600 ec = boot_ec;
1601+ dep_update = false;
16271602 } else {
16281603 ec = acpi_ec_alloc();
16291604 if (!ec)
16301605 return -ENOMEM;
1606+
16311607 status = ec_parse_device(device->handle, 0, ec, NULL);
16321608 if (status != AE_CTRL_TERMINATE) {
16331609 ret = -EINVAL;
16341610 goto err_alloc;
16351611 }
1636− }
16371612
1638− if (acpi_is_boot_ec(ec)) {
1639− boot_ec_is_ecdt = is_ecdt;
1640− if (!is_ecdt) {
1613+ if (boot_ec && ec->command_addr == boot_ec->command_addr &&
1614+ ec->data_addr == boot_ec->data_addr) {
1615+ boot_ec_is_ecdt = false;
16411616 /*
16421617 * Trust PNP0C09 namespace location rather than
16431618 * ECDT ID. But trust ECDT GPE rather than _GPE
@@ -1649,12 +1624,17 @@ static int acpi_ec_add(struct acpi_device *device) · 5 unmodified lines
16491624 acpi_ec_free(ec);
16501625 ec = boot_ec;
16511626 }
1652− ret = acpi_config_boot_ec(ec, ec->handle, true, is_ecdt);
1653− } else
1654− ret = acpi_ec_setup(ec, true);
1627+ }
1628+
1629+ ret = acpi_ec_setup(ec, true);
16551630 if (ret)
16561631 goto err_query;
16571632
1633+ if (ec == boot_ec)
1634+ acpi_handle_info(boot_ec->handle,
1635+ "Boot %s EC used to handle transactions and events\n",
1636+ boot_ec_is_ecdt ? "ECDT" : "DSDT");
1637+
16581638 device->driver_data = ec;
16591639
16601640 ret = !!request_region(ec->data_addr, 1, "EC data");
@@ -1662,7 +1642,7 @@ static int acpi_ec_add(struct acpi_device *device) · 1 unmodified line
16621642 ret = !!request_region(ec->command_addr, 1, "EC cmd");
16631643 WARN(!ret, "Could not request EC cmd io port 0x%lx", ec->command_addr);
16641644
1665− if (!is_ecdt) {
1645+ if (dep_update) {
16661646 /* Reprobe devices depending on the EC */
16671647 acpi_walk_dep_device_list(ec->handle);
16681648 }
@@ -1730,10 +1710,10 @@ static const struct acpi_device_id ec_device_ids[] = { · 61 unmodified lines
17301710 * namespace EC before the main ACPI device enumeration process. It is
17311711 * retained for historical reason and will be deprecated in the future.
17321712 */
1733−int __init acpi_ec_dsdt_probe(void)
1713+void __init acpi_ec_dsdt_probe(void)
17341714 {
1735− acpi_status status;
17361715 struct acpi_ec *ec;
1716+ acpi_status status;
17371717 int ret;
17381718
17391719 /*
@@ -1743,21 +1723,22 @@ int __init acpi_ec_dsdt_probe(void) · 3 unmodified lines
17431723 * picking up an invalid EC device.
17441724 */
17451725 if (boot_ec)
1746− return -ENODEV;
1726+ return;
17471727
17481728 ec = acpi_ec_alloc();
17491729 if (!ec)
1750− return -ENOMEM;
1730+ return;
1731+
17511732 /*
17521733 * At this point, the namespace is initialized, so start to find
17531734 * the namespace objects.
17541735 */
1755− status = acpi_get_devices(ec_device_ids[0].id,
1756− ec_parse_device, ec, NULL);
1736+ status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device, ec, NULL);
17571737 if (ACPI_FAILURE(status) || !ec->handle) {
1758− ret = -ENODEV;
1759− goto error;
1738+ acpi_ec_free(ec);
1739+ return;
17601740 }
1741+
17611742 /*
17621743 * When the DSDT EC is available, always re-configure boot EC to
17631744 * have _REG evaluated. _REG can only be evaluated after the
@@ -1765,11 +1746,16 @@ int __init acpi_ec_dsdt_probe(void) · 1 unmodified line
17651746 * At this point, the GPE is not fully initialized, so do not to
17661747 * handle the events.
17671748 */
1768− ret = acpi_config_boot_ec(ec, ec->handle, false, false);
1769−error:
1770− if (ret)
1749+ ret = acpi_ec_setup(ec, false);
1750+ if (ret) {
17711751 acpi_ec_free(ec);
1772− return ret;
1752+ return;
1753+ }
1754+
1755+ boot_ec = ec;
1756+
1757+ acpi_handle_info(ec->handle,
1758+ "Boot DSDT EC used to handle transactions\n");
17731759 }
17741760
17751761 /*
@@ -1820,6 +1806,31 @@ static int ec_flag_query_handshake(const struct dmi_system_id *id) · 44 unmodified lines
18201806 }
18211807 #endif
18221808
1809+/*
1810+ * On some hardware it is necessary to clear events accumulated by the EC during
1811+ * sleep. These ECs stop reporting GPEs until they are manually polled, if too
1812+ * many events are accumulated. (e.g. Samsung Series 5/9 notebooks)
1813+ *
1814+ * https://bugzilla.kernel.org/show_bug.cgi?id=44161
1815+ *
1816+ * Ideally, the EC should also be instructed NOT to accumulate events during
1817+ * sleep (which Windows seems to do somehow), but the interface to control this
1818+ * behaviour is not known at this time.
1819+ *
1820+ * Models known to be affected are Samsung 530Uxx/535Uxx/540Uxx/550Pxx/900Xxx,
1821+ * however it is very likely that other Samsung models are affected.
1822+ *
1823+ * On systems which don't accumulate _Q events during sleep, this extra check
1824+ * should be harmless.
1825+ */
1826+static int ec_clear_on_resume(const struct dmi_system_id *id)
1827+{
1828+ pr_debug("Detected system needing EC poll on resume.\n");
1829+ EC_FLAGS_CLEAR_ON_RESUME = 1;
1830+ ec_event_clearing = ACPI_EC_EVT_TIMING_STATUS;
1831+ return 0;
1832+}
1833+
18231834 /*
18241835 * Some ECDTs contain wrong register addresses.
18251836 * MSI MS-171F
@@ -1869,39 +1880,38 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = { · 43 unmodified lines
18691880 ec_honor_ecdt_gpe, "ASUS X580VD", {
18701881 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
18711882 DMI_MATCH(DMI_PRODUCT_NAME, "X580VD"),}, NULL},
1883+ {
1884+ ec_clear_on_resume, "Samsung hardware", {
1885+ DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL},
18721886 {},
18731887 };
18741888
1875−int __init acpi_ec_ecdt_probe(void)
1889+void __init acpi_ec_ecdt_probe(void)
18761890 {
1877− int ret;
1878− acpi_status status;
18791891 struct acpi_table_ecdt *ecdt_ptr;
18801892 struct acpi_ec *ec;
1893+ acpi_status status;
1894+ int ret;
18811895
1882− ec = acpi_ec_alloc();
1883− if (!ec)
1884− return -ENOMEM;
1885− /*
1886− * Generate a boot ec context
1887− */
1896+ /* Generate a boot ec context. */
18881897 dmi_check_system(ec_dmi_table);
18891898 status = acpi_get_table(ACPI_SIG_ECDT, 1,
18901899 (struct acpi_table_header **)&ecdt_ptr);
1891− if (ACPI_FAILURE(status)) {
1892− ret = -ENODEV;
1893− goto error;
1894− }
1900+ if (ACPI_FAILURE(status))
1901+ return;
18951902
18961903 if (!ecdt_ptr->control.address || !ecdt_ptr->data.address) {
18971904 /*
18981905 * Asus X50GL:
18991906 * https://bugzilla.kernel.org/show_bug.cgi?id=11880
19001907 */
1901− ret = -ENODEV;
1902− goto error;
1908+ return;
19031909 }
19041910
1911+ ec = acpi_ec_alloc();
1912+ if (!ec)
1913+ return;
1914+
19051915 if (EC_FLAGS_CORRECT_ECDT) {
19061916 ec->command_addr = ecdt_ptr->data.address;
19071917 ec->data_addr = ecdt_ptr->control.address;
@@ -1910,16 +1920,22 @@ int __init acpi_ec_ecdt_probe(void) · 2 unmodified lines
19101920 ec->data_addr = ecdt_ptr->data.address;
19111921 }
19121922 ec->gpe = ecdt_ptr->gpe;
1923+ ec->handle = ACPI_ROOT_OBJECT;
19131924
19141925 /*
19151926 * At this point, the namespace is not initialized, so do not find
19161927 * the namespace objects, or handle the events.
19171928 */
1918− ret = acpi_config_boot_ec(ec, ACPI_ROOT_OBJECT, false, true);
1919−error:
1920− if (ret)
1929+ ret = acpi_ec_setup(ec, false);
1930+ if (ret) {
19211931 acpi_ec_free(ec);
1922− return ret;
1932+ return;
1933+ }
1934+
1935+ boot_ec = ec;
1936+ boot_ec_is_ecdt = true;
1937+
1938+ pr_info("Boot ECDT EC used to handle transactions\n");
19231939 }
19241940
19251941 #ifdef CONFIG_PM_SLEEP
drivers/acpi/ec_sys.c+8−28
@@ -108,52 +108,32 @@ static const struct file_operations acpi_ec_io_ops = { · 107 unmodified lines
108108 .llseek = default_llseek,
109109 };
110110
111−static int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count)
111+static void acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count)
112112 {
113113 struct dentry *dev_dir;
114114 char name[64];
115115 umode_t mode = 0400;
116116
117− if (ec_device_count == 0) {
117+ if (ec_device_count == 0)
118118 acpi_ec_debugfs_dir = debugfs_create_dir("ec", NULL);
119− if (!acpi_ec_debugfs_dir)
120− return -ENOMEM;
121− }
122119
123120 sprintf(name, "ec%u", ec_device_count);
124121 dev_dir = debugfs_create_dir(name, acpi_ec_debugfs_dir);
125− if (!dev_dir) {
126− if (ec_device_count != 0)
127− goto error;
128− return -ENOMEM;
129− }
130122
131− if (!debugfs_create_x32("gpe", 0444, dev_dir, &first_ec->gpe))
132− goto error;
133− if (!debugfs_create_bool("use_global_lock", 0444, dev_dir,
134− &first_ec->global_lock))
135− goto error;
123+ debugfs_create_x32("gpe", 0444, dev_dir, &first_ec->gpe);
124+ debugfs_create_bool("use_global_lock", 0444, dev_dir,
125+ &first_ec->global_lock);
136126
137127 if (write_support)
138128 mode = 0600;
139− if (!debugfs_create_file("io", mode, dev_dir, ec, &acpi_ec_io_ops))
140− goto error;
141−
142− return 0;
143−
144−error:
145− debugfs_remove_recursive(acpi_ec_debugfs_dir);
146− return -ENOMEM;
129+ debugfs_create_file("io", mode, dev_dir, ec, &acpi_ec_io_ops);
147130 }
148131
149132 static int __init acpi_ec_sys_init(void)
150133 {
151− int err = 0;
152134 if (first_ec)
153− err = acpi_ec_add_debugfs(first_ec, 0);
154− else
155− err = -ENODEV;
156− return err;
135+ acpi_ec_add_debugfs(first_ec, 0);
136+ return 0;
157137 }
158138
159139 static void __exit acpi_ec_sys_exit(void)
drivers/acpi/internal.h+2−2
@@ -192,8 +192,8 @@ extern struct acpi_ec *first_ec; · 191 unmodified lines
192192 typedef int (*acpi_ec_query_func) (void *data);
193193
194194 int acpi_ec_init(void);
195−int acpi_ec_ecdt_probe(void);
196−int acpi_ec_dsdt_probe(void);
195+void acpi_ec_ecdt_probe(void);
196+void acpi_ec_dsdt_probe(void);
197197 void acpi_ec_block_transactions(void);
198198 void acpi_ec_unblock_transactions(void);
199199 void acpi_ec_mark_gpe_for_wake(void);
drivers/acpi/irq.c+2−2
@@ -196,7 +196,7 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares, · 195 unmodified lines
196196 fwnode = acpi_gsi_domain_id;
197197 acpi_irq_parse_one_match(fwnode, irq->interrupts[ctx->index],
198198 irq->triggering, irq->polarity,
199− irq->sharable, ctx);
199+ irq->shareable, ctx);
200200 return AE_CTRL_TERMINATE;
201201 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
202202 eirq = &ares->data.extended_irq;
@@ -209,7 +209,7 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares, · 6 unmodified lines
209209 fwnode = acpi_get_irq_source_fwhandle(&eirq->resource_source);
210210 acpi_irq_parse_one_match(fwnode, eirq->interrupts[ctx->index],
211211 eirq->triggering, eirq->polarity,
212− eirq->sharable, ctx);
212+ eirq->shareable, ctx);
213213 return AE_CTRL_TERMINATE;
214214 }
215215
drivers/acpi/pci_link.c+4−4
@@ -317,10 +317,10 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) · 316 unmodified lines
317317 resource->res.data.irq.polarity =
318318 link->irq.polarity;
319319 if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
320− resource->res.data.irq.sharable =
320+ resource->res.data.irq.shareable =
321321 ACPI_EXCLUSIVE;
322322 else
323− resource->res.data.irq.sharable = ACPI_SHARED;
323+ resource->res.data.irq.shareable = ACPI_SHARED;
324324 resource->res.data.irq.interrupt_count = 1;
325325 resource->res.data.irq.interrupts[0] = irq;
326326 break;
@@ -335,10 +335,10 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) · 8 unmodified lines
335335 resource->res.data.extended_irq.polarity =
336336 link->irq.polarity;
337337 if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
338− resource->res.data.irq.sharable =
338+ resource->res.data.irq.shareable =
339339 ACPI_EXCLUSIVE;
340340 else
341− resource->res.data.irq.sharable = ACPI_SHARED;
341+ resource->res.data.irq.shareable = ACPI_SHARED;
342342 resource->res.data.extended_irq.interrupt_count = 1;
343343 resource->res.data.extended_irq.interrupts[0] = irq;
344344 /* ignore resource_source, it's optional */
drivers/acpi/pptt.c+9−4
@@ -451,6 +451,11 @@ static struct acpi_pptt_processor *acpi_find_processor_package_id(struct acpi_ta · 450 unmodified lines
451451 return cpu;
452452 }
453453
454+static void acpi_pptt_warn_missing(void)
455+{
456+ pr_warn_once("No PPTT table found, cpu and cache topology may be inaccurate\n");
457+}
458+
454459 /**
455460 * topology_get_acpi_cpu_tag() - Find a unique topology value for a feature
456461 * @table: Pointer to the head of the PPTT table
@@ -498,7 +503,7 @@ static int find_acpi_cpu_topology_tag(unsigned int cpu, int level, int flag) · 41 unmodified lines
498503
499504 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
500505 if (ACPI_FAILURE(status)) {
501− pr_warn_once("No PPTT table found, cpu topology may be inaccurate\n");
506+ acpi_pptt_warn_missing();
502507 return -ENOENT;
503508 }
504509 retval = topology_get_acpi_cpu_tag(table, cpu, level, flag);
@@ -531,7 +536,7 @@ int acpi_find_last_cache_level(unsigned int cpu) · 26 unmodified lines
531536 acpi_cpu_id = get_acpi_id_for_cpu(cpu);
532537 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
533538 if (ACPI_FAILURE(status)) {
534− pr_warn_once("No PPTT table found, cache topology may be inaccurate\n");
539+ acpi_pptt_warn_missing();
535540 } else {
536541 number_of_levels = acpi_find_cache_levels(table, acpi_cpu_id);
537542 acpi_put_table(table);
@@ -563,7 +568,7 @@ int cache_setup_acpi(unsigned int cpu) · 25 unmodified lines
563568
564569 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
565570 if (ACPI_FAILURE(status)) {
566− pr_warn_once("No PPTT table found, cache topology may be inaccurate\n");
571+ acpi_pptt_warn_missing();
567572 return -ENOENT;
568573 }
569574
@@ -617,7 +622,7 @@ int find_acpi_cpu_cache_topology(unsigned int cpu, int level) · 47 unmodified lines
617622
618623 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
619624 if (ACPI_FAILURE(status)) {
620− pr_warn_once("No PPTT table found, topology may be inaccurate\n");
625+ acpi_pptt_warn_missing();
621626 return -ENOENT;
622627 }
623628
drivers/acpi/resource.c+2−2
@@ -476,7 +476,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, · 475 unmodified lines
476476 }
477477 acpi_dev_get_irqresource(res, irq->interrupts[index],
478478 irq->triggering, irq->polarity,
479− irq->sharable, true);
479+ irq->shareable, true);
480480 break;
481481 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
482482 ext_irq = &ares->data.extended_irq;
@@ -487,7 +487,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, · 4 unmodified lines
487487 if (is_gsi(ext_irq))
488488 acpi_dev_get_irqresource(res, ext_irq->interrupts[index],
489489 ext_irq->triggering, ext_irq->polarity,
490− ext_irq->sharable, false);
490+ ext_irq->shareable, false);
491491 else
492492 acpi_dev_irqresource_disabled(res, 0);
493493 break;
drivers/acpi/tables.c+10−2
@@ -473,14 +473,22 @@ static DECLARE_BITMAP(acpi_initrd_installed, NR_ACPI_INITRD_TABLES); · 472 unmodified lines
473473
474474 void __init acpi_table_upgrade(void)
475475 {
476− void *data = (void *)initrd_start;
477− size_t size = initrd_end - initrd_start;
476+ void *data;
477+ size_t size;
478478 int sig, no, table_nr = 0, total_offset = 0;
479479 long offset = 0;
480480 struct acpi_table_header *table;
481481 char cpio_path[32] = "kernel/firmware/acpi/";
482482 struct cpio_data file;
483483
484+ if (IS_ENABLED(CONFIG_ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD)) {
485+ data = __initramfs_start;
486+ size = __initramfs_size;
487+ } else {
488+ data = (void *)initrd_start;
489+ size = initrd_end - initrd_start;
490+ }
491+
484492 if (data == NULL || size == 0)
485493 return;
486494
drivers/acpi/x86/utils.c+5−0
@@ -56,6 +56,11 @@ static const struct always_present_id always_present_ids[] = { · 55 unmodified lines
5656 */
5757 ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT), {}),
5858 ENTRY("80862288", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}),
59+
60+ /* Lenovo Yoga Book uses PWM2 for keyboard backlight control */
61+ ENTRY("80862289", "2", ICPU(INTEL_FAM6_ATOM_AIRMONT), {
62+ DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"),
63+ }),
5964 /*
6065 * The INT0002 device is necessary to clear wakeup interrupt sources
6166 * on Cherry Trail devices, without it we get nobody cared IRQ msgs.
drivers/firmware/arm_sdei.c+68−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 // Copyright (C) 2017 Arm Ltd.
33 #define pr_fmt(fmt) "sdei: " fmt
44
5+#include <acpi/ghes.h>
56 #include <linux/acpi.h>
67 #include <linux/arm_sdei.h>
78 #include <linux/arm-smccc.h>
@@ -887,6 +888,73 @@ static void sdei_smccc_hvc(unsigned long function_id, · 879 unmodified lines
887888 arm_smccc_hvc(function_id, arg0, arg1, arg2, arg3, arg4, 0, 0, res);
888889 }
889890
891+int sdei_register_ghes(struct ghes *ghes, sdei_event_callback *normal_cb,
892+ sdei_event_callback *critical_cb)
893+{
894+ int err;
895+ u64 result;
896+ u32 event_num;
897+ sdei_event_callback *cb;
898+
899+ if (!IS_ENABLED(CONFIG_ACPI_APEI_GHES))
900+ return -EOPNOTSUPP;
901+
902+ event_num = ghes->generic->notify.vector;
903+ if (event_num == 0) {
904+ /*
905+ * Event 0 is reserved by the specification for
906+ * SDEI_EVENT_SIGNAL.
907+ */
908+ return -EINVAL;
909+ }
910+
911+ err = sdei_api_event_get_info(event_num, SDEI_EVENT_INFO_EV_PRIORITY,
912+ &result);
913+ if (err)
914+ return err;
915+
916+ if (result == SDEI_EVENT_PRIORITY_CRITICAL)
917+ cb = critical_cb;
918+ else
919+ cb = normal_cb;
920+
921+ err = sdei_event_register(event_num, cb, ghes);
922+ if (!err)
923+ err = sdei_event_enable(event_num);
924+
925+ return err;
926+}
927+
928+int sdei_unregister_ghes(struct ghes *ghes)
929+{
930+ int i;
931+ int err;
932+ u32 event_num = ghes->generic->notify.vector;
933+
934+ might_sleep();
935+
936+ if (!IS_ENABLED(CONFIG_ACPI_APEI_GHES))
937+ return -EOPNOTSUPP;
938+
939+ /*
940+ * The event may be running on another CPU. Disable it
941+ * to stop new events, then try to unregister a few times.
942+ */
943+ err = sdei_event_disable(event_num);
944+ if (err)
945+ return err;
946+
947+ for (i = 0; i < 3; i++) {
948+ err = sdei_event_unregister(event_num);
949+ if (err != -EINPROGRESS)
950+ break;
951+
952+ schedule();
953+ }
954+
955+ return err;
956+}
957+
890958 static int sdei_get_conduit(struct platform_device *pdev)
891959 {
892960 const char *method;
drivers/firmware/efi/cper.c+9−4
@@ -534,19 +534,24 @@ EXPORT_SYMBOL_GPL(cper_estatus_check_header); · 533 unmodified lines
534534 int cper_estatus_check(const struct acpi_hest_generic_status *estatus)
535535 {
536536 struct acpi_hest_generic_data *gdata;
537− unsigned int data_len, gedata_len;
537+ unsigned int data_len, record_size;
538538 int rc;
539539
540540 rc = cper_estatus_check_header(estatus);
541541 if (rc)
542542 return rc;
543+
543544 data_len = estatus->data_length;
544545
545546 apei_estatus_for_each_section(estatus, gdata) {
546− gedata_len = acpi_hest_get_error_length(gdata);
547− if (gedata_len > data_len - acpi_hest_get_size(gdata))
547+ if (sizeof(struct acpi_hest_generic_data) > data_len)
548+ return -EINVAL;
549+
550+ record_size = acpi_hest_get_record_size(gdata);
551+ if (record_size > data_len)
548552 return -EINVAL;
549− data_len -= acpi_hest_get_record_size(gdata);
553+
554+ data_len -= record_size;
550555 }
551556 if (data_len)
552557 return -EINVAL;
drivers/gpio/gpiolib-acpi.c+1−1
@@ -892,7 +892,7 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, · 891 unmodified lines
892892 * event but only if the access here is ACPI_READ. In that
893893 * case we "borrow" the event GPIO instead.
894894 */
895− if (!found && agpio->sharable == ACPI_SHARED &&
895+ if (!found && agpio->shareable == ACPI_SHARED &&
896896 function == ACPI_READ) {
897897 struct acpi_gpio_event *event;
898898
drivers/platform/x86/sony-laptop.c+4−4
@@ -4392,7 +4392,7 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) · 4391 unmodified lines
43924392 list_add(&interrupt->list, &dev->interrupts);
43934393 interrupt->irq.triggering = p->triggering;
43944394 interrupt->irq.polarity = p->polarity;
4395− interrupt->irq.sharable = p->sharable;
4395+ interrupt->irq.shareable = p->shareable;
43964396 interrupt->irq.interrupt_count = 1;
43974397 interrupt->irq.interrupts[0] = p->interrupts[i];
43984398 }
@@ -4546,7 +4546,7 @@ static int sony_pic_enable(struct acpi_device *device, · 147 unmodified lines
45464546 memcpy(&resource->res3.data.irq, &irq->irq,
45474547 sizeof(struct acpi_resource_irq));
45484548 /* we requested a shared irq */
4549− resource->res3.data.irq.sharable = ACPI_SHARED;
4549+ resource->res3.data.irq.shareable = ACPI_SHARED;
45504550
45514551 resource->res4.type = ACPI_RESOURCE_TYPE_END_TAG;
45524552 resource->res4.length = sizeof(struct acpi_resource);
@@ -4565,7 +4565,7 @@ static int sony_pic_enable(struct acpi_device *device, · 12 unmodified lines
45654565 memcpy(&resource->res2.data.irq, &irq->irq,
45664566 sizeof(struct acpi_resource_irq));
45674567 /* we requested a shared irq */
4568− resource->res2.data.irq.sharable = ACPI_SHARED;
4568+ resource->res2.data.irq.shareable = ACPI_SHARED;
45694569
45704570 resource->res3.type = ACPI_RESOURCE_TYPE_END_TAG;
45714571 resource->res3.length = sizeof(struct acpi_resource);
@@ -4779,7 +4779,7 @@ static int sony_pic_add(struct acpi_device *device) · 207 unmodified lines
47794779 irq->irq.interrupts[0],
47804780 irq->irq.triggering,
47814781 irq->irq.polarity,
4782− irq->irq.sharable);
4782+ irq->irq.shareable);
47834783 spic_dev.cur_irq = irq;
47844784 break;
47854785 }
drivers/pnp/pnpacpi/rsparser.c+7−7
@@ -215,7 +215,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, · 214 unmodified lines
215215 if (i >= 0) {
216216 flags = acpi_dev_irq_flags(gpio->triggering,
217217 gpio->polarity,
218− gpio->sharable);
218+ gpio->shareable);
219219 } else {
220220 flags = IORESOURCE_DISABLED;
221221 }
@@ -324,7 +324,7 @@ static __init void pnpacpi_parse_irq_option(struct pnp_dev *dev, · 102 unmodified lines
324324 if (p->interrupts[i])
325325 __set_bit(p->interrupts[i], map.bits);
326326
327− flags = acpi_dev_irq_flags(p->triggering, p->polarity, p->sharable);
327+ flags = acpi_dev_irq_flags(p->triggering, p->polarity, p->shareable);
328328 pnp_register_irq_resource(dev, option_flags, &map, flags);
329329 }
330330
@@ -348,7 +348,7 @@ static __init void pnpacpi_parse_ext_irq_option(struct pnp_dev *dev, · 17 unmodified lines
348348 }
349349 }
350350
351− flags = acpi_dev_irq_flags(p->triggering, p->polarity, p->sharable);
351+ flags = acpi_dev_irq_flags(p->triggering, p->polarity, p->shareable);
352352 pnp_register_irq_resource(dev, option_flags, &map, flags);
353353 }
354354
@@ -681,7 +681,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev, · 326 unmodified lines
681681 decode_irq_flags(dev, p->flags, &triggering, &polarity, &shareable);
682682 irq->triggering = triggering;
683683 irq->polarity = polarity;
684− irq->sharable = shareable;
684+ irq->shareable = shareable;
685685 irq->interrupt_count = 1;
686686 irq->interrupts[0] = p->start;
687687
@@ -689,7 +689,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev, · 1 unmodified line
689689 (int) p->start,
690690 triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge",
691691 polarity == ACPI_ACTIVE_LOW ? "low" : "high",
692− irq->sharable == ACPI_SHARED ? "shared" : "exclusive",
692+ irq->shareable == ACPI_SHARED ? "shared" : "exclusive",
693693 irq->descriptor_length);
694694 }
695695
@@ -711,14 +711,14 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev, · 15 unmodified lines
711711 extended_irq->producer_consumer = ACPI_CONSUMER;
712712 extended_irq->triggering = triggering;
713713 extended_irq->polarity = polarity;
714− extended_irq->sharable = shareable;
714+ extended_irq->shareable = shareable;
715715 extended_irq->interrupt_count = 1;
716716 extended_irq->interrupts[0] = p->start;
717717
718718 pnp_dbg(&dev->dev, " encode irq %d %s %s %s\n", (int) p->start,
719719 triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge",
720720 polarity == ACPI_ACTIVE_LOW ? "low" : "high",
721− extended_irq->sharable == ACPI_SHARED ? "shared" : "exclusive");
721+ extended_irq->shareable == ACPI_SHARED ? "shared" : "exclusive");
722722 }
723723
724724 static void pnpacpi_encode_dma(struct pnp_dev *dev,
include/acpi/acbuffer.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acbuffer.h - Support for buffers returned by ACPI predefined names
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/acpi/acconfig.h+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acconfig.h - Global configuration constants
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -141,7 +141,7 @@ · 131 unmodified lines
141141
142142 /*
143143 * Maximal number of elements the Result Stack can contain,
144− * it may be an arbitray value not exceeding the types of
144+ * it may be an arbitrary value not exceeding the types of
145145 * result_size and result_count (now u8).
146146 */
147147 #define ACPI_RESULTS_OBJ_NUM_MAX 255
include/acpi/acexcep.h+3−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acexcep.h - Exception codes returned by the ACPI subsystem
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -311,7 +311,8 @@ static const struct acpi_exception_info acpi_gbl_exception_names_aml[] = { · 301 unmodified lines
311311 "An ACPI name contains invalid character(s)"),
312312 EXCEP_TXT("AE_AML_NAME_NOT_FOUND",
313313 "Could not resolve a named reference"),
314− EXCEP_TXT("AE_AML_INTERNAL", "An internal error within the interprete"),
314+ EXCEP_TXT("AE_AML_INTERNAL",
315+ "An internal error within the interpreter"),
315316 EXCEP_TXT("AE_AML_INVALID_SPACE_ID",
316317 "An Operation Region SpaceID is invalid"),
317318 EXCEP_TXT("AE_AML_STRING_LIMIT",
include/acpi/acnames.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acnames.h - Global names and strings
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/acpi/acoutput.h+3−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acoutput.h -- debug output
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -201,6 +201,7 @@ · 191 unmodified lines
201201 #define ACPI_EXCEPTION(plist) acpi_exception plist
202202 #define ACPI_ERROR(plist) acpi_error plist
203203 #define ACPI_BIOS_WARNING(plist) acpi_bios_warning plist
204+#define ACPI_BIOS_EXCEPTION(plist) acpi_bios_exception plist
204205 #define ACPI_BIOS_ERROR(plist) acpi_bios_error plist
205206 #define ACPI_DEBUG_OBJECT(obj,l,i) acpi_ex_do_debug_object(obj,l,i)
206207
@@ -213,6 +214,7 @@ · 6 unmodified lines
213214 #define ACPI_EXCEPTION(plist)
214215 #define ACPI_ERROR(plist)
215216 #define ACPI_BIOS_WARNING(plist)
217+#define ACPI_BIOS_EXCEPTION(plist)
216218 #define ACPI_BIOS_ERROR(plist)
217219 #define ACPI_DEBUG_OBJECT(obj,l,i)
218220
include/acpi/acpi.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acpi.h - Master public include file used to interface to ACPICA
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/acpi/acpiosxf.h+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 * interfaces must be implemented by OSL to interface the
66 * ACPI components to the host operating system.
77 *
8− * Copyright (C) 2000 - 2018, Intel Corp.
8+ * Copyright (C) 2000 - 2019, Intel Corp.
99 *
1010 *****************************************************************************/
1111
include/acpi/acpixf.h+8−10
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acpixf.h - External interfaces to the ACPI subsystem
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -12,7 +12,7 @@ · 2 unmodified lines
1212
1313 /* Current ACPICA subsystem version in YYYYMMDD format */
1414
15−#define ACPI_CA_VERSION 0x20181213
15+#define ACPI_CA_VERSION 0x20190215
1616
1717 #include <acpi/acconfig.h>
1818 #include <acpi/actypes.h>
@@ -156,14 +156,6 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE); · 137 unmodified lines
156156 */
157157 ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
158158
159−/*
160− * Optionally support module level code by parsing an entire table as
161− * a method as it is loaded. Default is TRUE.
162− * NOTE, this is essentially obsolete and will be removed soon
163− * (01/2018).
164− */
165−ACPI_INIT_GLOBAL(u8, acpi_gbl_execute_tables_as_methods, TRUE);
166−
167159 /*
168160 * Optionally use 32-bit FADT addresses if and when there is a conflict
169161 * (address mismatch) between the 32-bit and 64-bit versions of the
@@ -903,6 +895,12 @@ ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) · 733 unmodified lines
903895 acpi_bios_error(const char *module_name,
904896 u32 line_number,
905897 const char *format, ...))
898+ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
899+ void ACPI_INTERNAL_VAR_XFACE
900+ acpi_bios_exception(const char *module_name,
901+ u32 line_number,
902+ acpi_status status,
903+ const char *format, ...))
906904 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
907905 void ACPI_INTERNAL_VAR_XFACE
908906 acpi_bios_warning(const char *module_name,
include/acpi/acrestyp.h+8−8
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acrestyp.h - Defines, types, and structures for resource descriptors
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -139,7 +139,7 @@ struct acpi_resource_irq { · 129 unmodified lines
139139 u8 descriptor_length;
140140 u8 triggering;
141141 u8 polarity;
142− u8 sharable;
142+ u8 shareable;
143143 u8 wake_capable;
144144 u8 interrupt_count;
145145 u8 interrupts[1];
@@ -328,7 +328,7 @@ struct acpi_resource_extended_irq { · 182 unmodified lines
328328 u8 producer_consumer;
329329 u8 triggering;
330330 u8 polarity;
331− u8 sharable;
331+ u8 shareable;
332332 u8 wake_capable;
333333 u8 interrupt_count;
334334 struct acpi_resource_source resource_source;
@@ -348,7 +348,7 @@ struct acpi_resource_gpio { · 13 unmodified lines
348348 u8 connection_type;
349349 u8 producer_consumer; /* For values, see Producer/Consumer above */
350350 u8 pin_config;
351− u8 sharable; /* For values, see Interrupt Attributes above */
351+ u8 shareable; /* For values, see Interrupt Attributes above */
352352 u8 wake_capable; /* For values, see Interrupt Attributes above */
353353 u8 io_restriction;
354354 u8 triggering; /* For values, see Interrupt Attributes above */
@@ -508,7 +508,7 @@ struct acpi_resource_uart_serialbus { · 153 unmodified lines
508508 struct acpi_resource_pin_function {
509509 u8 revision_id;
510510 u8 pin_config;
511− u8 sharable; /* For values, see Interrupt Attributes above */
511+ u8 shareable; /* For values, see Interrupt Attributes above */
512512 u16 function_number;
513513 u16 pin_table_length;
514514 u16 vendor_length;
@@ -520,7 +520,7 @@ struct acpi_resource_pin_function { · 5 unmodified lines
520520 struct acpi_resource_pin_config {
521521 u8 revision_id;
522522 u8 producer_consumer; /* For values, see Producer/Consumer above */
523− u8 sharable; /* For values, see Interrupt Attributes above */
523+ u8 shareable; /* For values, see Interrupt Attributes above */
524524 u8 pin_config_type;
525525 u32 pin_config_value;
526526 u16 pin_table_length;
@@ -560,7 +560,7 @@ struct acpi_resource_pin_group { · 33 unmodified lines
560560 struct acpi_resource_pin_group_function {
561561 u8 revision_id;
562562 u8 producer_consumer; /* For values, see Producer/Consumer above */
563− u8 sharable; /* For values, see Interrupt Attributes above */
563+ u8 shareable; /* For values, see Interrupt Attributes above */
564564 u16 function_number;
565565 u16 vendor_length;
566566 struct acpi_resource_source resource_source;
@@ -571,7 +571,7 @@ struct acpi_resource_pin_group_function { · 4 unmodified lines
571571 struct acpi_resource_pin_group_config {
572572 u8 revision_id;
573573 u8 producer_consumer; /* For values, see Producer/Consumer above */
574− u8 sharable; /* For values, see Interrupt Attributes above */
574+ u8 shareable; /* For values, see Interrupt Attributes above */
575575 u8 pin_config_type; /* For values, see pin_config_type above */
576576 u32 pin_config_value;
577577 u16 vendor_length;
include/acpi/actbl.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: actbl.h - Basic ACPI Table Definitions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/acpi/actbl1.h+12−7
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: actbl1.h - Additional ACPI table definitions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -562,7 +562,7 @@ struct acpi_dmar_hardware_unit { · 552 unmodified lines
562562
563563 #define ACPI_DMAR_INCLUDE_ALL (1)
564564
565−/* 1: Reserved Memory Defininition */
565+/* 1: Reserved Memory Definition */
566566
567567 struct acpi_dmar_reserved_memory {
568568 struct acpi_dmar_header header;
@@ -1001,6 +1001,11 @@ struct acpi_table_gtdt { · 432 unmodified lines
10011001 #define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
10021002 #define ACPI_GTDT_ALWAYS_ON (1<<2)
10031003
1004+struct acpi_gtdt_el2 {
1005+ u32 virtual_el2_timer_gsiv;
1006+ u32 virtual_el2_timer_flags;
1007+};
1008+
10041009 /* Common GTDT subtable header */
10051010
10061011 struct acpi_gtdt_header {
@@ -1390,7 +1395,7 @@ struct acpi_table_hmat { · 383 unmodified lines
13901395 /* Values for HMAT structure types */
13911396
13921397 enum acpi_hmat_type {
1393− ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */
1398+ ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subsystem address range */
13941399 ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */
13951400 ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */
13961401 ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
@@ -1406,17 +1411,17 @@ struct acpi_hmat_structure { · 9 unmodified lines
14061411 * HMAT Structures, correspond to Type in struct acpi_hmat_structure
14071412 */
14081413
1409−/* 0: Memory subystem address range */
1414+/* 0: Memory proximity domain attributes */
14101415
1411−struct acpi_hmat_address_range {
1416+struct acpi_hmat_proximity_domain {
14121417 struct acpi_hmat_structure header;
14131418 u16 flags;
14141419 u16 reserved1;
14151420 u32 processor_PD; /* Processor proximity domain */
14161421 u32 memory_PD; /* Memory proximity domain */
14171422 u32 reserved2;
1418− u64 physical_address_base; /* Physical address range base */
1419− u64 physical_address_length; /* Physical address range length */
1423+ u64 reserved3;
1424+ u64 reserved4;
14201425 };
14211426
14221427 /* Masks for Flags field above */
include/acpi/actbl2.h+11−6
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -143,7 +143,7 @@ struct acpi_iort_memory_access { · 133 unmodified lines
143143 */
144144 struct acpi_iort_its_group {
145145 u32 its_count;
146− u32 identifiers[1]; /* GIC ITS identifier arrary */
146+ u32 identifiers[1]; /* GIC ITS identifier array */
147147 };
148148
149149 struct acpi_iort_named_component {
@@ -623,7 +623,7 @@ struct acpi_madt_local_x2apic_nmi { · 473 unmodified lines
623623 u8 reserved[3]; /* reserved - must be zero */
624624 };
625625
626−/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
626+/* 11: Generic interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 changes) */
627627
628628 struct acpi_madt_generic_interrupt {
629629 struct acpi_subtable_header header;
@@ -641,7 +641,8 @@ struct acpi_madt_generic_interrupt { · 11 unmodified lines
641641 u64 gicr_base_address;
642642 u64 arm_mpidr;
643643 u8 efficiency_class;
644− u8 reserved2[3];
644+ u8 reserved2[1];
645+ u16 spe_interrupt; /* ACPI 6.3 */
645646 };
646647
647648 /* Masks for Flags field above */
@@ -1361,6 +1362,7 @@ struct acpi_pdtt_channel { · 713 unmodified lines
13611362
13621363 #define ACPI_PDTT_RUNTIME_TRIGGER (1)
13631364 #define ACPI_PDTT_WAIT_COMPLETION (1<<1)
1365+#define ACPI_PDTT_TRIGGER_ORDER (1<<2)
13641366
13651367 /*******************************************************************************
13661368 *
@@ -1472,8 +1474,11 @@ struct acpi_pptt_processor { · 105 unmodified lines
14721474
14731475 /* Flags */
14741476
1475−#define ACPI_PPTT_PHYSICAL_PACKAGE (1) /* Physical package */
1476−#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (2) /* ACPI Processor ID valid */
1477+#define ACPI_PPTT_PHYSICAL_PACKAGE (1)
1478+#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (1<<1)
1479+#define ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD (1<<2) /* ACPI 6.3 */
1480+#define ACPI_PPTT_ACPI_LEAF_NODE (1<<3) /* ACPI 6.3 */
1481+#define ACPI_PPTT_ACPI_IDENTICAL (1<<4) /* ACPI 6.3 */
14771482
14781483 /* 1: Cache Type Structure */
14791484
include/acpi/actbl3.h+19−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: actbl3.h - ACPI Table Definitions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -190,7 +190,8 @@ enum acpi_srat_type { · 180 unmodified lines
190190 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
191191 ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
192192 ACPI_SRAT_TYPE_GIC_ITS_AFFINITY = 4, /* ACPI 6.2 */
193− ACPI_SRAT_TYPE_RESERVED = 5 /* 5 and greater are reserved */
193+ ACPI_SRAT_TYPE_GENERIC_AFFINITY = 5, /* ACPI 6.3 */
194+ ACPI_SRAT_TYPE_RESERVED = 6 /* 5 and greater are reserved */
194195 };
195196
196197 /*
@@ -271,6 +272,22 @@ struct acpi_srat_gic_its_affinity { · 74 unmodified lines
271272 u32 its_id;
272273 };
273274
275+/* 5: Generic Initiator Affinity Structure (ACPI 6.3) */
276+
277+struct acpi_srat_generic_affinity {
278+ struct acpi_subtable_header header;
279+ u8 reserved;
280+ u8 device_handle_type;
281+ u32 proximity_domain;
282+ u8 device_handle[16];
283+ u32 flags;
284+ u32 reserved1;
285+};
286+
287+/* Flags for struct acpi_srat_generic_affinity */
288+
289+#define ACPI_SRAT_GENERIC_AFFINITY_ENABLED (1) /* 00: Use affinity structure */
290+
274291 /*******************************************************************************
275292 *
276293 * STAO - Status Override Table (_STA override) - ACPI 6.0
include/acpi/actypes.h+3−11
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: actypes.h - Common data types for the entire ACPI subsystem
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
@@ -617,8 +617,9 @@ typedef u64 acpi_integer; · 607 unmodified lines
617617 #define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C
618618 #define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D
619619 #define ACPI_NOTIFY_MEMORY_UPDATE (u8) 0x0E
620+#define ACPI_NOTIFY_DISCONNECT_RECOVER (u8) 0x0F
620621
621−#define ACPI_GENERIC_NOTIFY_MAX 0x0E
622+#define ACPI_GENERIC_NOTIFY_MAX 0x0F
622623 #define ACPI_SPECIFIC_NOTIFY_MAX 0x84
623624
624625 /*
@@ -885,15 +886,6 @@ typedef u8 acpi_adr_space_type; · 260 unmodified lines
885886 #define ACPI_ENABLE_EVENT 1
886887 #define ACPI_DISABLE_EVENT 0
887888
888−/* Sleep function dispatch */
889−
890−typedef acpi_status (*acpi_sleep_function) (u8 sleep_state);
891−
892−struct acpi_sleep_functions {
893− acpi_sleep_function legacy_function;
894− acpi_sleep_function extended_function;
895−};
896−
897889 /*
898890 * External ACPI object definition
899891 */
include/acpi/acuuid.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acuuid.h - ACPI-related UUID/GUID definitions
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/acpi/ghes.h+2−2
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313 * estatus: memory buffer for error status block, allocated during
1414 * HEST parsing.
1515 */
16−#define GHES_TO_CLEAR 0x0001
1716 #define GHES_EXITING 0x0002
1817
1918 struct ghes {
@@ -22,7 +21,6 @@ struct ghes { · 2 unmodified lines
2221 struct acpi_hest_generic_v2 *generic_v2;
2322 };
2423 struct acpi_hest_generic_status *estatus;
25− u64 buffer_paddr;
2624 unsigned long flags;
2725 union {
2826 struct list_head list;
@@ -52,6 +50,8 @@ enum { · 23 unmodified lines
5250 GHES_SEV_PANIC = 0x3,
5351 };
5452
53+int ghes_estatus_pool_init(int num_ghes);
54+
5555 /* From drivers/edac/ghes_edac.c */
5656
5757 #ifdef CONFIG_EDAC_GHES
include/acpi/platform/acenv.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acenv.h - Host and compiler configuration
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/acpi/platform/acenvex.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acenvex.h - Extra host and compiler configuration
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/acpi/platform/acgcc.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acgcc.h - GCC specific defines, etc.
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/acpi/platform/acgccex.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acgccex.h - Extra GCC specific defines, etc.
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/acpi/platform/acintel.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: acintel.h - VC specific defines, etc.
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/acpi/platform/aclinux.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: aclinux.h - OS specific defines, etc. for Linux
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/acpi/platform/aclinuxex.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Name: aclinuxex.h - Extra OS specific defines, etc. for Linux
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
include/linux/arm_sdei.h+9−0
@@ -11,7 +11,11 @@ enum sdei_conduit_types { · 10 unmodified lines
1111 CONDUIT_HVC,
1212 };
1313
14+#include <acpi/ghes.h>
15+
16+#ifdef CONFIG_ARM_SDE_INTERFACE
1417 #include <asm/sdei.h>
18+#endif
1519
1620 /* Arch code should override this to set the entry point from firmware... */
1721 #ifndef sdei_arch_get_entry_point
@@ -39,6 +43,11 @@ int sdei_event_unregister(u32 event_num); · 21 unmodified lines
3943 int sdei_event_enable(u32 event_num);
4044 int sdei_event_disable(u32 event_num);
4145
46+/* GHES register/unregister helpers */
47+int sdei_register_ghes(struct ghes *ghes, sdei_event_callback *normal_cb,
48+ sdei_event_callback *critical_cb);
49+int sdei_unregister_ghes(struct ghes *ghes);
50+
4251 #ifdef CONFIG_ARM_SDE_INTERFACE
4352 /* For use by arch code when CPU hotplug notifiers are not appropriate. */
4453 int sdei_mask_local_cpu(void);
include/linux/initrd.h+3−0
@@ -25,3 +25,6 @@ extern phys_addr_t phys_initrd_start; · 24 unmodified lines
2525 extern unsigned long phys_initrd_size;
2626
2727 extern unsigned int real_root_dev;
28+
29+extern char __initramfs_start[];
30+extern unsigned long __initramfs_size;
tools/power/acpi/common/cmfsize.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: cfsize - Common get file size function
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
tools/power/acpi/common/getopt.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: getopt
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
tools/power/acpi/os_specific/service_layers/oslinuxtbl.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: oslinuxtbl - Linux OSL for obtaining ACPI tables
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
tools/power/acpi/os_specific/service_layers/osunixdir.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: osunixdir - Unix directory access interfaces
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
tools/power/acpi/os_specific/service_layers/osunixmap.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: osunixmap - Unix OSL for file mappings
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
tools/power/acpi/os_specific/service_layers/osunixxf.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: osunixxf - UNIX OSL interfaces
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
tools/power/acpi/tools/acpidump/acpidump.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: acpidump.h - Include file for acpi_dump utility
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
tools/power/acpi/tools/acpidump/apdump.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: apdump - Dump routines for ACPI tables (acpidump)
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
tools/power/acpi/tools/acpidump/apfiles.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: apfiles - File-related functions for acpidump utility
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
tools/power/acpi/tools/acpidump/apmain.c+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Module Name: apmain - Main module for the acpidump utility
55 *
6− * Copyright (C) 2000 - 2018, Intel Corp.
6+ * Copyright (C) 2000 - 2019, Intel Corp.
77 *
88 *****************************************************************************/
99
virt/kvm/arm/mmu.c+2−2
@@ -27,10 +27,10 @@ · 26 unmodified lines
2727 #include <asm/kvm_arm.h>
2828 #include <asm/kvm_mmu.h>
2929 #include <asm/kvm_mmio.h>
30+#include <asm/kvm_ras.h>
3031 #include <asm/kvm_asm.h>
3132 #include <asm/kvm_emulate.h>
3233 #include <asm/virt.h>
33−#include <asm/system_misc.h>
3434
3535 #include "trace.h"
3636
@@ -1906,7 +1906,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu, struct kvm_run *run) · 1869 unmodified lines
19061906 * For RAS the host kernel may handle this abort.
19071907 * There is no need to pass the error into the guest.
19081908 */
1909− if (!handle_guest_sea(fault_ipa, kvm_vcpu_get_hsr(vcpu)))
1909+ if (!kvm_handle_guest_sea(fault_ipa, kvm_vcpu_get_hsr(vcpu)))
19101910 return 1;
19111911
19121912 if (unlikely(!is_iabt)) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t