aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-06 16:33:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-06 16:33:11 -0500
commitd276709ce6c90b9eceecdbd01a0c083ab04d3a52 (patch)
tree66e935a1bffa699463c8c45dbc15b3e85c82a1b3
parentef8006846a3a97d9d8bf49e63dba948d0d2dbbf0 (diff)
parent8167e00e9e35ad90f62e2e424c80c9bc4f3adf7b (diff)
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 ..
-rw-r--r--Documentation/acpi/initrd_table_override.txt4
-rw-r--r--MAINTAINERS1
-rw-r--r--arch/arm/include/asm/kvm_ras.h14
-rw-r--r--arch/arm/include/asm/system_misc.h5
-rw-r--r--arch/arm64/include/asm/acpi.h4
-rw-r--r--arch/arm64/include/asm/daifflags.h1
-rw-r--r--arch/arm64/include/asm/fixmap.h6
-rw-r--r--arch/arm64/include/asm/kvm_ras.h25
-rw-r--r--arch/arm64/include/asm/system_misc.h2
-rw-r--r--arch/arm64/kernel/acpi.c31
-rw-r--r--arch/arm64/mm/fault.c24
-rw-r--r--drivers/acpi/Kconfig10
-rw-r--r--drivers/acpi/acpi_dbg.c30
-rw-r--r--drivers/acpi/acpi_video.c20
-rw-r--r--drivers/acpi/acpica/acapps.h4
-rw-r--r--drivers/acpi/acpica/accommon.h2
-rw-r--r--drivers/acpi/acpica/acconvert.h2
-rw-r--r--drivers/acpi/acpica/acdebug.h5
-rw-r--r--drivers/acpi/acpica/acdispat.h2
-rw-r--r--drivers/acpi/acpica/acevents.h2
-rw-r--r--drivers/acpi/acpica/acglobal.h3
-rw-r--r--drivers/acpi/acpica/achware.h2
-rw-r--r--drivers/acpi/acpica/acinterp.h2
-rw-r--r--drivers/acpi/acpica/aclocal.h4
-rw-r--r--drivers/acpi/acpica/acmacros.h4
-rw-r--r--drivers/acpi/acpica/acnamesp.h2
-rw-r--r--drivers/acpi/acpica/acobject.h3
-rw-r--r--drivers/acpi/acpica/acopcode.h2
-rw-r--r--drivers/acpi/acpica/acparser.h2
-rw-r--r--drivers/acpi/acpica/acpredef.h17
-rw-r--r--drivers/acpi/acpica/acresrc.h2
-rw-r--r--drivers/acpi/acpica/acstruct.h2
-rw-r--r--drivers/acpi/acpica/actables.h2
-rw-r--r--drivers/acpi/acpica/acutils.h2
-rw-r--r--drivers/acpi/acpica/amlcode.h2
-rw-r--r--drivers/acpi/acpica/amlresrc.h2
-rw-r--r--drivers/acpi/acpica/dbdisply.c4
-rw-r--r--drivers/acpi/acpica/dbexec.c4
-rw-r--r--drivers/acpi/acpica/dbhistry.c2
-rw-r--r--drivers/acpi/acpica/dbnames.c2
-rw-r--r--drivers/acpi/acpica/dbobject.c2
-rw-r--r--drivers/acpi/acpica/dbtest.c164
-rw-r--r--drivers/acpi/acpica/dsargs.c2
-rw-r--r--drivers/acpi/acpica/dscontrol.c2
-rw-r--r--drivers/acpi/acpica/dsdebug.c2
-rw-r--r--drivers/acpi/acpica/dsfield.c9
-rw-r--r--drivers/acpi/acpica/dsinit.c2
-rw-r--r--drivers/acpi/acpica/dsmethod.c2
-rw-r--r--drivers/acpi/acpica/dsobject.c2
-rw-r--r--drivers/acpi/acpica/dsopcode.c28
-rw-r--r--drivers/acpi/acpica/dspkginit.c2
-rw-r--r--drivers/acpi/acpica/dswexec.c2
-rw-r--r--drivers/acpi/acpica/dswload.c2
-rw-r--r--drivers/acpi/acpica/dswload2.c4
-rw-r--r--drivers/acpi/acpica/dswscope.c2
-rw-r--r--drivers/acpi/acpica/dswstate.c2
-rw-r--r--drivers/acpi/acpica/evevent.c2
-rw-r--r--drivers/acpi/acpica/evglock.c2
-rw-r--r--drivers/acpi/acpica/evgpe.c4
-rw-r--r--drivers/acpi/acpica/evgpeblk.c2
-rw-r--r--drivers/acpi/acpica/evgpeinit.c2
-rw-r--r--drivers/acpi/acpica/evgpeutil.c2
-rw-r--r--drivers/acpi/acpica/evhandler.c2
-rw-r--r--drivers/acpi/acpica/evmisc.c2
-rw-r--r--drivers/acpi/acpica/evregion.c4
-rw-r--r--drivers/acpi/acpica/evrgnini.c21
-rw-r--r--drivers/acpi/acpica/evxface.c2
-rw-r--r--drivers/acpi/acpica/evxfevnt.c2
-rw-r--r--drivers/acpi/acpica/evxfgpe.c6
-rw-r--r--drivers/acpi/acpica/evxfregn.c2
-rw-r--r--drivers/acpi/acpica/exconcat.c2
-rw-r--r--drivers/acpi/acpica/exconfig.c2
-rw-r--r--drivers/acpi/acpica/exconvrt.c4
-rw-r--r--drivers/acpi/acpica/excreate.c2
-rw-r--r--drivers/acpi/acpica/exdebug.c2
-rw-r--r--drivers/acpi/acpica/exdump.c2
-rw-r--r--drivers/acpi/acpica/exfield.c71
-rw-r--r--drivers/acpi/acpica/exfldio.c2
-rw-r--r--drivers/acpi/acpica/exmisc.c2
-rw-r--r--drivers/acpi/acpica/exmutex.c2
-rw-r--r--drivers/acpi/acpica/exnames.c2
-rw-r--r--drivers/acpi/acpica/exoparg1.c2
-rw-r--r--drivers/acpi/acpica/exoparg2.c10
-rw-r--r--drivers/acpi/acpica/exoparg3.c2
-rw-r--r--drivers/acpi/acpica/exoparg6.c2
-rw-r--r--drivers/acpi/acpica/exprep.c2
-rw-r--r--drivers/acpi/acpica/exregion.c2
-rw-r--r--drivers/acpi/acpica/exresnte.c2
-rw-r--r--drivers/acpi/acpica/exresolv.c2
-rw-r--r--drivers/acpi/acpica/exresop.c2
-rw-r--r--drivers/acpi/acpica/exserial.c4
-rw-r--r--drivers/acpi/acpica/exstore.c2
-rw-r--r--drivers/acpi/acpica/exstoren.c2
-rw-r--r--drivers/acpi/acpica/exstorob.c2
-rw-r--r--drivers/acpi/acpica/exsystem.c2
-rw-r--r--drivers/acpi/acpica/extrace.c2
-rw-r--r--drivers/acpi/acpica/exutils.c4
-rw-r--r--drivers/acpi/acpica/hwacpi.c2
-rw-r--r--drivers/acpi/acpica/hwesleep.c2
-rw-r--r--drivers/acpi/acpica/hwgpe.c2
-rw-r--r--drivers/acpi/acpica/hwsleep.c2
-rw-r--r--drivers/acpi/acpica/hwtimer.c2
-rw-r--r--drivers/acpi/acpica/hwvalid.c2
-rw-r--r--drivers/acpi/acpica/hwxface.c2
-rw-r--r--drivers/acpi/acpica/hwxfsleep.c98
-rw-r--r--drivers/acpi/acpica/nsarguments.c2
-rw-r--r--drivers/acpi/acpica/nsconvert.c2
-rw-r--r--drivers/acpi/acpica/nsdump.c2
-rw-r--r--drivers/acpi/acpica/nsdumpdv.c2
-rw-r--r--drivers/acpi/acpica/nsinit.c2
-rw-r--r--drivers/acpi/acpica/nsload.c4
-rw-r--r--drivers/acpi/acpica/nsparse.c68
-rw-r--r--drivers/acpi/acpica/nspredef.c2
-rw-r--r--drivers/acpi/acpica/nsprepkg.c2
-rw-r--r--drivers/acpi/acpica/nsrepair.c2
-rw-r--r--drivers/acpi/acpica/nsrepair2.c2
-rw-r--r--drivers/acpi/acpica/nsutils.c4
-rw-r--r--drivers/acpi/acpica/nswalk.c2
-rw-r--r--drivers/acpi/acpica/nsxfname.c2
-rw-r--r--drivers/acpi/acpica/psargs.c2
-rw-r--r--drivers/acpi/acpica/psloop.c195
-rw-r--r--drivers/acpi/acpica/psobject.c2
-rw-r--r--drivers/acpi/acpica/psopcode.c2
-rw-r--r--drivers/acpi/acpica/psopinfo.c2
-rw-r--r--drivers/acpi/acpica/psparse.c10
-rw-r--r--drivers/acpi/acpica/psscope.c2
-rw-r--r--drivers/acpi/acpica/pstree.c2
-rw-r--r--drivers/acpi/acpica/psutils.c2
-rw-r--r--drivers/acpi/acpica/pswalk.c2
-rw-r--r--drivers/acpi/acpica/psxface.c2
-rw-r--r--drivers/acpi/acpica/rsdumpinfo.c14
-rw-r--r--drivers/acpi/acpica/rsirq.c8
-rw-r--r--drivers/acpi/acpica/rsserial.c10
-rw-r--r--drivers/acpi/acpica/tbdata.c2
-rw-r--r--drivers/acpi/acpica/tbfadt.c4
-rw-r--r--drivers/acpi/acpica/tbfind.c2
-rw-r--r--drivers/acpi/acpica/tbinstal.c2
-rw-r--r--drivers/acpi/acpica/tbprint.c2
-rw-r--r--drivers/acpi/acpica/tbutils.c2
-rw-r--r--drivers/acpi/acpica/tbxface.c6
-rw-r--r--drivers/acpi/acpica/tbxfload.c27
-rw-r--r--drivers/acpi/acpica/tbxfroot.c2
-rw-r--r--drivers/acpi/acpica/utaddress.c2
-rw-r--r--drivers/acpi/acpica/utalloc.c2
-rw-r--r--drivers/acpi/acpica/utascii.c2
-rw-r--r--drivers/acpi/acpica/utbuffer.c2
-rw-r--r--drivers/acpi/acpica/utcache.c2
-rw-r--r--drivers/acpi/acpica/utcopy.c2
-rw-r--r--drivers/acpi/acpica/utdebug.c2
-rw-r--r--drivers/acpi/acpica/utdecode.c20
-rw-r--r--drivers/acpi/acpica/utdelete.c4
-rw-r--r--drivers/acpi/acpica/uterror.c9
-rw-r--r--drivers/acpi/acpica/uteval.c2
-rw-r--r--drivers/acpi/acpica/utglobal.c2
-rw-r--r--drivers/acpi/acpica/uthex.c2
-rw-r--r--drivers/acpi/acpica/utids.c2
-rw-r--r--drivers/acpi/acpica/utinit.c2
-rw-r--r--drivers/acpi/acpica/utlock.c2
-rw-r--r--drivers/acpi/acpica/utobject.c2
-rw-r--r--drivers/acpi/acpica/utosi.c2
-rw-r--r--drivers/acpi/acpica/utpredef.c2
-rw-r--r--drivers/acpi/acpica/utprint.c2
-rw-r--r--drivers/acpi/acpica/uttrack.c14
-rw-r--r--drivers/acpi/acpica/utuuid.c2
-rw-r--r--drivers/acpi/acpica/utxface.c2
-rw-r--r--drivers/acpi/acpica/utxferror.c44
-rw-r--r--drivers/acpi/acpica/utxfinit.c2
-rw-r--r--drivers/acpi/apei/Kconfig12
-rw-r--r--drivers/acpi/apei/bert.c23
-rw-r--r--drivers/acpi/apei/einj.c93
-rw-r--r--drivers/acpi/apei/erst.c27
-rw-r--r--drivers/acpi/apei/ghes.c655
-rw-r--r--drivers/acpi/apei/hest.c16
-rw-r--r--drivers/acpi/bus.c14
-rw-r--r--drivers/acpi/custom_method.c6
-rw-r--r--drivers/acpi/dptf/Makefile2
-rw-r--r--drivers/acpi/dptf/int340x_thermal.c2
-rw-r--r--drivers/acpi/ec.c208
-rw-r--r--drivers/acpi/ec_sys.c36
-rw-r--r--drivers/acpi/internal.h4
-rw-r--r--drivers/acpi/irq.c4
-rw-r--r--drivers/acpi/pci_link.c8
-rw-r--r--drivers/acpi/pptt.c13
-rw-r--r--drivers/acpi/resource.c4
-rw-r--r--drivers/acpi/tables.c12
-rw-r--r--drivers/acpi/x86/utils.c5
-rw-r--r--drivers/firmware/arm_sdei.c68
-rw-r--r--drivers/firmware/efi/cper.c13
-rw-r--r--drivers/gpio/gpiolib-acpi.c2
-rw-r--r--drivers/platform/x86/sony-laptop.c8
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c14
-rw-r--r--include/acpi/acbuffer.h2
-rw-r--r--include/acpi/acconfig.h4
-rw-r--r--include/acpi/acexcep.h5
-rw-r--r--include/acpi/acnames.h2
-rw-r--r--include/acpi/acoutput.h4
-rw-r--r--include/acpi/acpi.h2
-rw-r--r--include/acpi/acpiosxf.h2
-rw-r--r--include/acpi/acpixf.h18
-rw-r--r--include/acpi/acrestyp.h16
-rw-r--r--include/acpi/actbl.h2
-rw-r--r--include/acpi/actbl1.h19
-rw-r--r--include/acpi/actbl2.h17
-rw-r--r--include/acpi/actbl3.h21
-rw-r--r--include/acpi/actypes.h14
-rw-r--r--include/acpi/acuuid.h2
-rw-r--r--include/acpi/ghes.h4
-rw-r--r--include/acpi/platform/acenv.h2
-rw-r--r--include/acpi/platform/acenvex.h2
-rw-r--r--include/acpi/platform/acgcc.h2
-rw-r--r--include/acpi/platform/acgccex.h2
-rw-r--r--include/acpi/platform/acintel.h2
-rw-r--r--include/acpi/platform/aclinux.h2
-rw-r--r--include/acpi/platform/aclinuxex.h2
-rw-r--r--include/linux/arm_sdei.h9
-rw-r--r--include/linux/initrd.h3
-rw-r--r--tools/power/acpi/common/cmfsize.c2
-rw-r--r--tools/power/acpi/common/getopt.c2
-rw-r--r--tools/power/acpi/os_specific/service_layers/oslinuxtbl.c2
-rw-r--r--tools/power/acpi/os_specific/service_layers/osunixdir.c2
-rw-r--r--tools/power/acpi/os_specific/service_layers/osunixmap.c2
-rw-r--r--tools/power/acpi/os_specific/service_layers/osunixxf.c2
-rw-r--r--tools/power/acpi/tools/acpidump/acpidump.h2
-rw-r--r--tools/power/acpi/tools/acpidump/apdump.c2
-rw-r--r--tools/power/acpi/tools/acpidump/apfiles.c2
-rw-r--r--tools/power/acpi/tools/acpidump/apmain.c2
-rw-r--r--virt/kvm/arm/mmu.c4
227 files changed, 1437 insertions, 1321 deletions
diff --git a/Documentation/acpi/initrd_table_override.txt b/Documentation/acpi/initrd_table_override.txt
index eb651a6aa285..30437a6db373 100644
--- a/Documentation/acpi/initrd_table_override.txt
+++ b/Documentation/acpi/initrd_table_override.txt
@@ -14,6 +14,10 @@ upgrade the ACPI execution environment that is defined by the ACPI tables
14via upgrading the ACPI tables provided by the BIOS with an instrumented, 14via upgrading the ACPI tables provided by the BIOS with an instrumented,
15modified, more recent version one, or installing brand new ACPI tables. 15modified, more recent version one, or installing brand new ACPI tables.
16 16
17When building initrd with kernel in a single image, option
18ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD should also be true for this
19feature to work.
20
17For a full list of ACPI tables that can be upgraded/installed, take a look 21For a full list of ACPI tables that can be upgraded/installed, take a look
18at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in 22at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in
19drivers/acpi/tables.c. 23drivers/acpi/tables.c.
diff --git a/MAINTAINERS b/MAINTAINERS
index a3ccc414a1e7..a419acaa01c5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -331,6 +331,7 @@ ACPI APEI
331M: "Rafael J. Wysocki" <rjw@rjwysocki.net> 331M: "Rafael J. Wysocki" <rjw@rjwysocki.net>
332M: Len Brown <lenb@kernel.org> 332M: Len Brown <lenb@kernel.org>
333L: linux-acpi@vger.kernel.org 333L: linux-acpi@vger.kernel.org
334R: James Morse <james.morse@arm.com>
334R: Tony Luck <tony.luck@intel.com> 335R: Tony Luck <tony.luck@intel.com>
335R: Borislav Petkov <bp@alien8.de> 336R: Borislav Petkov <bp@alien8.de>
336F: drivers/acpi/apei/ 337F: drivers/acpi/apei/
diff --git a/arch/arm/include/asm/kvm_ras.h b/arch/arm/include/asm/kvm_ras.h
new file mode 100644
index 000000000000..e9577292dfe4
--- /dev/null
+++ b/arch/arm/include/asm/kvm_ras.h
@@ -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
9static 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__ */
diff --git a/arch/arm/include/asm/system_misc.h b/arch/arm/include/asm/system_misc.h
index 8e76db83c498..66f6a3ae68d2 100644
--- a/arch/arm/include/asm/system_misc.h
+++ b/arch/arm/include/asm/system_misc.h
@@ -38,11 +38,6 @@ static inline void harden_branch_predictor(void)
38 38
39extern unsigned int user_debug; 39extern unsigned int user_debug;
40 40
41static inline int handle_guest_sea(phys_addr_t addr, unsigned int esr)
42{
43 return -1;
44}
45
46#endif /* !__ASSEMBLY__ */ 41#endif /* !__ASSEMBLY__ */
47 42
48#endif /* __ASM_ARM_SYSTEM_MISC_H */ 43#endif /* __ASM_ARM_SYSTEM_MISC_H */
diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h
index 2def77ec14be..7628efbe6c12 100644
--- a/arch/arm64/include/asm/acpi.h
+++ b/arch/arm64/include/asm/acpi.h
@@ -18,6 +18,7 @@
18 18
19#include <asm/cputype.h> 19#include <asm/cputype.h>
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/ptrace.h>
21#include <asm/smp_plat.h> 22#include <asm/smp_plat.h>
22#include <asm/tlbflush.h> 23#include <asm/tlbflush.h>
23 24
@@ -110,9 +111,10 @@ static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
110 111
111static inline void arch_fix_phys_package_id(int num, u32 slot) { } 112static inline void arch_fix_phys_package_id(int num, u32 slot) { }
112void __init acpi_init_cpus(void); 113void __init acpi_init_cpus(void);
113 114int apei_claim_sea(struct pt_regs *regs);
114#else 115#else
115static inline void acpi_init_cpus(void) { } 116static inline void acpi_init_cpus(void) { }
117static inline int apei_claim_sea(struct pt_regs *regs) { return -ENOENT; }
116#endif /* CONFIG_ACPI */ 118#endif /* CONFIG_ACPI */
117 119
118#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL 120#ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
diff --git a/arch/arm64/include/asm/daifflags.h b/arch/arm64/include/asm/daifflags.h
index 8d91f2233135..fa90779fc752 100644
--- a/arch/arm64/include/asm/daifflags.h
+++ b/arch/arm64/include/asm/daifflags.h
@@ -20,6 +20,7 @@
20 20
21#define DAIF_PROCCTX 0 21#define DAIF_PROCCTX 0
22#define DAIF_PROCCTX_NOIRQ PSR_I_BIT 22#define DAIF_PROCCTX_NOIRQ PSR_I_BIT
23#define DAIF_ERRCTX (PSR_I_BIT | PSR_A_BIT)
23 24
24/* mask/save/unmask/restore all exceptions, including interrupts. */ 25/* mask/save/unmask/restore all exceptions, including interrupts. */
25static inline void local_daif_mask(void) 26static inline void local_daif_mask(void)
diff --git a/arch/arm64/include/asm/fixmap.h b/arch/arm64/include/asm/fixmap.h
index ec1e6d6fa14c..f987b8a8f325 100644
--- a/arch/arm64/include/asm/fixmap.h
+++ b/arch/arm64/include/asm/fixmap.h
@@ -55,7 +55,11 @@ enum fixed_addresses {
55#ifdef CONFIG_ACPI_APEI_GHES 55#ifdef CONFIG_ACPI_APEI_GHES
56 /* Used for GHES mapping from assorted contexts */ 56 /* Used for GHES mapping from assorted contexts */
57 FIX_APEI_GHES_IRQ, 57 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
59#endif /* CONFIG_ACPI_APEI_GHES */ 63#endif /* CONFIG_ACPI_APEI_GHES */
60 64
61#ifdef CONFIG_UNMAP_KERNEL_AT_EL0 65#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
diff --git a/arch/arm64/include/asm/kvm_ras.h b/arch/arm64/include/asm/kvm_ras.h
new file mode 100644
index 000000000000..8ac6ee77437c
--- /dev/null
+++ b/arch/arm64/include/asm/kvm_ras.h
@@ -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 */
17static 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__ */
diff --git a/arch/arm64/include/asm/system_misc.h b/arch/arm64/include/asm/system_misc.h
index 0e2a0ecaf484..32693f34f431 100644
--- a/arch/arm64/include/asm/system_misc.h
+++ b/arch/arm64/include/asm/system_misc.h
@@ -46,8 +46,6 @@ extern void __show_regs(struct pt_regs *);
46 46
47extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd); 47extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
48 48
49int handle_guest_sea(phys_addr_t addr, unsigned int esr);
50
51#endif /* __ASSEMBLY__ */ 49#endif /* __ASSEMBLY__ */
52 50
53#endif /* __ASM_SYSTEM_MISC_H */ 51#endif /* __ASM_SYSTEM_MISC_H */
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 44e3c351e1ea..803f0494dd3e 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -27,8 +27,10 @@
27#include <linux/smp.h> 27#include <linux/smp.h>
28#include <linux/serial_core.h> 28#include <linux/serial_core.h>
29 29
30#include <acpi/ghes.h>
30#include <asm/cputype.h> 31#include <asm/cputype.h>
31#include <asm/cpu_ops.h> 32#include <asm/cpu_ops.h>
33#include <asm/daifflags.h>
32#include <asm/pgtable.h> 34#include <asm/pgtable.h>
33#include <asm/smp_plat.h> 35#include <asm/smp_plat.h>
34 36
@@ -256,3 +258,32 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)
256 return __pgprot(PROT_NORMAL_NC); 258 return __pgprot(PROT_NORMAL_NC);
257 return __pgprot(PROT_DEVICE_nGnRnE); 259 return __pgprot(PROT_DEVICE_nGnRnE);
258} 260}
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 */
268int 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}
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index efb7b2cbead5..e1c84c2e1cab 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -18,6 +18,7 @@
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */ 19 */
20 20
21#include <linux/acpi.h>
21#include <linux/extable.h> 22#include <linux/extable.h>
22#include <linux/signal.h> 23#include <linux/signal.h>
23#include <linux/mm.h> 24#include <linux/mm.h>
@@ -33,6 +34,7 @@
33#include <linux/preempt.h> 34#include <linux/preempt.h>
34#include <linux/hugetlb.h> 35#include <linux/hugetlb.h>
35 36
37#include <asm/acpi.h>
36#include <asm/bug.h> 38#include <asm/bug.h>
37#include <asm/cmpxchg.h> 39#include <asm/cmpxchg.h>
38#include <asm/cpufeature.h> 40#include <asm/cpufeature.h>
@@ -47,8 +49,6 @@
47#include <asm/tlbflush.h> 49#include <asm/tlbflush.h>
48#include <asm/traps.h> 50#include <asm/traps.h>
49 51
50#include <acpi/ghes.h>
51
52struct fault_info { 52struct fault_info {
53 int (*fn)(unsigned long addr, unsigned int esr, 53 int (*fn)(unsigned long addr, unsigned int esr,
54 struct pt_regs *regs); 54 struct pt_regs *regs);
@@ -643,19 +643,10 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
643 inf = esr_to_fault_info(esr); 643 inf = esr_to_fault_info(esr);
644 644
645 /* 645 /*
646 * Synchronous aborts may interrupt code which had interrupts masked. 646 * Return value ignored as we rely on signal merging.
647 * Before calling out into the wider kernel tell the interested 647 * Future patches will make this more robust.
648 * subsystems.
649 */ 648 */
650 if (IS_ENABLED(CONFIG_ACPI_APEI_SEA)) { 649 apei_claim_sea(regs);
651 if (interrupts_enabled(regs))
652 nmi_enter();
653
654 ghes_notify_sea();
655
656 if (interrupts_enabled(regs))
657 nmi_exit();
658 }
659 650
660 if (esr & ESR_ELx_FnV) 651 if (esr & ESR_ELx_FnV)
661 siaddr = NULL; 652 siaddr = NULL;
@@ -733,11 +724,6 @@ static const struct fault_info fault_info[] = {
733 { do_bad, SIGKILL, SI_KERNEL, "unknown 63" }, 724 { do_bad, SIGKILL, SI_KERNEL, "unknown 63" },
734}; 725};
735 726
736int handle_guest_sea(phys_addr_t addr, unsigned int esr)
737{
738 return ghes_notify_sea();
739}
740
741asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr, 727asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
742 struct pt_regs *regs) 728 struct pt_regs *regs)
743{ 729{
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 90ff0a47c12e..4e015c77e48e 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -357,6 +357,16 @@ config ACPI_TABLE_UPGRADE
357 initrd, therefore it's safe to say Y. 357 initrd, therefore it's safe to say Y.
358 See Documentation/acpi/initrd_table_override.txt for details 358 See Documentation/acpi/initrd_table_override.txt for details
359 359
360config 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
360config ACPI_DEBUG 370config ACPI_DEBUG
361 bool "Debug Statements" 371 bool "Debug Statements"
362 help 372 help
diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c
index a2dcd62ea32f..4a434c23a196 100644
--- a/drivers/acpi/acpi_dbg.c
+++ b/drivers/acpi/acpi_dbg.c
@@ -750,48 +750,36 @@ static const struct acpi_debugger_ops acpi_aml_debugger = {
750 750
751int __init acpi_aml_init(void) 751int __init acpi_aml_init(void)
752{ 752{
753 int ret = 0; 753 int ret;
754
755 if (!acpi_debugfs_dir) {
756 ret = -ENOENT;
757 goto err_exit;
758 }
759 754
760 /* Initialize AML IO interface */ 755 /* Initialize AML IO interface */
761 mutex_init(&acpi_aml_io.lock); 756 mutex_init(&acpi_aml_io.lock);
762 init_waitqueue_head(&acpi_aml_io.wait); 757 init_waitqueue_head(&acpi_aml_io.wait);
763 acpi_aml_io.out_crc.buf = acpi_aml_io.out_buf; 758 acpi_aml_io.out_crc.buf = acpi_aml_io.out_buf;
764 acpi_aml_io.in_crc.buf = acpi_aml_io.in_buf; 759 acpi_aml_io.in_crc.buf = acpi_aml_io.in_buf;
760
765 acpi_aml_dentry = debugfs_create_file("acpidbg", 761 acpi_aml_dentry = debugfs_create_file("acpidbg",
766 S_IFREG | S_IRUGO | S_IWUSR, 762 S_IFREG | S_IRUGO | S_IWUSR,
767 acpi_debugfs_dir, NULL, 763 acpi_debugfs_dir, NULL,
768 &acpi_aml_operations); 764 &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;
777 765
778err_fs: 766 ret = acpi_register_debugger(THIS_MODULE, &acpi_aml_debugger);
779 if (ret) { 767 if (ret) {
780 debugfs_remove(acpi_aml_dentry); 768 debugfs_remove(acpi_aml_dentry);
781 acpi_aml_dentry = NULL; 769 acpi_aml_dentry = NULL;
770 return ret;
782 } 771 }
783err_exit: 772
784 return ret; 773 acpi_aml_initialized = true;
774 return 0;
785} 775}
786 776
787void __exit acpi_aml_exit(void) 777void __exit acpi_aml_exit(void)
788{ 778{
789 if (acpi_aml_initialized) { 779 if (acpi_aml_initialized) {
790 acpi_unregister_debugger(&acpi_aml_debugger); 780 acpi_unregister_debugger(&acpi_aml_debugger);
791 if (acpi_aml_dentry) { 781 debugfs_remove(acpi_aml_dentry);
792 debugfs_remove(acpi_aml_dentry); 782 acpi_aml_dentry = NULL;
793 acpi_aml_dentry = NULL;
794 }
795 acpi_aml_initialized = false; 783 acpi_aml_initialized = false;
796 } 784 }
797} 785}
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index f0b52266b3ac..d73afb562ad9 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -2124,21 +2124,29 @@ static int __init intel_opregion_present(void)
2124 return opregion; 2124 return opregion;
2125} 2125}
2126 2126
2127/* Check if the chassis-type indicates there is no builtin LCD panel */
2127static bool dmi_is_desktop(void) 2128static bool dmi_is_desktop(void)
2128{ 2129{
2129 const char *chassis_type; 2130 const char *chassis_type;
2131 unsigned long type;
2130 2132
2131 chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE); 2133 chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
2132 if (!chassis_type) 2134 if (!chassis_type)
2133 return false; 2135 return false;
2134 2136
2135 if (!strcmp(chassis_type, "3") || /* 3: Desktop */ 2137 if (kstrtoul(chassis_type, 10, &type) != 0)
2136 !strcmp(chassis_type, "4") || /* 4: Low Profile Desktop */ 2138 return false;
2137 !strcmp(chassis_type, "5") || /* 5: Pizza Box */ 2139
2138 !strcmp(chassis_type, "6") || /* 6: Mini Tower */ 2140 switch (type) {
2139 !strcmp(chassis_type, "7") || /* 7: Tower */ 2141 case 0x03: /* Desktop */
2140 !strcmp(chassis_type, "11")) /* 11: Main Server Chassis */ 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 */
2141 return true; 2148 return true;
2149 }
2142 2150
2143 return false; 2151 return false;
2144} 2152}
diff --git a/drivers/acpi/acpica/acapps.h b/drivers/acpi/acpica/acapps.h
index 5a9c2febc0fb..863ade9add6d 100644
--- a/drivers/acpi/acpica/acapps.h
+++ b/drivers/acpi/acpica/acapps.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: acapps - common include for ACPI applications/tools 4 * Module Name: acapps - common include for ACPI applications/tools
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -17,7 +17,7 @@
17/* Common info for tool signons */ 17/* Common info for tool signons */
18 18
19#define ACPICA_NAME "Intel ACPI Component Architecture" 19#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"
21 21
22#if ACPI_MACHINE_WIDTH == 64 22#if ACPI_MACHINE_WIDTH == 64
23#define ACPI_WIDTH " (64-bit version)" 23#define ACPI_WIDTH " (64-bit version)"
diff --git a/drivers/acpi/acpica/accommon.h b/drivers/acpi/acpica/accommon.h
index 8bc935977d8e..54f81eac7ec9 100644
--- a/drivers/acpi/acpica/accommon.h
+++ b/drivers/acpi/acpica/accommon.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: accommon.h - Common include files for generation of ACPICA source 4 * Name: accommon.h - Common include files for generation of ACPICA source
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/acconvert.h b/drivers/acpi/acpica/acconvert.h
index 4ebe18826646..d5478cd4a857 100644
--- a/drivers/acpi/acpica/acconvert.h
+++ b/drivers/acpi/acpica/acconvert.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: acapps - common include for ACPI applications/tools 4 * Module Name: acapps - common include for ACPI applications/tools
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index 57d9495e5933..32f2e38c7570 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acdebug.h - ACPI/AML debugger 4 * Name: acdebug.h - ACPI/AML debugger
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -16,7 +16,8 @@
16#include "acdisasm.h" 16#include "acdisasm.h"
17#endif 17#endif
18 18
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)"
20 21
21struct acpi_db_command_info { 22struct acpi_db_command_info {
22 const char *name; /* Command Name */ 23 const char *name; /* Command Name */
diff --git a/drivers/acpi/acpica/acdispat.h b/drivers/acpi/acpica/acdispat.h
index e577f3a40e6a..82f81501566b 100644
--- a/drivers/acpi/acpica/acdispat.h
+++ b/drivers/acpi/acpica/acdispat.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acdispat.h - dispatcher (parser to interpreter interface) 4 * Name: acdispat.h - dispatcher (parser to interpreter interface)
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index b412aa909907..831660179662 100644
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acevents.h - Event subcomponent prototypes and defines 4 * Name: acevents.h - Event subcomponent prototypes and defines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 87d6eb01beaf..d056a1845613 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acglobal.h - Declarations for global variables 4 * Name: acglobal.h - Declarations for global variables
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -164,6 +164,7 @@ ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_global_list);
164ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_ns_node_list); 164ACPI_GLOBAL(struct acpi_memory_list *, acpi_gbl_ns_node_list);
165ACPI_GLOBAL(u8, acpi_gbl_display_final_mem_stats); 165ACPI_GLOBAL(u8, acpi_gbl_display_final_mem_stats);
166ACPI_GLOBAL(u8, acpi_gbl_disable_mem_tracking); 166ACPI_GLOBAL(u8, acpi_gbl_disable_mem_tracking);
167ACPI_GLOBAL(u8, acpi_gbl_verbose_leak_dump);
167#endif 168#endif
168 169
169/***************************************************************************** 170/*****************************************************************************
diff --git a/drivers/acpi/acpica/achware.h b/drivers/acpi/acpica/achware.h
index ef99e2fc37f8..bcf8f7501db7 100644
--- a/drivers/acpi/acpica/achware.h
+++ b/drivers/acpi/acpica/achware.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: achware.h -- hardware specific interfaces 4 * Name: achware.h -- hardware specific interfaces
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/acinterp.h b/drivers/acpi/acpica/acinterp.h
index c5b2be0b6613..20706adbc148 100644
--- a/drivers/acpi/acpica/acinterp.h
+++ b/drivers/acpi/acpica/acinterp.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acinterp.h - Interpreter subcomponent prototypes and defines 4 * Name: acinterp.h - Interpreter subcomponent prototypes and defines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 99b0da899109..a2dfbf6b004e 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: aclocal.h - Internal data types used across the ACPI subsystem 4 * Name: aclocal.h - Internal data types used across the ACPI subsystem
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -802,7 +802,7 @@ struct acpi_comment_addr_node {
802 802
803/* 803/*
804 * File node - used for "Include" operator file stack and 804 * File node - used for "Include" operator file stack and
805 * depdendency tree for the -ca option 805 * dependency tree for the -ca option
806 */ 806 */
807struct acpi_file_node { 807struct acpi_file_node {
808 void *file; 808 void *file;
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index de52cd6e868a..283614e82a20 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acmacros.h - C macros for the entire subsystem. 4 * Name: acmacros.h - C macros for the entire subsystem.
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -462,7 +462,7 @@
462#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) 462#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7'))
463 463
464/* 464/*
465 * Macors used for the ASL-/ASL+ converter utility 465 * Macros used for the ASL-/ASL+ converter utility
466 */ 466 */
467#ifdef ACPI_ASL_COMPILER 467#ifdef ACPI_ASL_COMPILER
468 468
diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h
index 9bd25f36c608..39812fc4386a 100644
--- a/drivers/acpi/acpica/acnamesp.h
+++ b/drivers/acpi/acpica/acnamesp.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acnamesp.h - Namespace subcomponent prototypes and defines 4 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h
index ac992b6ebce9..b2ef703d7df8 100644
--- a/drivers/acpi/acpica/acobject.h
+++ b/drivers/acpi/acpica/acobject.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acobject.h - Definition of union acpi_operand_object (Internal object only) 4 * Name: acobject.h - Definition of union acpi_operand_object (Internal object only)
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -239,6 +239,7 @@ struct acpi_object_region_field {
239 union acpi_operand_object *region_obj; /* Containing op_region object */ 239 union acpi_operand_object *region_obj; /* Containing op_region object */
240 u8 *resource_buffer; /* resource_template for serial regions/fields */ 240 u8 *resource_buffer; /* resource_template for serial regions/fields */
241 u16 pin_number_index; /* Index relative to previous Connection/Template */ 241 u16 pin_number_index; /* Index relative to previous Connection/Template */
242 u8 *internal_pcc_buffer; /* Internal buffer for fields associated with PCC */
242}; 243};
243 244
244struct acpi_object_bank_field { 245struct acpi_object_bank_field {
diff --git a/drivers/acpi/acpica/acopcode.h b/drivers/acpi/acpica/acopcode.h
index 818eba413614..9d78134428e3 100644
--- a/drivers/acpi/acpica/acopcode.h
+++ b/drivers/acpi/acpica/acopcode.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acopcode.h - AML opcode information for the AML parser and interpreter 4 * Name: acopcode.h - AML opcode information for the AML parser and interpreter
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/acparser.h b/drivers/acpi/acpica/acparser.h
index ab48196ae55e..6e32c97cba6c 100644
--- a/drivers/acpi/acpica/acparser.h
+++ b/drivers/acpi/acpica/acparser.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: acparser.h - AML Parser subcomponent prototypes and defines 4 * Module Name: acparser.h - AML Parser subcomponent prototypes and defines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index d31bb04facb6..387163b962a7 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acpredef - Information table for ACPI predefined methods and objects 4 * Name: acpredef - Information table for ACPI predefined methods and objects
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -631,6 +631,21 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
631 {{"_MTL", METHOD_0ARGS, /* ACPI 6.0 */ 631 {{"_MTL", METHOD_0ARGS, /* ACPI 6.0 */
632 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, 632 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
633 633
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
634 {{"_NTT", METHOD_0ARGS, 649 {{"_NTT", METHOD_0ARGS,
635 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, 650 METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
636 651
diff --git a/drivers/acpi/acpica/acresrc.h b/drivers/acpi/acpica/acresrc.h
index 59ae8b1a6e40..422cd8f2b92e 100644
--- a/drivers/acpi/acpica/acresrc.h
+++ b/drivers/acpi/acpica/acresrc.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acresrc.h - Resource Manager function prototypes 4 * Name: acresrc.h - Resource Manager function prototypes
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/acstruct.h b/drivers/acpi/acpica/acstruct.h
index 14be32961b4c..8a4e6b4aaf2c 100644
--- a/drivers/acpi/acpica/acstruct.h
+++ b/drivers/acpi/acpica/acstruct.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acstruct.h - Internal structs 4 * Name: acstruct.h - Internal structs
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h
index 12fac33ce77e..dfbf1dbd4033 100644
--- a/drivers/acpi/acpica/actables.h
+++ b/drivers/acpi/acpica/actables.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: actables.h - ACPI table management 4 * Name: actables.h - ACPI table management
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index 3374d41582b5..9022537567e9 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures 4 * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h
index 6c05355447c1..49e412edd7c6 100644
--- a/drivers/acpi/acpica/amlcode.h
+++ b/drivers/acpi/acpica/amlcode.h
@@ -5,7 +5,7 @@
5 * Declarations and definitions contained herein are derived 5 * Declarations and definitions contained herein are derived
6 * directly from the ACPI specification. 6 * directly from the ACPI specification.
7 * 7 *
8 * Copyright (C) 2000 - 2018, Intel Corp. 8 * Copyright (C) 2000 - 2019, Intel Corp.
9 * 9 *
10 *****************************************************************************/ 10 *****************************************************************************/
11 11
diff --git a/drivers/acpi/acpica/amlresrc.h b/drivers/acpi/acpica/amlresrc.h
index cdb590176e9d..7c3bd4ab60fc 100644
--- a/drivers/acpi/acpica/amlresrc.h
+++ b/drivers/acpi/acpica/amlresrc.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: amlresrc.h - AML resource descriptors 4 * Module Name: amlresrc.h - AML resource descriptors
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/dbdisply.c b/drivers/acpi/acpica/dbdisply.c
index 9fcb8ec64681..30ab62b0fec8 100644
--- a/drivers/acpi/acpica/dbdisply.c
+++ b/drivers/acpi/acpica/dbdisply.c
@@ -237,7 +237,7 @@ void acpi_db_decode_and_display_object(char *target, char *output_type)
237 237
238 default: 238 default:
239 239
240 /* Is not a recognizeable object */ 240 /* Is not a recognizable object */
241 241
242 acpi_os_printf 242 acpi_os_printf
243 ("Not a known ACPI internal object, descriptor type %2.2X\n", 243 ("Not a known ACPI internal object, descriptor type %2.2X\n",
@@ -647,7 +647,7 @@ void acpi_db_display_object_type(char *object_arg)
647 * 647 *
648 * DESCRIPTION: Display the result of an AML opcode 648 * DESCRIPTION: Display the result of an AML opcode
649 * 649 *
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.
651 * However, this output may be useful in other contexts and could be enabled 651 * However, this output may be useful in other contexts and could be enabled
652 * to do so if needed. 652 * to do so if needed.
653 * 653 *
diff --git a/drivers/acpi/acpica/dbexec.c b/drivers/acpi/acpica/dbexec.c
index 6abb6b834d97..bb43305cb215 100644
--- a/drivers/acpi/acpica/dbexec.c
+++ b/drivers/acpi/acpica/dbexec.c
@@ -160,12 +160,12 @@ acpi_db_execute_method(struct acpi_db_method_info *info,
160 } 160 }
161 161
162 ACPI_EXCEPTION((AE_INFO, status, 162 ACPI_EXCEPTION((AE_INFO, status,
163 "while executing %s from debugger", 163 "while executing %s from AML Debugger",
164 info->pathname)); 164 info->pathname));
165 165
166 if (status == AE_BUFFER_OVERFLOW) { 166 if (status == AE_BUFFER_OVERFLOW) {
167 ACPI_ERROR((AE_INFO, 167 ACPI_ERROR((AE_INFO,
168 "Possible overflow of internal debugger " 168 "Possible buffer overflow within AML Debugger "
169 "buffer (size 0x%X needed 0x%X)", 169 "buffer (size 0x%X needed 0x%X)",
170 ACPI_DEBUG_BUFFER_SIZE, 170 ACPI_DEBUG_BUFFER_SIZE,
171 (u32)return_obj->length)); 171 (u32)return_obj->length));
diff --git a/drivers/acpi/acpica/dbhistry.c b/drivers/acpi/acpica/dbhistry.c
index b0b9a26c7db5..7809bd94a18d 100644
--- a/drivers/acpi/acpica/dbhistry.c
+++ b/drivers/acpi/acpica/dbhistry.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dbhistry - debugger HISTORY command 4 * Module Name: dbhistry - debugger HISTORY command
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/dbnames.c b/drivers/acpi/acpica/dbnames.c
index 992bd7b92540..004d34d9369b 100644
--- a/drivers/acpi/acpica/dbnames.c
+++ b/drivers/acpi/acpica/dbnames.c
@@ -904,7 +904,7 @@ acpi_db_bus_walk(acpi_handle obj_handle,
904 * 904 *
905 * RETURN: None 905 * RETURN: None
906 * 906 *
907 * DESCRIPTION: Display info about system busses. 907 * DESCRIPTION: Display info about system buses.
908 * 908 *
909 ******************************************************************************/ 909 ******************************************************************************/
910 910
diff --git a/drivers/acpi/acpica/dbobject.c b/drivers/acpi/acpica/dbobject.c
index a1c76bf21122..d220168dca01 100644
--- a/drivers/acpi/acpica/dbobject.c
+++ b/drivers/acpi/acpica/dbobject.c
@@ -243,7 +243,7 @@ acpi_db_display_internal_object(union acpi_operand_object *obj_desc,
243 acpi_os_printf("[%s] ", 243 acpi_os_printf("[%s] ",
244 acpi_ut_get_reference_name(obj_desc)); 244 acpi_ut_get_reference_name(obj_desc));
245 245
246 /* Decode the refererence */ 246 /* Decode the reference */
247 247
248 switch (obj_desc->reference.class) { 248 switch (obj_desc->reference.class) {
249 case ACPI_REFCLASS_LOCAL: 249 case ACPI_REFCLASS_LOCAL:
diff --git a/drivers/acpi/acpica/dbtest.c b/drivers/acpi/acpica/dbtest.c
index 8a5462439a97..6db44a5ac786 100644
--- a/drivers/acpi/acpica/dbtest.c
+++ b/drivers/acpi/acpica/dbtest.c
@@ -10,6 +10,7 @@
10#include "acdebug.h" 10#include "acdebug.h"
11#include "acnamesp.h" 11#include "acnamesp.h"
12#include "acpredef.h" 12#include "acpredef.h"
13#include "acinterp.h"
13 14
14#define _COMPONENT ACPI_CA_DEBUGGER 15#define _COMPONENT ACPI_CA_DEBUGGER
15ACPI_MODULE_NAME("dbtest") 16ACPI_MODULE_NAME("dbtest")
@@ -33,6 +34,9 @@ acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length);
33static acpi_status acpi_db_test_package_type(struct acpi_namespace_node *node); 34static acpi_status acpi_db_test_package_type(struct acpi_namespace_node *node);
34 35
35static acpi_status 36static acpi_status
37acpi_db_test_field_unit_type(union acpi_operand_object *obj_desc);
38
39static acpi_status
36acpi_db_read_from_object(struct acpi_namespace_node *node, 40acpi_db_read_from_object(struct acpi_namespace_node *node,
37 acpi_object_type expected_type, 41 acpi_object_type expected_type,
38 union acpi_object **value); 42 union acpi_object **value);
@@ -74,7 +78,7 @@ static struct acpi_db_argument_info acpi_db_test_types[] = {
74static acpi_handle read_handle = NULL; 78static acpi_handle read_handle = NULL;
75static acpi_handle write_handle = NULL; 79static acpi_handle write_handle = NULL;
76 80
77/* ASL Definitions of the debugger read/write control methods */ 81/* ASL Definitions of the debugger read/write control methods. AML below. */
78 82
79#if 0 83#if 0
80definition_block("ssdt.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001) 84definition_block("ssdt.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001)
@@ -227,10 +231,8 @@ static void acpi_db_test_all_objects(void)
227 * RETURN: Status 231 * RETURN: Status
228 * 232 *
229 * DESCRIPTION: Test one namespace object. Supported types are Integer, 233 * DESCRIPTION: Test one namespace object. Supported types are Integer,
230 * String, Buffer, buffer_field, and field_unit. All other object 234 * String, Buffer, Package, buffer_field, and field_unit.
231 * types are simply ignored. 235 * All other object types are simply ignored.
232 *
233 * Note: Support for Packages is not implemented.
234 * 236 *
235 ******************************************************************************/ 237 ******************************************************************************/
236 238
@@ -240,7 +242,6 @@ acpi_db_test_one_object(acpi_handle obj_handle,
240{ 242{
241 struct acpi_namespace_node *node; 243 struct acpi_namespace_node *node;
242 union acpi_operand_object *obj_desc; 244 union acpi_operand_object *obj_desc;
243 union acpi_operand_object *region_obj;
244 acpi_object_type local_type; 245 acpi_object_type local_type;
245 u32 bit_length = 0; 246 u32 bit_length = 0;
246 u32 byte_length = 0; 247 u32 byte_length = 0;
@@ -281,18 +282,21 @@ acpi_db_test_one_object(acpi_handle obj_handle,
281 break; 282 break;
282 283
283 case ACPI_TYPE_FIELD_UNIT: 284 case ACPI_TYPE_FIELD_UNIT:
284 case ACPI_TYPE_BUFFER_FIELD:
285 case ACPI_TYPE_LOCAL_REGION_FIELD: 285 case ACPI_TYPE_LOCAL_REGION_FIELD:
286 case ACPI_TYPE_LOCAL_INDEX_FIELD: 286 case ACPI_TYPE_LOCAL_INDEX_FIELD:
287 case ACPI_TYPE_LOCAL_BANK_FIELD: 287 case ACPI_TYPE_LOCAL_BANK_FIELD:
288 288
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 */
289 local_type = ACPI_TYPE_INTEGER; 298 local_type = ACPI_TYPE_INTEGER;
290 if (obj_desc) { 299 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 */
296 bit_length = obj_desc->common_field.bit_length; 300 bit_length = obj_desc->common_field.bit_length;
297 byte_length = ACPI_ROUND_BITS_UP_TO_BYTES(bit_length); 301 byte_length = ACPI_ROUND_BITS_UP_TO_BYTES(bit_length);
298 if (bit_length > acpi_gbl_integer_bit_width) { 302 if (bit_length > acpi_gbl_integer_bit_width) {
@@ -303,7 +307,7 @@ acpi_db_test_one_object(acpi_handle obj_handle,
303 307
304 default: 308 default:
305 309
306 /* Ignore all other types */ 310 /* Ignore all non-data types - Methods, Devices, Scopes, etc. */
307 311
308 return (AE_OK); 312 return (AE_OK);
309 } 313 }
@@ -314,40 +318,10 @@ acpi_db_test_one_object(acpi_handle obj_handle,
314 acpi_ut_get_type_name(node->type), node->name.ascii); 318 acpi_ut_get_type_name(node->type), node->name.ascii);
315 319
316 if (!obj_desc) { 320 if (!obj_desc) {
317 acpi_os_printf(" Ignoring, no attached object\n"); 321 acpi_os_printf(" No attached sub-object, ignoring\n");
318 return (AE_OK); 322 return (AE_OK);
319 } 323 }
320 324
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
351 /* At this point, we have resolved the object to one of the major types */ 325 /* At this point, we have resolved the object to one of the major types */
352 326
353 switch (local_type) { 327 switch (local_type) {
@@ -371,6 +345,11 @@ acpi_db_test_one_object(acpi_handle obj_handle,
371 status = acpi_db_test_package_type(node); 345 status = acpi_db_test_package_type(node);
372 break; 346 break;
373 347
348 case ACPI_TYPE_FIELD_UNIT:
349
350 status = acpi_db_test_field_unit_type(obj_desc);
351 break;
352
374 default: 353 default:
375 354
376 acpi_os_printf(" Ignoring, type not implemented (%2.2X)", 355 acpi_os_printf(" Ignoring, type not implemented (%2.2X)",
@@ -382,24 +361,8 @@ acpi_db_test_one_object(acpi_handle obj_handle,
382 361
383 if (ACPI_FAILURE(status)) { 362 if (ACPI_FAILURE(status)) {
384 status = AE_OK; 363 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;
400 } 364 }
401 365
402exit:
403 acpi_os_printf("\n"); 366 acpi_os_printf("\n");
404 return (status); 367 return (status);
405} 368}
@@ -444,7 +407,7 @@ acpi_db_test_integer_type(struct acpi_namespace_node *node, u32 bit_length)
444 return (status); 407 return (status);
445 } 408 }
446 409
447 acpi_os_printf(" (%4.4X/%3.3X) %8.8X%8.8X", 410 acpi_os_printf(ACPI_DEBUG_LENGTH_FORMAT " %8.8X%8.8X",
448 bit_length, ACPI_ROUND_BITS_UP_TO_BYTES(bit_length), 411 bit_length, ACPI_ROUND_BITS_UP_TO_BYTES(bit_length),
449 ACPI_FORMAT_UINT64(temp1->integer.value)); 412 ACPI_FORMAT_UINT64(temp1->integer.value));
450 413
@@ -558,8 +521,9 @@ acpi_db_test_buffer_type(struct acpi_namespace_node *node, u32 bit_length)
558 521
559 /* Emit a few bytes of the buffer */ 522 /* Emit a few bytes of the buffer */
560 523
561 acpi_os_printf(" (%4.4X/%3.3X)", bit_length, temp1->buffer.length); 524 acpi_os_printf(ACPI_DEBUG_LENGTH_FORMAT, bit_length,
562 for (i = 0; ((i < 4) && (i < byte_length)); i++) { 525 temp1->buffer.length);
526 for (i = 0; ((i < 8) && (i < byte_length)); i++) {
563 acpi_os_printf(" %2.2X", temp1->buffer.pointer[i]); 527 acpi_os_printf(" %2.2X", temp1->buffer.pointer[i]);
564 } 528 }
565 acpi_os_printf("... "); 529 acpi_os_printf("... ");
@@ -665,8 +629,9 @@ acpi_db_test_string_type(struct acpi_namespace_node *node, u32 byte_length)
665 return (status); 629 return (status);
666 } 630 }
667 631
668 acpi_os_printf(" (%4.4X/%3.3X) \"%s\"", (temp1->string.length * 8), 632 acpi_os_printf(ACPI_DEBUG_LENGTH_FORMAT " \"%s\"",
669 temp1->string.length, temp1->string.pointer); 633 (temp1->string.length * 8), temp1->string.length,
634 temp1->string.pointer);
670 635
671 /* Write a new value */ 636 /* Write a new value */
672 637
@@ -750,13 +715,80 @@ static acpi_status acpi_db_test_package_type(struct acpi_namespace_node *node)
750 return (status); 715 return (status);
751 } 716 }
752 717
753 acpi_os_printf(" %8.8X Elements", temp1->package.count); 718 acpi_os_printf(" %.2X Elements", temp1->package.count);
754 acpi_os_free(temp1); 719 acpi_os_free(temp1);
755 return (status); 720 return (status);
756} 721}
757 722
758/******************************************************************************* 723/*******************************************************************************
759 * 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
735static acpi_status
736acpi_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
790/*******************************************************************************
791 *
760 * FUNCTION: acpi_db_read_from_object 792 * FUNCTION: acpi_db_read_from_object
761 * 793 *
762 * PARAMETERS: node - Parent NS node for the object 794 * PARAMETERS: node - Parent NS node for the object
diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c
index 6b15625e8099..85b34d02233e 100644
--- a/drivers/acpi/acpica/dsargs.c
+++ b/drivers/acpi/acpica/dsargs.c
@@ -4,7 +4,7 @@
4 * Module Name: dsargs - Support for execution of dynamic arguments for static 4 * Module Name: dsargs - Support for execution of dynamic arguments for static
5 * objects (regions, fields, buffer fields, etc.) 5 * objects (regions, fields, buffer fields, etc.)
6 * 6 *
7 * Copyright (C) 2000 - 2018, Intel Corp. 7 * Copyright (C) 2000 - 2019, Intel Corp.
8 * 8 *
9 *****************************************************************************/ 9 *****************************************************************************/
10 10
diff --git a/drivers/acpi/acpica/dscontrol.c b/drivers/acpi/acpica/dscontrol.c
index 0da96268deb5..4847f89c678c 100644
--- a/drivers/acpi/acpica/dscontrol.c
+++ b/drivers/acpi/acpica/dscontrol.c
@@ -4,7 +4,7 @@
4 * Module Name: dscontrol - Support for execution control opcodes - 4 * Module Name: dscontrol - Support for execution control opcodes -
5 * if/else/while/return 5 * if/else/while/return
6 * 6 *
7 * Copyright (C) 2000 - 2018, Intel Corp. 7 * Copyright (C) 2000 - 2019, Intel Corp.
8 * 8 *
9 *****************************************************************************/ 9 *****************************************************************************/
10 10
diff --git a/drivers/acpi/acpica/dsdebug.c b/drivers/acpi/acpica/dsdebug.c
index 9d33f0bb2885..0d3e1ced1f57 100644
--- a/drivers/acpi/acpica/dsdebug.c
+++ b/drivers/acpi/acpica/dsdebug.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dsdebug - Parser/Interpreter interface - debugging 4 * Module Name: dsdebug - Parser/Interpreter interface - debugging
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c
index 30fe89545d6a..cf4e061bb0f0 100644
--- a/drivers/acpi/acpica/dsfield.c
+++ b/drivers/acpi/acpica/dsfield.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dsfield - Dispatcher field routines 4 * Module Name: dsfield - Dispatcher field routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -518,6 +518,13 @@ acpi_ds_create_field(union acpi_parse_object *op,
518 info.region_node = region_node; 518 info.region_node = region_node;
519 519
520 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next); 520 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 }
521 return_ACPI_STATUS(status); 528 return_ACPI_STATUS(status);
522} 529}
523 530
diff --git a/drivers/acpi/acpica/dsinit.c b/drivers/acpi/acpica/dsinit.c
index e8de1b0ce2f5..a4a24ffe5fae 100644
--- a/drivers/acpi/acpica/dsinit.c
+++ b/drivers/acpi/acpica/dsinit.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dsinit - Object initialization namespace walk 4 * Module Name: dsinit - Object initialization namespace walk
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index c1a4d02fafd5..f59b4d944f7f 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dsmethod - Parser/Interpreter interface - control method parsing 4 * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c
index 6a9cc613adaa..179129a2deb1 100644
--- a/drivers/acpi/acpica/dsobject.c
+++ b/drivers/acpi/acpica/dsobject.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dsobject - Dispatcher object management routines 4 * Module Name: dsobject - Dispatcher object management routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index 78f9de260d5f..10f32b62608e 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dsopcode - Dispatcher support for regions and fields 4 * Module Name: dsopcode - Dispatcher support for regions and fields
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -130,8 +130,8 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
130 /* Must have a valid (>0) bit count */ 130 /* Must have a valid (>0) bit count */
131 131
132 if (bit_count == 0) { 132 if (bit_count == 0) {
133 ACPI_ERROR((AE_INFO, 133 ACPI_BIOS_ERROR((AE_INFO,
134 "Attempt to CreateField of length zero")); 134 "Attempt to CreateField of length zero"));
135 status = AE_AML_OPERAND_VALUE; 135 status = AE_AML_OPERAND_VALUE;
136 goto cleanup; 136 goto cleanup;
137 } 137 }
@@ -194,12 +194,13 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
194 /* Entire field must fit within the current length of the buffer */ 194 /* Entire field must fit within the current length of the buffer */
195 195
196 if ((bit_offset + bit_count) > (8 * (u32)buffer_desc->buffer.length)) { 196 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));
202 status = AE_AML_BUFFER_LIMIT; 197 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));
203 goto cleanup; 204 goto cleanup;
204 } 205 }
205 206
@@ -355,6 +356,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
355 union acpi_operand_object *operand_desc; 356 union acpi_operand_object *operand_desc;
356 struct acpi_namespace_node *node; 357 struct acpi_namespace_node *node;
357 union acpi_parse_object *next_op; 358 union acpi_parse_object *next_op;
359 acpi_adr_space_type space_id;
358 360
359 ACPI_FUNCTION_TRACE_PTR(ds_eval_region_operands, op); 361 ACPI_FUNCTION_TRACE_PTR(ds_eval_region_operands, op);
360 362
@@ -367,6 +369,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
367 /* next_op points to the op that holds the space_ID */ 369 /* next_op points to the op that holds the space_ID */
368 370
369 next_op = op->common.value.arg; 371 next_op = op->common.value.arg;
372 space_id = (acpi_adr_space_type)next_op->common.value.integer;
370 373
371 /* next_op points to address op */ 374 /* next_op points to address op */
372 375
@@ -402,6 +405,15 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
402 obj_desc->region.length = (u32) operand_desc->integer.value; 405 obj_desc->region.length = (u32) operand_desc->integer.value;
403 acpi_ut_remove_reference(operand_desc); 406 acpi_ut_remove_reference(operand_desc);
404 407
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
405 /* 417 /*
406 * Get the address and save it 418 * Get the address and save it
407 * (at top of stack - 1) 419 * (at top of stack - 1)
diff --git a/drivers/acpi/acpica/dspkginit.c b/drivers/acpi/acpica/dspkginit.c
index 584853385268..997faa10f615 100644
--- a/drivers/acpi/acpica/dspkginit.c
+++ b/drivers/acpi/acpica/dspkginit.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dspkginit - Completion of deferred package initialization 4 * Module Name: dspkginit - Completion of deferred package initialization
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/dswexec.c b/drivers/acpi/acpica/dswexec.c
index 1504b93cc5f4..d75aae304595 100644
--- a/drivers/acpi/acpica/dswexec.c
+++ b/drivers/acpi/acpica/dswexec.c
@@ -4,7 +4,7 @@
4 * Module Name: dswexec - Dispatcher method execution callbacks; 4 * Module Name: dswexec - Dispatcher method execution callbacks;
5 * dispatch to interpreter. 5 * dispatch to interpreter.
6 * 6 *
7 * Copyright (C) 2000 - 2018, Intel Corp. 7 * Copyright (C) 2000 - 2019, Intel Corp.
8 * 8 *
9 *****************************************************************************/ 9 *****************************************************************************/
10 10
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index e2ef09643d50..c88fd31208a5 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dswload - Dispatcher first pass namespace load callbacks 4 * Module Name: dswload - Dispatcher first pass namespace load callbacks
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c
index 9a309f5c4de8..935a8e2623e4 100644
--- a/drivers/acpi/acpica/dswload2.c
+++ b/drivers/acpi/acpica/dswload2.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dswload2 - Dispatcher second pass namespace load callbacks 4 * Module Name: dswload2 - Dispatcher second pass namespace load callbacks
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -24,7 +24,7 @@ ACPI_MODULE_NAME("dswload2")
24 * FUNCTION: acpi_ds_load2_begin_op 24 * FUNCTION: acpi_ds_load2_begin_op
25 * 25 *
26 * PARAMETERS: walk_state - Current state of the parse tree walk 26 * 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
28 * 28 *
29 * RETURN: Status 29 * RETURN: Status
30 * 30 *
diff --git a/drivers/acpi/acpica/dswscope.c b/drivers/acpi/acpica/dswscope.c
index 7592176a8fa2..39acf7b286da 100644
--- a/drivers/acpi/acpica/dswscope.c
+++ b/drivers/acpi/acpica/dswscope.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dswscope - Scope stack manipulation 4 * Module Name: dswscope - Scope stack manipulation
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/dswstate.c b/drivers/acpi/acpica/dswstate.c
index 4c1ec202d5ab..de79f835a373 100644
--- a/drivers/acpi/acpica/dswstate.c
+++ b/drivers/acpi/acpica/dswstate.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: dswstate - Dispatcher parse tree walk management routines 4 * Module Name: dswstate - Dispatcher parse tree walk management routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c
index b3d07cc14d75..9e2f5a05c066 100644
--- a/drivers/acpi/acpica/evevent.c
+++ b/drivers/acpi/acpica/evevent.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evevent - Fixed Event handling and dispatch 4 * Module Name: evevent - Fixed Event handling and dispatch
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/evglock.c b/drivers/acpi/acpica/evglock.c
index 1b8a662a14a9..5c77bee5d31f 100644
--- a/drivers/acpi/acpica/evglock.c
+++ b/drivers/acpi/acpica/evglock.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evglock - Global Lock support 4 * Module Name: evglock - Global Lock support
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index e10fec99a182..62d3aa74277b 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evgpe - General Purpose Event handling and dispatch 4 * Module Name: evgpe - General Purpose Event handling and dispatch
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -801,7 +801,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
801 dispatch.handler-> 801 dispatch.handler->
802 context); 802 context);
803 803
804 /* If requested, clear (if level-triggered) and reenable the GPE */ 804 /* If requested, clear (if level-triggered) and re-enable the GPE */
805 805
806 if (return_value & ACPI_REENABLE_GPE) { 806 if (return_value & ACPI_REENABLE_GPE) {
807 (void)acpi_ev_finish_gpe(gpe_event_info); 807 (void)acpi_ev_finish_gpe(gpe_event_info);
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index b253063b09d3..328d1d6123ad 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evgpeblk - GPE block creation and initialization. 4 * Module Name: evgpeblk - GPE block creation and initialization.
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index 1f686750bb1a..c92d2f6ebe01 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evgpeinit - System GPE initialization and update 4 * Module Name: evgpeinit - System GPE initialization and update
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c
index 0fb6c70f44ed..917892227e09 100644
--- a/drivers/acpi/acpica/evgpeutil.c
+++ b/drivers/acpi/acpica/evgpeutil.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evgpeutil - GPE utilities 4 * Module Name: evgpeutil - GPE utilities
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/evhandler.c b/drivers/acpi/acpica/evhandler.c
index 4ed1e67db6be..3ef4e27995f0 100644
--- a/drivers/acpi/acpica/evhandler.c
+++ b/drivers/acpi/acpica/evhandler.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evhandler - Support for Address Space handlers 4 * Module Name: evhandler - Support for Address Space handlers
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c
index baadd635b5af..d45f7639f7ee 100644
--- a/drivers/acpi/acpica/evmisc.c
+++ b/drivers/acpi/acpica/evmisc.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evmisc - Miscellaneous event manager support functions 4 * Module Name: evmisc - Miscellaneous event manager support functions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index 49decca4e08f..45dc797df05d 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evregion - Operation Region support 4 * Module Name: evregion - Operation Region support
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -250,7 +250,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
250 /* 250 /*
251 * For handlers other than the default (supplied) handlers, we must 251 * For handlers other than the default (supplied) handlers, we must
252 * exit the interpreter because the handler *might* block -- we don't 252 * 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.
254 */ 254 */
255 acpi_ex_exit_interpreter(); 255 acpi_ex_exit_interpreter();
256 } 256 }
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c
index 17df5dacd43c..0b47bbcd2a23 100644
--- a/drivers/acpi/acpica/evrgnini.c
+++ b/drivers/acpi/acpica/evrgnini.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evrgnini- ACPI address_space (op_region) init 4 * Module Name: evrgnini- ACPI address_space (op_region) init
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -516,25 +516,6 @@ acpi_status acpi_ev_initialize_region(union acpi_operand_object *region_obj)
516 handler_obj = obj_desc->common_notify.handler; 516 handler_obj = obj_desc->common_notify.handler;
517 break; 517 break;
518 518
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
538 default: 519 default:
539 520
540 /* Ignore other objects */ 521 /* Ignore other objects */
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index febc332b00ac..3df00eb6621b 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evxface - External interfaces for ACPI events 4 * Module Name: evxface - External interfaces for ACPI events
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index 970e940bdb17..e528fe56b755 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable 4 * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index b2d5f66cc1b0..30a083902f52 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: evxfgpe - External Interfaces for General Purpose Events (GPEs) 4 * Module Name: evxfgpe - External Interfaces for General Purpose Events (GPEs)
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -669,9 +669,9 @@ ACPI_EXPORT_SYMBOL(acpi_dispatch_gpe)
669 * 669 *
670 * RETURN: Status 670 * RETURN: Status
671 * 671 *
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
673 * processing. Intended for use by asynchronous host-installed 673 * 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
675 * is set in the GPE info. 675 * is set in the GPE info.
676 * 676 *
677 ******************************************************************************/ 677 ******************************************************************************/
diff --git a/drivers/acpi/acpica/evxfregn.c b/drivers/acpi/acpica/evxfregn.c
index 3b3a25d9f0e6..47265b073e6f 100644
--- a/drivers/acpi/acpica/evxfregn.c
+++ b/drivers/acpi/acpica/evxfregn.c
@@ -4,7 +4,7 @@
4 * Module Name: evxfregn - External Interfaces, ACPI Operation Regions and 4 * Module Name: evxfregn - External Interfaces, ACPI Operation Regions and
5 * Address Spaces. 5 * Address Spaces.
6 * 6 *
7 * Copyright (C) 2000 - 2018, Intel Corp. 7 * Copyright (C) 2000 - 2019, Intel Corp.
8 * 8 *
9 *****************************************************************************/ 9 *****************************************************************************/
10 10
diff --git a/drivers/acpi/acpica/exconcat.c b/drivers/acpi/acpica/exconcat.c
index 5e75c510ca25..c7af07566b7b 100644
--- a/drivers/acpi/acpica/exconcat.c
+++ b/drivers/acpi/acpica/exconcat.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exconcat - Concatenate-type AML operators 4 * Module Name: exconcat - Concatenate-type AML operators
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 2373a7492151..587aeeeb5070 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes) 4 * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes)
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exconvrt.c b/drivers/acpi/acpica/exconvrt.c
index 1a70b80cc406..ca2966bacb50 100644
--- a/drivers/acpi/acpica/exconvrt.c
+++ b/drivers/acpi/acpica/exconvrt.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exconvrt - Object conversion routines 4 * Module Name: exconvrt - Object conversion routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -520,7 +520,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
520 for (i = 0; i < obj_desc->buffer.length; i++) { 520 for (i = 0; i < obj_desc->buffer.length; i++) {
521 if (base == 16) { 521 if (base == 16) {
522 522
523 /* Emit 0x prefix for explict/implicit hex conversion */ 523 /* Emit 0x prefix for explicit/implicit hex conversion */
524 524
525 *new_buf++ = '0'; 525 *new_buf++ = '0';
526 *new_buf++ = 'x'; 526 *new_buf++ = 'x';
diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c
index 3304c6b1e8a7..f376fc00064e 100644
--- a/drivers/acpi/acpica/excreate.c
+++ b/drivers/acpi/acpica/excreate.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: excreate - Named object creation 4 * Module Name: excreate - Named object creation
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c
index ebbc244039ab..b1aeec8cac55 100644
--- a/drivers/acpi/acpica/exdebug.c
+++ b/drivers/acpi/acpica/exdebug.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exdebug - Support for stores to the AML Debug Object 4 * Module Name: exdebug - Support for stores to the AML Debug Object
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c
index f71dfa1e90e1..6526b2deeaad 100644
--- a/drivers/acpi/acpica/exdump.c
+++ b/drivers/acpi/acpica/exdump.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exdump - Interpreter debug output routines 4 * Module Name: exdump - Interpreter debug output routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c
index e5798f15793a..d3d2dbfba680 100644
--- a/drivers/acpi/acpica/exfield.c
+++ b/drivers/acpi/acpica/exfield.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exfield - AML execution - field_unit read/write 4 * Module Name: exfield - AML execution - field_unit read/write
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -41,6 +41,17 @@ const u8 acpi_protocol_lengths[] = {
41 0xFF /* F - ATTRIB_RAW_PROCESS_BYTES */ 41 0xFF /* F - ATTRIB_RAW_PROCESS_BYTES */
42}; 42};
43 43
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
44/******************************************************************************* 55/*******************************************************************************
45 * 56 *
46 * FUNCTION: acpi_ex_get_protocol_buffer_length 57 * FUNCTION: acpi_ex_get_protocol_buffer_length
@@ -177,6 +188,25 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
177 188
178 status = acpi_ex_read_gpio(obj_desc, buffer); 189 status = acpi_ex_read_gpio(obj_desc, buffer);
179 goto exit; 190 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;
180 } 210 }
181 211
182 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 212 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
@@ -229,6 +259,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
229{ 259{
230 acpi_status status; 260 acpi_status status;
231 u32 buffer_length; 261 u32 buffer_length;
262 u32 data_length;
232 void *buffer; 263 void *buffer;
233 264
234 ACPI_FUNCTION_TRACE_PTR(ex_write_data_to_field, obj_desc); 265 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,
272 acpi_ex_write_serial_bus(source_desc, obj_desc, 303 acpi_ex_write_serial_bus(source_desc, obj_desc,
273 result_desc); 304 result_desc);
274 return_ACPI_STATUS(status); 305 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);
275 } 344 }
276 345
277 /* Get a pointer to the data to be written */ 346 /* Get a pointer to the data to be written */
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c
index 516994133128..95a0dcb4f7b9 100644
--- a/drivers/acpi/acpica/exfldio.c
+++ b/drivers/acpi/acpica/exfldio.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exfldio - Aml Field I/O 4 * Module Name: exfldio - Aml Field I/O
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exmisc.c b/drivers/acpi/acpica/exmisc.c
index d91f15cdf3ae..60e854965af9 100644
--- a/drivers/acpi/acpica/exmisc.c
+++ b/drivers/acpi/acpica/exmisc.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes 4 * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c
index c06079774bad..775cd62af5b3 100644
--- a/drivers/acpi/acpica/exmutex.c
+++ b/drivers/acpi/acpica/exmutex.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exmutex - ASL Mutex Acquire/Release functions 4 * Module Name: exmutex - ASL Mutex Acquire/Release functions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exnames.c b/drivers/acpi/acpica/exnames.c
index 7eed79dcda83..bd68d66e89f0 100644
--- a/drivers/acpi/acpica/exnames.c
+++ b/drivers/acpi/acpica/exnames.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exnames - interpreter/scanner name load/execute 4 * Module Name: exnames - interpreter/scanner name load/execute
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index ba9fbae0cf91..06e35ea09823 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exoparg1 - AML execution - opcodes with 1 argument 4 * Module Name: exoparg1 - AML execution - opcodes with 1 argument
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exoparg2.c b/drivers/acpi/acpica/exoparg2.c
index 3a477566ba1b..5e4a31a11df4 100644
--- a/drivers/acpi/acpica/exoparg2.c
+++ b/drivers/acpi/acpica/exoparg2.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exoparg2 - AML execution - opcodes with 2 arguments 4 * Module Name: exoparg2 - AML execution - opcodes with 2 arguments
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -390,10 +390,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
390 /* Failure means that the Index was beyond the end of the object */ 390 /* Failure means that the Index was beyond the end of the object */
391 391
392 if (ACPI_FAILURE(status)) { 392 if (ACPI_FAILURE(status)) {
393 ACPI_EXCEPTION((AE_INFO, status, 393 ACPI_BIOS_EXCEPTION((AE_INFO, status,
394 "Index (0x%X%8.8X) is beyond end of object (length 0x%X)", 394 "Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
395 ACPI_FORMAT_UINT64(index), 395 ACPI_FORMAT_UINT64(index),
396 (u32)length)); 396 (u32)length));
397 goto cleanup; 397 goto cleanup;
398 } 398 }
399 399
diff --git a/drivers/acpi/acpica/exoparg3.c b/drivers/acpi/acpica/exoparg3.c
index 764fa6f924ff..a4ebce417930 100644
--- a/drivers/acpi/acpica/exoparg3.c
+++ b/drivers/acpi/acpica/exoparg3.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exoparg3 - AML execution - opcodes with 3 arguments 4 * Module Name: exoparg3 - AML execution - opcodes with 3 arguments
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exoparg6.c b/drivers/acpi/acpica/exoparg6.c
index 3941525f3d6b..31385a0b2dab 100644
--- a/drivers/acpi/acpica/exoparg6.c
+++ b/drivers/acpi/acpica/exoparg6.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exoparg6 - AML execution - opcodes with 6 arguments 4 * Module Name: exoparg6 - AML execution - opcodes with 6 arguments
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c
index 738f3c732363..728d752f7adc 100644
--- a/drivers/acpi/acpica/exprep.c
+++ b/drivers/acpi/acpica/exprep.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exprep - ACPI AML field prep utilities 4 * Module Name: exprep - ACPI AML field prep utilities
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 2c58f5e00b1a..c08521194b29 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exregion - ACPI default op_region (address space) handlers 4 * Module Name: exregion - ACPI default op_region (address space) handlers
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exresnte.c b/drivers/acpi/acpica/exresnte.c
index ea4b0fe674f1..b223d01e6bf8 100644
--- a/drivers/acpi/acpica/exresnte.c
+++ b/drivers/acpi/acpica/exresnte.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exresnte - AML Interpreter object resolution 4 * Module Name: exresnte - AML Interpreter object resolution
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exresolv.c b/drivers/acpi/acpica/exresolv.c
index 5e42c7de46fa..36da5c0ef69c 100644
--- a/drivers/acpi/acpica/exresolv.c
+++ b/drivers/acpi/acpica/exresolv.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exresolv - AML Interpreter object resolution 4 * Module Name: exresolv - AML Interpreter object resolution
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exresop.c b/drivers/acpi/acpica/exresop.c
index d94190bc5985..bdfe4d33b483 100644
--- a/drivers/acpi/acpica/exresop.c
+++ b/drivers/acpi/acpica/exresop.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exresop - AML Interpreter operand/object resolution 4 * Module Name: exresop - AML Interpreter operand/object resolution
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exserial.c b/drivers/acpi/acpica/exserial.c
index ec61553c4483..c5aa4b0deb70 100644
--- a/drivers/acpi/acpica/exserial.c
+++ b/drivers/acpi/acpica/exserial.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exserial - field_unit support for serial address spaces 4 * Module Name: exserial - field_unit support for serial address spaces
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -21,7 +21,7 @@ ACPI_MODULE_NAME("exserial")
21 * FUNCTION: acpi_ex_read_gpio 21 * FUNCTION: acpi_ex_read_gpio
22 * 22 *
23 * PARAMETERS: obj_desc - The named field to read 23 * PARAMETERS: obj_desc - The named field to read
24 * buffer - Where the return data is returnd 24 * buffer - Where the return data is returned
25 * 25 *
26 * RETURN: Status 26 * RETURN: Status
27 * 27 *
diff --git a/drivers/acpi/acpica/exstore.c b/drivers/acpi/acpica/exstore.c
index 75d5665b7b2f..7f3c3571c292 100644
--- a/drivers/acpi/acpica/exstore.c
+++ b/drivers/acpi/acpica/exstore.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exstore - AML Interpreter object store support 4 * Module Name: exstore - AML Interpreter object store support
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exstoren.c b/drivers/acpi/acpica/exstoren.c
index 31cba19652ed..4e43c8277f07 100644
--- a/drivers/acpi/acpica/exstoren.c
+++ b/drivers/acpi/acpica/exstoren.c
@@ -4,7 +4,7 @@
4 * Module Name: exstoren - AML Interpreter object store support, 4 * Module Name: exstoren - AML Interpreter object store support,
5 * Store to Node (namespace object) 5 * Store to Node (namespace object)
6 * 6 *
7 * Copyright (C) 2000 - 2018, Intel Corp. 7 * Copyright (C) 2000 - 2019, Intel Corp.
8 * 8 *
9 *****************************************************************************/ 9 *****************************************************************************/
10 10
diff --git a/drivers/acpi/acpica/exstorob.c b/drivers/acpi/acpica/exstorob.c
index 4cd82ff509bc..dc9e2b1c1ad9 100644
--- a/drivers/acpi/acpica/exstorob.c
+++ b/drivers/acpi/acpica/exstorob.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exstorob - AML object store support, store to object 4 * Module Name: exstorob - AML object store support, store to object
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exsystem.c b/drivers/acpi/acpica/exsystem.c
index ec8b5a22cad4..a538f7799b78 100644
--- a/drivers/acpi/acpica/exsystem.c
+++ b/drivers/acpi/acpica/exsystem.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exsystem - Interface to OS services 4 * Module Name: exsystem - Interface to OS services
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/extrace.c b/drivers/acpi/acpica/extrace.c
index 9bd3fa56b51a..db7f93ca539f 100644
--- a/drivers/acpi/acpica/extrace.c
+++ b/drivers/acpi/acpica/extrace.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: extrace - Support for interpreter execution tracing 4 * Module Name: extrace - Support for interpreter execution tracing
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c
index bd22e27adf9b..75380be1c2ef 100644
--- a/drivers/acpi/acpica/exutils.c
+++ b/drivers/acpi/acpica/exutils.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: exutils - interpreter/scanner utilities 4 * Module Name: exutils - interpreter/scanner utilities
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -160,7 +160,7 @@ u8 acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc)
160 * RETURN: None 160 * RETURN: None
161 * 161 *
162 * DESCRIPTION: Obtain the ACPI hardware Global Lock, only if the field 162 * 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.
164 * 164 *
165 ******************************************************************************/ 165 ******************************************************************************/
166 166
diff --git a/drivers/acpi/acpica/hwacpi.c b/drivers/acpi/acpica/hwacpi.c
index 525e6ea5c114..926f7e080f22 100644
--- a/drivers/acpi/acpica/hwacpi.c
+++ b/drivers/acpi/acpica/hwacpi.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface 4 * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/hwesleep.c b/drivers/acpi/acpica/hwesleep.c
index e0ad3f11142e..dee3affaca49 100644
--- a/drivers/acpi/acpica/hwesleep.c
+++ b/drivers/acpi/acpica/hwesleep.c
@@ -4,7 +4,7 @@
4 * Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the 4 * Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the
5 * extended FADT-V5 sleep registers. 5 * extended FADT-V5 sleep registers.
6 * 6 *
7 * Copyright (C) 2000 - 2018, Intel Corp. 7 * Copyright (C) 2000 - 2019, Intel Corp.
8 * 8 *
9 *****************************************************************************/ 9 *****************************************************************************/
10 10
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index 2d2e2e41a685..565bd3f29f31 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: hwgpe - Low level GPE enable/disable/clear functions 4 * Module Name: hwgpe - Low level GPE enable/disable/clear functions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index d8b8fc2ff563..b62db8ec446f 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -4,7 +4,7 @@
4 * Name: hwsleep.c - ACPI Hardware Sleep/Wake Support functions for the 4 * Name: hwsleep.c - ACPI Hardware Sleep/Wake Support functions for the
5 * original/legacy sleep/PM registers. 5 * original/legacy sleep/PM registers.
6 * 6 *
7 * Copyright (C) 2000 - 2018, Intel Corp. 7 * Copyright (C) 2000 - 2019, Intel Corp.
8 * 8 *
9 *****************************************************************************/ 9 *****************************************************************************/
10 10
diff --git a/drivers/acpi/acpica/hwtimer.c b/drivers/acpi/acpica/hwtimer.c
index 5d5e27146fc2..2fb9f75d71c5 100644
--- a/drivers/acpi/acpica/hwtimer.c
+++ b/drivers/acpi/acpica/hwtimer.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: hwtimer.c - ACPI Power Management Timer Interface 4 * Name: hwtimer.c - ACPI Power Management Timer Interface
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c
index 24f9b61aa404..cd576153257c 100644
--- a/drivers/acpi/acpica/hwvalid.c
+++ b/drivers/acpi/acpica/hwvalid.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: hwvalid - I/O request validation 4 * Module Name: hwvalid - I/O request validation
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index 6e39a771a56e..c4fd97104024 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: hwxface - Public ACPICA hardware interfaces 4 * Module Name: hwxface - Public ACPICA hardware interfaces
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index 3f22f7dd4556..abbf9702aa7f 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces 4 * Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -23,33 +23,6 @@ acpi_hw_set_firmware_waking_vector(struct acpi_table_facs *facs,
23 acpi_physical_address physical_address64); 23 acpi_physical_address physical_address64);
24#endif 24#endif
25 25
26static 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
38static 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
53/* 26/*
54 * These functions are removed for the ACPI_REDUCED_HARDWARE case: 27 * These functions are removed for the ACPI_REDUCED_HARDWARE case:
55 * acpi_set_firmware_waking_vector 28 * acpi_set_firmware_waking_vector
@@ -209,53 +182,6 @@ acpi_status acpi_enter_sleep_state_s4bios(void)
209 182
210ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios) 183ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
211#endif /* !ACPI_REDUCED_HARDWARE */ 184#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 ******************************************************************************/
225static 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}
259 185
260/******************************************************************************* 186/*******************************************************************************
261 * 187 *
@@ -362,7 +288,12 @@ acpi_status acpi_enter_sleep_state(u8 sleep_state)
362 return_ACPI_STATUS(AE_AML_OPERAND_VALUE); 288 return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
363 } 289 }
364 290
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);
366 return_ACPI_STATUS(status); 297 return_ACPI_STATUS(status);
367} 298}
368 299
@@ -388,8 +319,12 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)
388 319
389 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep); 320 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep);
390 321
391 status = 322#if !ACPI_REDUCED_HARDWARE
392 acpi_hw_sleep_dispatch(sleep_state, ACPI_WAKE_PREP_FUNCTION_ID); 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);
393 return_ACPI_STATUS(status); 328 return_ACPI_STATUS(status);
394} 329}
395 330
@@ -413,7 +348,12 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
413 348
414 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); 349 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
415 350
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);
417 return_ACPI_STATUS(status); 357 return_ACPI_STATUS(status);
418} 358}
419 359
diff --git a/drivers/acpi/acpica/nsarguments.c b/drivers/acpi/acpica/nsarguments.c
index b9ede797b654..0e97ed38973f 100644
--- a/drivers/acpi/acpica/nsarguments.c
+++ b/drivers/acpi/acpica/nsarguments.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: nsarguments - Validation of args for ACPI predefined methods 4 * Module Name: nsarguments - Validation of args for ACPI predefined methods
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/nsconvert.c b/drivers/acpi/acpica/nsconvert.c
index f9527346b0f7..14cbf63f1991 100644
--- a/drivers/acpi/acpica/nsconvert.c
+++ b/drivers/acpi/acpica/nsconvert.c
@@ -4,7 +4,7 @@
4 * Module Name: nsconvert - Object conversions for objects returned by 4 * Module Name: nsconvert - Object conversions for objects returned by
5 * predefined methods 5 * predefined methods
6 * 6 *
7 * Copyright (C) 2000 - 2018, Intel Corp. 7 * Copyright (C) 2000 - 2019, Intel Corp.
8 * 8 *
9 *****************************************************************************/ 9 *****************************************************************************/
10 10
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 90ccffcd770b..15070bd0c28a 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: nsdump - table dumping routines for debug 4 * Module Name: nsdump - table dumping routines for debug
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/nsdumpdv.c b/drivers/acpi/acpica/nsdumpdv.c
index 2b291c500fb0..73e5c83c8c9f 100644
--- a/drivers/acpi/acpica/nsdumpdv.c
+++ b/drivers/acpi/acpica/nsdumpdv.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: nsdump - table dumping routines for debug 4 * Module Name: nsdump - table dumping routines for debug
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index d77257d1c827..19fb8dda870f 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: nsinit - namespace initialization 4 * Module Name: nsinit - namespace initialization
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c
index 04bc73e82aed..35fff5c75da1 100644
--- a/drivers/acpi/acpica/nsload.c
+++ b/drivers/acpi/acpica/nsload.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: nsload - namespace loading/expanding/contracting procedures 4 * Module Name: nsload - namespace loading/expanding/contracting procedures
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -75,7 +75,7 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node)
75 /* 75 /*
76 * On error, delete any namespace objects created by this table. 76 * On error, delete any namespace objects created by this table.
77 * We cannot initialize these objects, so delete them. There are 77 * We cannot initialize these objects, so delete them. There are
78 * a couple of expecially bad cases: 78 * a couple of especially bad cases:
79 * AE_ALREADY_EXISTS - namespace collision. 79 * AE_ALREADY_EXISTS - namespace collision.
80 * AE_NOT_FOUND - the target of a Scope operator does not 80 * AE_NOT_FOUND - the target of a Scope operator does not
81 * exist. This target of Scope must already exist in the 81 * exist. This target of Scope must already exist in the
diff --git a/drivers/acpi/acpica/nsparse.c b/drivers/acpi/acpica/nsparse.c
index 488ff39d86f7..c0b4f7bedfab 100644
--- a/drivers/acpi/acpica/nsparse.c
+++ b/drivers/acpi/acpica/nsparse.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: nsparse - namespace interface to AML parser 4 * Module Name: nsparse - namespace interface to AML parser
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -253,61 +253,19 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
253 253
254 ACPI_FUNCTION_TRACE(ns_parse_table); 254 ACPI_FUNCTION_TRACE(ns_parse_table);
255 255
256 if (acpi_gbl_execute_tables_as_methods) { 256 /*
257 /* 257 * Executes the AML table as one large control method.
258 * This case executes the AML table as one large control method. 258 * The point of this is to execute any module-level code in-place
259 * 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 * as the table is parsed. Some AML code depends on this behavior. 260 *
261 * 261 * Note: This causes the table to only have a single-pass parse.
262 * It is a run-time option at this time, but will eventually become 262 * However, this is compatible with other ACPI implementations.
263 * the default. 263 */
264 * 264 ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
265 * Note: This causes the table to only have a single-pass parse. 265 "%s: **** Start table execution pass\n",
266 * However, this is compatible with other ACPI implementations. 266 ACPI_GET_FUNCTION_NAME));
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 }
294 267
295 /* 268 status = acpi_ns_execute_table(table_index, start_node);
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 }
311 269
312 return_ACPI_STATUS(status); 270 return_ACPI_STATUS(status);
313} 271}
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index 29c68b15a64f..2f9d93122d0c 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: nspredef - Validation of ACPI predefined methods and objects 4 * Module Name: nspredef - Validation of ACPI predefined methods and objects
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/nsprepkg.c b/drivers/acpi/acpica/nsprepkg.c
index 51523473e7fe..9a80e3b23496 100644
--- a/drivers/acpi/acpica/nsprepkg.c
+++ b/drivers/acpi/acpica/nsprepkg.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: nsprepkg - Validation of package objects for predefined names 4 * Module Name: nsprepkg - Validation of package objects for predefined names
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c
index ff2ab8fbec38..0aacfa48e20d 100644
--- a/drivers/acpi/acpica/nsrepair.c
+++ b/drivers/acpi/acpica/nsrepair.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: nsrepair - Repair for objects returned by predefined methods 4 * Module Name: nsrepair - Repair for objects returned by predefined methods
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index a3bd6280882c..d5804a6d1d65 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -4,7 +4,7 @@
4 * Module Name: nsrepair2 - Repair for objects returned by specific 4 * Module Name: nsrepair2 - Repair for objects returned by specific
5 * predefined methods 5 * predefined methods
6 * 6 *
7 * Copyright (C) 2000 - 2018, Intel Corp. 7 * Copyright (C) 2000 - 2019, Intel Corp.
8 * 8 *
9 *****************************************************************************/ 9 *****************************************************************************/
10 10
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index a2bf4b2caa6c..e5cef1edf49f 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -4,7 +4,7 @@
4 * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing 4 * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
5 * parents and siblings and Scope manipulation 5 * parents and siblings and Scope manipulation
6 * 6 *
7 * Copyright (C) 2000 - 2018, Intel Corp. 7 * Copyright (C) 2000 - 2019, Intel Corp.
8 * 8 *
9 *****************************************************************************/ 9 *****************************************************************************/
10 10
@@ -350,7 +350,7 @@ acpi_ns_internalize_name(const char *external_name, char **converted_name)
350 * 350 *
351 * FUNCTION: acpi_ns_externalize_name 351 * FUNCTION: acpi_ns_externalize_name
352 * 352 *
353 * PARAMETERS: internal_name_length - Lenth of the internal name below 353 * PARAMETERS: internal_name_length - Length of the internal name below
354 * internal_name - Internal representation of name 354 * internal_name - Internal representation of name
355 * converted_name_length - Where the length is returned 355 * converted_name_length - Where the length is returned
356 * converted_name - Where the resulting external name 356 * converted_name - Where the resulting external name
diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c
index e9a061da9bb2..ceea6af79d12 100644
--- a/drivers/acpi/acpica/nswalk.c
+++ b/drivers/acpi/acpica/nswalk.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: nswalk - Functions for walking the ACPI namespace 4 * Module Name: nswalk - Functions for walking the ACPI namespace
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index b2915c9cceaf..de2d3135d6a9 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -4,7 +4,7 @@
4 * Module Name: nsxfname - Public interfaces to the ACPI subsystem 4 * Module Name: nsxfname - Public interfaces to the ACPI subsystem
5 * ACPI Namespace oriented interfaces 5 * ACPI Namespace oriented interfaces
6 * 6 *
7 * Copyright (C) 2000 - 2018, Intel Corp. 7 * Copyright (C) 2000 - 2019, Intel Corp.
8 * 8 *
9 *****************************************************************************/ 9 *****************************************************************************/
10 10
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index 176d28d60125..9d9d442cd999 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: psargs - Parse AML opcode arguments 4 * Module Name: psargs - Parse AML opcode arguments
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
index e00d1af6fa80..207805047bc4 100644
--- a/drivers/acpi/acpica/psloop.c
+++ b/drivers/acpi/acpica/psloop.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: psloop - Main AML parse loop 4 * Module Name: psloop - Main AML parse loop
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -32,10 +32,6 @@ static acpi_status
32acpi_ps_get_arguments(struct acpi_walk_state *walk_state, 32acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
33 u8 * aml_op_start, union acpi_parse_object *op); 33 u8 * aml_op_start, union acpi_parse_object *op);
34 34
35static void
36acpi_ps_link_module_code(union acpi_parse_object *parent_op,
37 u8 *aml_start, u32 aml_length, acpi_owner_id owner_id);
38
39/******************************************************************************* 35/*******************************************************************************
40 * 36 *
41 * FUNCTION: acpi_ps_get_arguments 37 * FUNCTION: acpi_ps_get_arguments
@@ -56,7 +52,6 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
56{ 52{
57 acpi_status status = AE_OK; 53 acpi_status status = AE_OK;
58 union acpi_parse_object *arg = NULL; 54 union acpi_parse_object *arg = NULL;
59 const struct acpi_opcode_info *op_info;
60 55
61 ACPI_FUNCTION_TRACE_PTR(ps_get_arguments, walk_state); 56 ACPI_FUNCTION_TRACE_PTR(ps_get_arguments, walk_state);
62 57
@@ -136,96 +131,6 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
136 walk_state->arg_count, 131 walk_state->arg_count,
137 walk_state->pass_number)); 132 walk_state->pass_number));
138 133
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
229 /* Special processing for certain opcodes */ 134 /* Special processing for certain opcodes */
230 135
231 switch (op->common.aml_opcode) { 136 switch (op->common.aml_opcode) {
@@ -302,104 +207,6 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
302 207
303/******************************************************************************* 208/*******************************************************************************
304 * 209 *
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
330static void
331acpi_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
401/*******************************************************************************
402 *
403 * FUNCTION: acpi_ps_parse_loop 210 * FUNCTION: acpi_ps_parse_loop
404 * 211 *
405 * PARAMETERS: walk_state - Current state 212 * PARAMETERS: walk_state - Current state
diff --git a/drivers/acpi/acpica/psobject.c b/drivers/acpi/acpica/psobject.c
index e1fd819a2955..98e5c7400e54 100644
--- a/drivers/acpi/acpica/psobject.c
+++ b/drivers/acpi/acpica/psobject.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: psobject - Support for parse objects 4 * Module Name: psobject - Support for parse objects
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/psopcode.c b/drivers/acpi/acpica/psopcode.c
index 8d7dc98bad17..43775c5ce17c 100644
--- a/drivers/acpi/acpica/psopcode.c
+++ b/drivers/acpi/acpica/psopcode.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: psopcode - Parser/Interpreter opcode information table 4 * Module Name: psopcode - Parser/Interpreter opcode information table
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/psopinfo.c b/drivers/acpi/acpica/psopinfo.c
index f310954eea59..15e7563829f1 100644
--- a/drivers/acpi/acpica/psopinfo.c
+++ b/drivers/acpi/acpica/psopinfo.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: psopinfo - AML opcode information functions and dispatch tables 4 * Module Name: psopinfo - AML opcode information functions and dispatch tables
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c
index 65603473b6cb..9b386530ffbe 100644
--- a/drivers/acpi/acpica/psparse.c
+++ b/drivers/acpi/acpica/psparse.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: psparse - Parser top level AML parse routines 4 * Module Name: psparse - Parser top level AML parse routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -523,12 +523,12 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
523 if (status == AE_ABORT_METHOD) { 523 if (status == AE_ABORT_METHOD) {
524 acpi_ns_print_node_pathname(walk_state-> 524 acpi_ns_print_node_pathname(walk_state->
525 method_node, 525 method_node,
526 "Method aborted:"); 526 "Aborting method");
527 acpi_os_printf("\n"); 527 acpi_os_printf("\n");
528 } else { 528 } else {
529 ACPI_ERROR_METHOD 529 ACPI_ERROR_METHOD("Aborting method",
530 ("Method parse/execution failed", 530 walk_state->method_node, NULL,
531 walk_state->method_node, NULL, status); 531 status);
532 } 532 }
533 acpi_ex_enter_interpreter(); 533 acpi_ex_enter_interpreter();
534 534
diff --git a/drivers/acpi/acpica/psscope.c b/drivers/acpi/acpica/psscope.c
index 00c67bc249aa..f153ca804740 100644
--- a/drivers/acpi/acpica/psscope.c
+++ b/drivers/acpi/acpica/psscope.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: psscope - Parser scope stack management routines 4 * Module Name: psscope - Parser scope stack management routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/pstree.c b/drivers/acpi/acpica/pstree.c
index 64a8329a17f1..22d8a2becdd0 100644
--- a/drivers/acpi/acpica/pstree.c
+++ b/drivers/acpi/acpica/pstree.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: pstree - Parser op tree manipulation/traversal/search 4 * Module Name: pstree - Parser op tree manipulation/traversal/search
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c
index ef8a5805a836..2512f584fa3c 100644
--- a/drivers/acpi/acpica/psutils.c
+++ b/drivers/acpi/acpica/psutils.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: psutils - Parser miscellaneous utilities (Parser only) 4 * Module Name: psutils - Parser miscellaneous utilities (Parser only)
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/pswalk.c b/drivers/acpi/acpica/pswalk.c
index bd6af8c87d48..cf91841297c2 100644
--- a/drivers/acpi/acpica/pswalk.c
+++ b/drivers/acpi/acpica/pswalk.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: pswalk - Parser routines to walk parsed op tree(s) 4 * Module Name: pswalk - Parser routines to walk parsed op tree(s)
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c
index 5743b22399a0..ee2ee2c858f2 100644
--- a/drivers/acpi/acpica/psxface.c
+++ b/drivers/acpi/acpica/psxface.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: psxface - Parser external interfaces 4 * Module Name: psxface - Parser external interfaces
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/rsdumpinfo.c b/drivers/acpi/acpica/rsdumpinfo.c
index 77a3263169fa..cafa8134b4c6 100644
--- a/drivers/acpi/acpica/rsdumpinfo.c
+++ b/drivers/acpi/acpica/rsdumpinfo.c
@@ -32,7 +32,7 @@ struct acpi_rsdump_info acpi_rs_dump_irq[7] = {
32 acpi_gbl_he_decode}, 32 acpi_gbl_he_decode},
33 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.polarity), "Polarity", 33 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(irq.polarity), "Polarity",
34 acpi_gbl_ll_decode}, 34 acpi_gbl_ll_decode},
35 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(irq.sharable), "Sharing", 35 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(irq.shareable), "Sharing",
36 acpi_gbl_shr_decode}, 36 acpi_gbl_shr_decode},
37 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.interrupt_count), 37 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(irq.interrupt_count),
38 "Interrupt Count", NULL}, 38 "Interrupt Count", NULL},
@@ -222,7 +222,7 @@ struct acpi_rsdump_info acpi_rs_dump_ext_irq[8] = {
222 "Triggering", acpi_gbl_he_decode}, 222 "Triggering", acpi_gbl_he_decode},
223 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.polarity), "Polarity", 223 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(extended_irq.polarity), "Polarity",
224 acpi_gbl_ll_decode}, 224 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",
226 acpi_gbl_shr_decode}, 226 acpi_gbl_shr_decode},
227 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(extended_irq.resource_source), NULL, 227 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(extended_irq.resource_source), NULL,
228 NULL}, 228 NULL},
@@ -255,7 +255,7 @@ struct acpi_rsdump_info acpi_rs_dump_gpio[16] = {
255 "ProducerConsumer", acpi_gbl_consume_decode}, 255 "ProducerConsumer", acpi_gbl_consume_decode},
256 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.pin_config), "PinConfig", 256 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.pin_config), "PinConfig",
257 acpi_gbl_ppc_decode}, 257 acpi_gbl_ppc_decode},
258 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.sharable), "Sharing", 258 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.shareable), "Sharing",
259 acpi_gbl_shr_decode}, 259 acpi_gbl_shr_decode},
260 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.io_restriction), 260 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.io_restriction),
261 "IoRestriction", acpi_gbl_ior_decode}, 261 "IoRestriction", acpi_gbl_ior_decode},
@@ -285,7 +285,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_function[10] = {
285 "RevisionId", NULL}, 285 "RevisionId", NULL},
286 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_function.pin_config), "PinConfig", 286 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_function.pin_config), "PinConfig",
287 acpi_gbl_ppc_decode}, 287 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",
289 acpi_gbl_shr_decode}, 289 acpi_gbl_shr_decode},
290 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.function_number), 290 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_function.function_number),
291 "FunctionNumber", NULL}, 291 "FunctionNumber", NULL},
@@ -308,7 +308,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_config[11] = {
308 NULL}, 308 NULL},
309 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.producer_consumer), 309 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_config.producer_consumer),
310 "ProducerConsumer", acpi_gbl_consume_decode}, 310 "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",
312 acpi_gbl_shr_decode}, 312 acpi_gbl_shr_decode},
313 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_config.pin_config_type), 313 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_config.pin_config_type),
314 "PinConfigType", NULL}, 314 "PinConfigType", NULL},
@@ -353,7 +353,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_group_function[9] = {
353 {ACPI_RSD_1BITFLAG, 353 {ACPI_RSD_1BITFLAG,
354 ACPI_RSD_OFFSET(pin_group_function.producer_consumer), 354 ACPI_RSD_OFFSET(pin_group_function.producer_consumer),
355 "ProducerConsumer", acpi_gbl_consume_decode}, 355 "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),
357 "Sharing", acpi_gbl_shr_decode}, 357 "Sharing", acpi_gbl_shr_decode},
358 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_function.function_number), 358 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(pin_group_function.function_number),
359 "FunctionNumber", NULL}, 359 "FunctionNumber", NULL},
@@ -375,7 +375,7 @@ struct acpi_rsdump_info acpi_rs_dump_pin_group_config[10] = {
375 "RevisionId", NULL}, 375 "RevisionId", NULL},
376 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.producer_consumer), 376 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(pin_group_config.producer_consumer),
377 "ProducerConsumer", acpi_gbl_consume_decode}, 377 "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),
379 "Sharing", acpi_gbl_shr_decode}, 379 "Sharing", acpi_gbl_shr_decode},
380 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_config.pin_config_type), 380 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(pin_group_config.pin_config_type),
381 "PinConfigType", NULL}, 381 "PinConfigType", NULL},
diff --git a/drivers/acpi/acpica/rsirq.c b/drivers/acpi/acpica/rsirq.c
index 134b67cd48ee..b0d970efa072 100644
--- a/drivers/acpi/acpica/rsirq.c
+++ b/drivers/acpi/acpica/rsirq.c
@@ -54,7 +54,7 @@ struct acpi_rsconvert_info acpi_rs_get_irq[9] = {
54 AML_OFFSET(irq.flags), 54 AML_OFFSET(irq.flags),
55 3}, 55 3},
56 56
57 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable), 57 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.shareable),
58 AML_OFFSET(irq.flags), 58 AML_OFFSET(irq.flags),
59 4}, 59 4},
60 60
@@ -92,7 +92,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[14] = {
92 AML_OFFSET(irq.flags), 92 AML_OFFSET(irq.flags),
93 3}, 93 3},
94 94
95 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable), 95 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.shareable),
96 AML_OFFSET(irq.flags), 96 AML_OFFSET(irq.flags),
97 4}, 97 4},
98 98
@@ -139,7 +139,7 @@ struct acpi_rsconvert_info acpi_rs_set_irq[14] = {
139 ACPI_ACTIVE_HIGH}, 139 ACPI_ACTIVE_HIGH},
140 140
141 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE, 141 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE,
142 ACPI_RS_OFFSET(data.irq.sharable), 142 ACPI_RS_OFFSET(data.irq.shareable),
143 ACPI_EXCLUSIVE}, 143 ACPI_EXCLUSIVE},
144 144
145 /* We can optimize to a 2-byte irq_no_flags() descriptor */ 145 /* 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] = {
178 AML_OFFSET(extended_irq.flags), 178 AML_OFFSET(extended_irq.flags),
179 2}, 179 2},
180 180
181 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable), 181 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.shareable),
182 AML_OFFSET(extended_irq.flags), 182 AML_OFFSET(extended_irq.flags),
183 3}, 183 3},
184 184
diff --git a/drivers/acpi/acpica/rsserial.c b/drivers/acpi/acpica/rsserial.c
index d073ebb51f90..1b937d88980f 100644
--- a/drivers/acpi/acpica/rsserial.c
+++ b/drivers/acpi/acpica/rsserial.c
@@ -39,7 +39,7 @@ struct acpi_rsconvert_info acpi_rs_convert_gpio[18] = {
39 AML_OFFSET(gpio.flags), 39 AML_OFFSET(gpio.flags),
40 0}, 40 0},
41 41
42 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.sharable), 42 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.shareable),
43 AML_OFFSET(gpio.int_flags), 43 AML_OFFSET(gpio.int_flags),
44 3}, 44 3},
45 45
@@ -128,7 +128,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_function[13] = {
128 AML_OFFSET(pin_function.revision_id), 128 AML_OFFSET(pin_function.revision_id),
129 1}, 129 1},
130 130
131 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_function.sharable), 131 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_function.shareable),
132 AML_OFFSET(pin_function.flags), 132 AML_OFFSET(pin_function.flags),
133 0}, 133 0},
134 134
@@ -518,7 +518,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_config[14] = {
518 AML_OFFSET(pin_config.revision_id), 518 AML_OFFSET(pin_config.revision_id),
519 1}, 519 1},
520 520
521 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_config.sharable), 521 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_config.shareable),
522 AML_OFFSET(pin_config.flags), 522 AML_OFFSET(pin_config.flags),
523 0}, 523 0},
524 524
@@ -658,7 +658,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_group_function[13] = {
658 AML_OFFSET(pin_group_function.revision_id), 658 AML_OFFSET(pin_group_function.revision_id),
659 1}, 659 1},
660 660
661 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_function.sharable), 661 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_function.shareable),
662 AML_OFFSET(pin_group_function.flags), 662 AML_OFFSET(pin_group_function.flags),
663 0}, 663 0},
664 664
@@ -735,7 +735,7 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_group_config[14] = {
735 AML_OFFSET(pin_group_config.revision_id), 735 AML_OFFSET(pin_group_config.revision_id),
736 1}, 736 1},
737 737
738 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_config.sharable), 738 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.pin_group_config.shareable),
739 AML_OFFSET(pin_group_config.flags), 739 AML_OFFSET(pin_group_config.flags),
740 0}, 740 0},
741 741
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c
index 862149c8a208..0cecd0039acf 100644
--- a/drivers/acpi/acpica/tbdata.c
+++ b/drivers/acpi/acpica/tbdata.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: tbdata - Table manager data structure functions 4 * Module Name: tbdata - Table manager data structure functions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 99d325a51816..0041bfba9abc 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: tbfadt - FADT table utilities 4 * Module Name: tbfadt - FADT table utilities
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -556,7 +556,7 @@ static void acpi_tb_convert_fadt(void)
556 * 64-bit X length field. 556 * 64-bit X length field.
557 * Note: If the legacy length field is > 0xFF bits, ignore 557 * Note: If the legacy length field is > 0xFF bits, ignore
558 * this check. (GPE registers can be larger than the 558 * 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).
560 */ 560 */
561 if ((ACPI_MUL_8(length) <= ACPI_UINT8_MAX) && 561 if ((ACPI_MUL_8(length) <= ACPI_UINT8_MAX) &&
562 (address64->bit_width != 562 (address64->bit_width !=
diff --git a/drivers/acpi/acpica/tbfind.c b/drivers/acpi/acpica/tbfind.c
index f00694b1d000..951bd8e1c50a 100644
--- a/drivers/acpi/acpica/tbfind.c
+++ b/drivers/acpi/acpica/tbfind.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: tbfind - find table 4 * Module Name: tbfind - find table
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index 5f8e7b561c90..be6642bf6366 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: tbinstal - ACPI table installation and removal 4 * Module Name: tbinstal - ACPI table installation and removal
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
index e303418a895b..9b5df95d881b 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: tbprint - Table output utilities 4 * Module Name: tbprint - Table output utilities
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index b526096560b5..2469e01310e2 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: tbutils - ACPI Table utilities 4 * Module Name: tbutils - ACPI Table utilities
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c
index e4d0dc8948cd..36592888f0e7 100644
--- a/drivers/acpi/acpica/tbxface.c
+++ b/drivers/acpi/acpica/tbxface.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: tbxface - ACPI table-oriented external interfaces 4 * Module Name: tbxface - ACPI table-oriented external interfaces
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -108,7 +108,7 @@ acpi_initialize_tables(struct acpi_table_desc *initial_table_array,
108 /* 108 /*
109 * Get the root table (RSDT or XSDT) and extract all entries to the local 109 * Get the root table (RSDT or XSDT) and extract all entries to the local
110 * Root Table Array. This array contains the information of the RSDT/XSDT 110 * 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.
112 */ 112 */
113 status = acpi_tb_parse_root_table(rsdp_address); 113 status = acpi_tb_parse_root_table(rsdp_address);
114 return_ACPI_STATUS(status); 114 return_ACPI_STATUS(status);
@@ -169,7 +169,7 @@ acpi_status ACPI_INIT_FUNCTION acpi_reallocate_root_table(void)
169 if (!acpi_gbl_enable_table_validation) { 169 if (!acpi_gbl_enable_table_validation) {
170 /* 170 /*
171 * Now it's safe to do full table validation. We can do deferred 171 * 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.
173 */ 173 */
174 acpi_gbl_enable_table_validation = TRUE; 174 acpi_gbl_enable_table_validation = TRUE;
175 for (i = 0; i < acpi_gbl_root_table_list.current_table_count; 175 for (i = 0; i < acpi_gbl_root_table_list.current_table_count;
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index 9011297552af..1a2592cc3245 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: tbxfload - Table load/unload external interfaces 4 * Module Name: tbxfload - Table load/unload external interfaces
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -69,23 +69,18 @@ acpi_status ACPI_INIT_FUNCTION acpi_load_tables(void)
69 "While loading namespace from ACPI tables")); 69 "While loading namespace from ACPI tables"));
70 } 70 }
71 71
72 if (acpi_gbl_execute_tables_as_methods) { 72 /*
73 /* 73 * Initialize the objects in the namespace that remain uninitialized.
74 * If the module-level code support is enabled, initialize the objects 74 * This runs the executable AML that may be part of the declaration of
75 * in the namespace that remain uninitialized. This runs the executable 75 * these name objects:
76 * AML that may be part of the declaration of these name objects: 76 * operation_regions, buffer_fields, Buffers, and Packages.
77 * operation_regions, buffer_fields, Buffers, and Packages. 77 *
78 * 78 */
79 * Note: The module-level code is optional at this time, but will 79 status = acpi_ns_initialize_objects();
80 * become the default in the future. 80 if (ACPI_SUCCESS(status)) {
81 */ 81 acpi_gbl_namespace_initialized = TRUE;
82 status = acpi_ns_initialize_objects();
83 if (ACPI_FAILURE(status)) {
84 return_ACPI_STATUS(status);
85 }
86 } 82 }
87 83
88 acpi_gbl_namespace_initialized = TRUE;
89 return_ACPI_STATUS(status); 84 return_ACPI_STATUS(status);
90} 85}
91 86
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index 483d0ce5180a..e2859d09ca2e 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: tbxfroot - Find the root ACPI table (RSDT) 4 * Module Name: tbxfroot - Find the root ACPI table (RSDT)
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c
index dbabe680ff58..bb260376bd59 100644
--- a/drivers/acpi/acpica/utaddress.c
+++ b/drivers/acpi/acpica/utaddress.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utaddress - op_region address range check 4 * Module Name: utaddress - op_region address range check
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utalloc.c b/drivers/acpi/acpica/utalloc.c
index 8cbcd7d6bd5e..d64da4d9e8d0 100644
--- a/drivers/acpi/acpica/utalloc.c
+++ b/drivers/acpi/acpica/utalloc.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utalloc - local memory allocation routines 4 * Module Name: utalloc - local memory allocation routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utascii.c b/drivers/acpi/acpica/utascii.c
index 04ff61e284f5..79d7426fd7bf 100644
--- a/drivers/acpi/acpica/utascii.c
+++ b/drivers/acpi/acpica/utascii.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utascii - Utility ascii functions 4 * Module Name: utascii - Utility ascii functions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utbuffer.c b/drivers/acpi/acpica/utbuffer.c
index fffa6f5ae59e..61db9967ebe4 100644
--- a/drivers/acpi/acpica/utbuffer.c
+++ b/drivers/acpi/acpica/utbuffer.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utbuffer - Buffer dump routines 4 * Module Name: utbuffer - Buffer dump routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utcache.c b/drivers/acpi/acpica/utcache.c
index 97d6ec174c28..8533fce7fa93 100644
--- a/drivers/acpi/acpica/utcache.c
+++ b/drivers/acpi/acpica/utcache.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utcache - local cache allocation routines 4 * Module Name: utcache - local cache allocation routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c
index a872ed7879ca..1fb8327f3c3b 100644
--- a/drivers/acpi/acpica/utcopy.c
+++ b/drivers/acpi/acpica/utcopy.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utcopy - Internal to external object translation utilities 4 * Module Name: utcopy - Internal to external object translation utilities
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index aabdc25effd9..01b1b36c8a8e 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utdebug - Debug print/trace routines 4 * Module Name: utdebug - Debug print/trace routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
index dad02b821e19..ad9f77eb554f 100644
--- a/drivers/acpi/acpica/utdecode.c
+++ b/drivers/acpi/acpica/utdecode.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utdecode - Utility decoding routines (value-to-string) 4 * Module Name: utdecode - Utility decoding routines (value-to-string)
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -284,7 +284,7 @@ const char *acpi_ut_get_node_name(void *object)
284 284
285static const char *acpi_gbl_desc_type_names[] = { 285static const char *acpi_gbl_desc_type_names[] = {
286 /* 00 */ "Not a Descriptor", 286 /* 00 */ "Not a Descriptor",
287 /* 01 */ "Cached", 287 /* 01 */ "Cached Object",
288 /* 02 */ "State-Generic", 288 /* 02 */ "State-Generic",
289 /* 03 */ "State-Update", 289 /* 03 */ "State-Update",
290 /* 04 */ "State-Package", 290 /* 04 */ "State-Package",
@@ -295,10 +295,10 @@ static const char *acpi_gbl_desc_type_names[] = {
295 /* 09 */ "State-Result", 295 /* 09 */ "State-Result",
296 /* 10 */ "State-Notify", 296 /* 10 */ "State-Notify",
297 /* 11 */ "State-Thread", 297 /* 11 */ "State-Thread",
298 /* 12 */ "Walk", 298 /* 12 */ "Tree Walk State",
299 /* 13 */ "Parser", 299 /* 13 */ "Parse Tree Op",
300 /* 14 */ "Operand", 300 /* 14 */ "Operand Object",
301 /* 15 */ "Node" 301 /* 15 */ "Namespace Node"
302}; 302};
303 303
304const char *acpi_ut_get_descriptor_name(void *object) 304const char *acpi_ut_get_descriptor_name(void *object)
@@ -430,8 +430,10 @@ static const char *acpi_gbl_generic_notify[ACPI_GENERIC_NOTIFY_MAX + 1] = {
430 /* 0C */ "Reserved (was previously Shutdown Request)", 430 /* 0C */ "Reserved (was previously Shutdown Request)",
431 /* Reserved in ACPI 6.0 */ 431 /* Reserved in ACPI 6.0 */
432 /* 0D */ "System Resource Affinity Update", 432 /* 0D */ "System Resource Affinity Update",
433 /* 0E */ "Heterogeneous Memory Attributes Update" 433 /* 0E */ "Heterogeneous Memory Attributes Update",
434 /* ACPI 6.2 */ 434 /* ACPI 6.2 */
435 /* 0F */ "Error Disconnect Recover"
436 /* ACPI 6.3 */
435}; 437};
436 438
437static const char *acpi_gbl_device_notify[5] = { 439static const char *acpi_gbl_device_notify[5] = {
@@ -461,13 +463,13 @@ static const char *acpi_gbl_thermal_notify[5] = {
461const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type) 463const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type)
462{ 464{
463 465
464 /* 00 - 0D are "common to all object types" (from ACPI Spec) */ 466 /* 00 - 0F are "common to all object types" (from ACPI Spec) */
465 467
466 if (notify_value <= ACPI_GENERIC_NOTIFY_MAX) { 468 if (notify_value <= ACPI_GENERIC_NOTIFY_MAX) {
467 return (acpi_gbl_generic_notify[notify_value]); 469 return (acpi_gbl_generic_notify[notify_value]);
468 } 470 }
469 471
470 /* 0E - 7F are reserved */ 472 /* 10 - 7F are reserved */
471 473
472 if (notify_value <= ACPI_MAX_SYS_NOTIFY) { 474 if (notify_value <= ACPI_MAX_SYS_NOTIFY) {
473 return ("Reserved"); 475 return ("Reserved");
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c
index 8cc4392c61f3..eee263cb7beb 100644
--- a/drivers/acpi/acpica/utdelete.c
+++ b/drivers/acpi/acpica/utdelete.c
@@ -257,6 +257,10 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
257 257
258 acpi_ut_delete_object_desc(second_desc); 258 acpi_ut_delete_object_desc(second_desc);
259 } 259 }
260 if (object->field.internal_pcc_buffer) {
261 ACPI_FREE(object->field.internal_pcc_buffer);
262 }
263
260 break; 264 break;
261 265
262 case ACPI_TYPE_BUFFER_FIELD: 266 case ACPI_TYPE_BUFFER_FIELD:
diff --git a/drivers/acpi/acpica/uterror.c b/drivers/acpi/acpica/uterror.c
index e47430272692..075457341bad 100644
--- a/drivers/acpi/acpica/uterror.c
+++ b/drivers/acpi/acpica/uterror.c
@@ -183,19 +183,19 @@ acpi_ut_prefixed_namespace_error(const char *module_name,
183 case AE_ALREADY_EXISTS: 183 case AE_ALREADY_EXISTS:
184 184
185 acpi_os_printf(ACPI_MSG_BIOS_ERROR); 185 acpi_os_printf(ACPI_MSG_BIOS_ERROR);
186 message = "Failure creating"; 186 message = "Failure creating named object";
187 break; 187 break;
188 188
189 case AE_NOT_FOUND: 189 case AE_NOT_FOUND:
190 190
191 acpi_os_printf(ACPI_MSG_BIOS_ERROR); 191 acpi_os_printf(ACPI_MSG_BIOS_ERROR);
192 message = "Could not resolve"; 192 message = "Could not resolve symbol";
193 break; 193 break;
194 194
195 default: 195 default:
196 196
197 acpi_os_printf(ACPI_MSG_ERROR); 197 acpi_os_printf(ACPI_MSG_ERROR);
198 message = "Failure resolving"; 198 message = "Failure resolving symbol";
199 break; 199 break;
200 } 200 }
201 201
@@ -317,7 +317,8 @@ acpi_ut_method_error(const char *module_name,
317 } 317 }
318 318
319 acpi_ns_print_node_pathname(node, message); 319 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));
321 322
322 ACPI_MSG_SUFFIX; 323 ACPI_MSG_SUFFIX;
323 ACPI_MSG_REDIRECT_END; 324 ACPI_MSG_REDIRECT_END;
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c
index c56ae6e058d5..558a9f3b0678 100644
--- a/drivers/acpi/acpica/uteval.c
+++ b/drivers/acpi/acpica/uteval.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: uteval - Object evaluation 4 * Module Name: uteval - Object evaluation
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index f8c5b49344df..b0622ec4bb85 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utglobal - Global variables for the ACPI subsystem 4 * Module Name: utglobal - Global variables for the ACPI subsystem
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/uthex.c b/drivers/acpi/acpica/uthex.c
index 3d63a9e8da4f..b6da135d5f41 100644
--- a/drivers/acpi/acpica/uthex.c
+++ b/drivers/acpi/acpica/uthex.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: uthex -- Hex/ASCII support functions 4 * Module Name: uthex -- Hex/ASCII support functions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utids.c b/drivers/acpi/acpica/utids.c
index 70e6bf1107a1..e805abdd95b8 100644
--- a/drivers/acpi/acpica/utids.c
+++ b/drivers/acpi/acpica/utids.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utids - support for device Ids - HID, UID, CID, SUB, CLS 4 * Module Name: utids - support for device Ids - HID, UID, CID, SUB, CLS
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utinit.c b/drivers/acpi/acpica/utinit.c
index 0646ed62b351..bc124591320e 100644
--- a/drivers/acpi/acpica/utinit.c
+++ b/drivers/acpi/acpica/utinit.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utinit - Common ACPI subsystem initialization 4 * Module Name: utinit - Common ACPI subsystem initialization
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utlock.c b/drivers/acpi/acpica/utlock.c
index d61e01bd01a3..8b4ff11d617a 100644
--- a/drivers/acpi/acpica/utlock.c
+++ b/drivers/acpi/acpica/utlock.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utlock - Reader/Writer lock interfaces 4 * Module Name: utlock - Reader/Writer lock interfaces
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c
index ae6d8cc18cec..eee97a902696 100644
--- a/drivers/acpi/acpica/utobject.c
+++ b/drivers/acpi/acpica/utobject.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utobject - ACPI object create/delete/size/cache routines 4 * Module Name: utobject - ACPI object create/delete/size/cache routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c
index 902a47463abf..688c61a90725 100644
--- a/drivers/acpi/acpica/utosi.c
+++ b/drivers/acpi/acpica/utosi.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utosi - Support for the _OSI predefined control method 4 * Module Name: utosi - Support for the _OSI predefined control method
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utpredef.c b/drivers/acpi/acpica/utpredef.c
index 65ca9807c2a8..a9f08f43c685 100644
--- a/drivers/acpi/acpica/utpredef.c
+++ b/drivers/acpi/acpica/utpredef.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utpredef - support functions for predefined names 4 * Module Name: utpredef - support functions for predefined names
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utprint.c b/drivers/acpi/acpica/utprint.c
index a98c334c3bb7..5839f2fa7400 100644
--- a/drivers/acpi/acpica/utprint.c
+++ b/drivers/acpi/acpica/utprint.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utprint - Formatted printing routines 4 * Module Name: utprint - Formatted printing routines
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c
index 016a6621cc6f..8052f7ef5025 100644
--- a/drivers/acpi/acpica/uttrack.c
+++ b/drivers/acpi/acpica/uttrack.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: uttrack - Memory allocation tracking routines (debug only) 4 * Module Name: uttrack - Memory allocation tracking routines (debug only)
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -588,6 +588,18 @@ void acpi_ut_dump_allocations(u32 component, const char *module)
588 acpi_ut_get_descriptor_name 588 acpi_ut_get_descriptor_name
589 (descriptor)); 589 (descriptor));
590 590
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
591 /* Validate the descriptor type using Type field and length */ 603 /* Validate the descriptor type using Type field and length */
592 604
593 descriptor_type = 0; /* Not a valid descriptor type */ 605 descriptor_type = 0; /* Not a valid descriptor type */
diff --git a/drivers/acpi/acpica/utuuid.c b/drivers/acpi/acpica/utuuid.c
index 59ae118092a3..0a7cf8007643 100644
--- a/drivers/acpi/acpica/utuuid.c
+++ b/drivers/acpi/acpica/utuuid.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utuuid -- UUID support functions 4 * Module Name: utuuid -- UUID support functions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index d2d6cc065181..f497c4b30e65 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utxface - External interfaces, miscellaneous utility functions 4 * Module Name: utxface - External interfaces, miscellaneous utility functions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c
index 6bb85d691fcb..a1ed7fced4db 100644
--- a/drivers/acpi/acpica/utxferror.c
+++ b/drivers/acpi/acpica/utxferror.c
@@ -187,6 +187,50 @@ ACPI_EXPORT_SYMBOL(acpi_bios_error)
187 187
188/******************************************************************************* 188/*******************************************************************************
189 * 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 ******************************************************************************/
203void ACPI_INTERNAL_VAR_XFACE
204acpi_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
230ACPI_EXPORT_SYMBOL(acpi_bios_exception)
231
232/*******************************************************************************
233 *
190 * FUNCTION: acpi_bios_warning 234 * FUNCTION: acpi_bios_warning
191 * 235 *
192 * PARAMETERS: module_name - Caller's module name (for warning output) 236 * PARAMETERS: module_name - Caller's module name (for warning output)
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index e3c60f57c9f0..9f3b1e3a09de 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: utxfinit - External interfaces for ACPICA initialization 4 * Module Name: utxfinit - External interfaces for ACPICA initialization
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig
index 52ae5438edeb..6b18f8bc7be3 100644
--- a/drivers/acpi/apei/Kconfig
+++ b/drivers/acpi/apei/Kconfig
@@ -41,19 +41,9 @@ config ACPI_APEI_PCIEAER
41 Turn on this option to enable the corresponding support. 41 Turn on this option to enable the corresponding support.
42 42
43config ACPI_APEI_SEA 43config ACPI_APEI_SEA
44 bool "APEI Synchronous External Abort logging/recovering support" 44 bool
45 depends on ARM64 && ACPI_APEI_GHES 45 depends on ARM64 && ACPI_APEI_GHES
46 default y 46 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.
57 47
58config ACPI_APEI_MEMORY_FAILURE 48config ACPI_APEI_MEMORY_FAILURE
59 bool "APEI memory error recovering support" 49 bool "APEI memory error recovering support"
diff --git a/drivers/acpi/apei/bert.c b/drivers/acpi/apei/bert.c
index 12771fcf0417..0d948d0a41af 100644
--- a/drivers/acpi/apei/bert.c
+++ b/drivers/acpi/apei/bert.c
@@ -42,15 +42,7 @@ static void __init bert_print_all(struct acpi_bert_region *region,
42 int remain = region_len; 42 int remain = region_len;
43 u32 estatus_len; 43 u32 estatus_len;
44 44
45 if (!estatus->block_status) 45 while (remain >= sizeof(struct acpi_bert_region)) {
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
54 estatus_len = cper_estatus_len(estatus); 46 estatus_len = cper_estatus_len(estatus);
55 if (remain < estatus_len) { 47 if (remain < estatus_len) {
56 pr_err(FW_BUG "Truncated status block (length: %u).\n", 48 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,
58 return; 50 return;
59 } 51 }
60 52
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
61 pr_info_once("Error records from previous boot:\n"); 62 pr_info_once("Error records from previous boot:\n");
62 63
63 cper_estatus_print(KERN_INFO HW_ERR, estatus); 64 cper_estatus_print(KERN_INFO HW_ERR, estatus);
@@ -70,10 +71,6 @@ static void __init bert_print_all(struct acpi_bert_region *region,
70 estatus->block_status = 0; 71 estatus->block_status = 0;
71 72
72 estatus = (void *)estatus + estatus_len; 73 estatus = (void *)estatus + estatus_len;
73 /* No more error records. */
74 if (!estatus->block_status)
75 return;
76
77 remain -= estatus_len; 74 remain -= estatus_len;
78 } 75 }
79} 76}
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index fcccbfdbdd1a..2d4be94f8c00 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -644,8 +644,8 @@ static int error_type_set(void *data, u64 val)
644 return 0; 644 return 0;
645} 645}
646 646
647DEFINE_SIMPLE_ATTRIBUTE(error_type_fops, error_type_get, 647DEFINE_DEBUGFS_ATTRIBUTE(error_type_fops, error_type_get, error_type_set,
648 error_type_set, "0x%llx\n"); 648 "0x%llx\n");
649 649
650static int error_inject_set(void *data, u64 val) 650static int error_inject_set(void *data, u64 val)
651{ 651{
@@ -656,8 +656,7 @@ static int error_inject_set(void *data, u64 val)
656 error_param3, error_param4); 656 error_param3, error_param4);
657} 657}
658 658
659DEFINE_SIMPLE_ATTRIBUTE(error_inject_fops, NULL, 659DEFINE_DEBUGFS_ATTRIBUTE(error_inject_fops, NULL, error_inject_set, "%llu\n");
660 error_inject_set, "%llu\n");
661 660
662static int einj_check_table(struct acpi_table_einj *einj_tab) 661static int einj_check_table(struct acpi_table_einj *einj_tab)
663{ 662{
@@ -679,7 +678,6 @@ static int __init einj_init(void)
679{ 678{
680 int rc; 679 int rc;
681 acpi_status status; 680 acpi_status status;
682 struct dentry *fentry;
683 struct apei_exec_context ctx; 681 struct apei_exec_context ctx;
684 682
685 if (acpi_disabled) { 683 if (acpi_disabled) {
@@ -707,25 +705,13 @@ static int __init einj_init(void)
707 705
708 rc = -ENOMEM; 706 rc = -ENOMEM;
709 einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir()); 707 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 }
714 708
715 fentry = debugfs_create_file("available_error_type", S_IRUSR, 709 debugfs_create_file("available_error_type", S_IRUSR, einj_debug_dir,
716 einj_debug_dir, NULL, 710 NULL, &available_error_type_fops);
717 &available_error_type_fops); 711 debugfs_create_file_unsafe("error_type", 0600, einj_debug_dir,
718 if (!fentry) 712 NULL, &error_type_fops);
719 goto err_cleanup; 713 debugfs_create_file_unsafe("error_inject", 0200, einj_debug_dir,
720 714 NULL, &error_inject_fops);
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;
729 715
730 apei_resources_init(&einj_resources); 716 apei_resources_init(&einj_resources);
731 einj_exec_ctx_init(&ctx); 717 einj_exec_ctx_init(&ctx);
@@ -750,66 +736,37 @@ static int __init einj_init(void)
750 rc = -ENOMEM; 736 rc = -ENOMEM;
751 einj_param = einj_get_parameter_address(); 737 einj_param = einj_get_parameter_address();
752 if ((param_extension || acpi5) && einj_param) { 738 if ((param_extension || acpi5) && einj_param) {
753 fentry = debugfs_create_x32("flags", S_IRUSR | S_IWUSR, 739 debugfs_create_x32("flags", S_IRUSR | S_IWUSR, einj_debug_dir,
754 einj_debug_dir, &error_flags); 740 &error_flags);
755 if (!fentry) 741 debugfs_create_x64("param1", S_IRUSR | S_IWUSR, einj_debug_dir,
756 goto err_unmap; 742 &error_param1);
757 fentry = debugfs_create_x64("param1", S_IRUSR | S_IWUSR, 743 debugfs_create_x64("param2", S_IRUSR | S_IWUSR, einj_debug_dir,
758 einj_debug_dir, &error_param1); 744 &error_param2);
759 if (!fentry) 745 debugfs_create_x64("param3", S_IRUSR | S_IWUSR, einj_debug_dir,
760 goto err_unmap; 746 &error_param3);
761 fentry = debugfs_create_x64("param2", S_IRUSR | S_IWUSR, 747 debugfs_create_x64("param4", S_IRUSR | S_IWUSR, einj_debug_dir,
762 einj_debug_dir, &error_param2); 748 &error_param4);
763 if (!fentry) 749 debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
764 goto err_unmap; 750 einj_debug_dir, &notrigger);
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;
778 } 751 }
779 752
780 if (vendor_dev[0]) { 753 if (vendor_dev[0]) {
781 vendor_blob.data = vendor_dev; 754 vendor_blob.data = vendor_dev;
782 vendor_blob.size = strlen(vendor_dev); 755 vendor_blob.size = strlen(vendor_dev);
783 fentry = debugfs_create_blob("vendor", S_IRUSR, 756 debugfs_create_blob("vendor", S_IRUSR, einj_debug_dir,
784 einj_debug_dir, &vendor_blob); 757 &vendor_blob);
785 if (!fentry) 758 debugfs_create_x32("vendor_flags", S_IRUSR | S_IWUSR,
786 goto err_unmap; 759 einj_debug_dir, &vendor_flags);
787 fentry = debugfs_create_x32("vendor_flags", S_IRUSR | S_IWUSR,
788 einj_debug_dir, &vendor_flags);
789 if (!fentry)
790 goto err_unmap;
791 } 760 }
792 761
793 pr_info("Error INJection is initialized.\n"); 762 pr_info("Error INJection is initialized.\n");
794 763
795 return 0; 764 return 0;
796 765
797err_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);
807err_release: 766err_release:
808 apei_resources_release(&einj_resources); 767 apei_resources_release(&einj_resources);
809err_fini: 768err_fini:
810 apei_resources_fini(&einj_resources); 769 apei_resources_fini(&einj_resources);
811err_cleanup:
812 pr_err("Error creating primary debugfs nodes.\n");
813 debugfs_remove_recursive(einj_debug_dir); 770 debugfs_remove_recursive(einj_debug_dir);
814 771
815 return rc; 772 return rc;
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index 9953e50667ec..389d88e35ffb 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -938,17 +938,17 @@ static struct pstore_info erst_info = {
938}; 938};
939 939
940#define CPER_CREATOR_PSTORE \ 940#define CPER_CREATOR_PSTORE \
941 UUID_LE(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c, \ 941 GUID_INIT(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c, \
942 0x64, 0x90, 0xb8, 0x9d) 942 0x64, 0x90, 0xb8, 0x9d)
943#define CPER_SECTION_TYPE_DMESG \ 943#define CPER_SECTION_TYPE_DMESG \
944 UUID_LE(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54, \ 944 GUID_INIT(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54, \
945 0x94, 0x19, 0xeb, 0x12) 945 0x94, 0x19, 0xeb, 0x12)
946#define CPER_SECTION_TYPE_DMESG_Z \ 946#define CPER_SECTION_TYPE_DMESG_Z \
947 UUID_LE(0x4f118707, 0x04dd, 0x4055, 0xb5, 0xdd, 0x95, 0x6d, \ 947 GUID_INIT(0x4f118707, 0x04dd, 0x4055, 0xb5, 0xdd, 0x95, 0x6d, \
948 0x34, 0xdd, 0xfa, 0xc6) 948 0x34, 0xdd, 0xfa, 0xc6)
949#define CPER_SECTION_TYPE_MCE \ 949#define CPER_SECTION_TYPE_MCE \
950 UUID_LE(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \ 950 GUID_INIT(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \
951 0x04, 0x4a, 0x38, 0xfc) 951 0x04, 0x4a, 0x38, 0xfc)
952 952
953struct cper_pstore_record { 953struct cper_pstore_record {
954 struct cper_record_header hdr; 954 struct cper_record_header hdr;
@@ -1012,7 +1012,7 @@ skip:
1012 rc = -EIO; 1012 rc = -EIO;
1013 goto out; 1013 goto out;
1014 } 1014 }
1015 if (uuid_le_cmp(rcd->hdr.creator_id, CPER_CREATOR_PSTORE) != 0) 1015 if (!guid_equal(&rcd->hdr.creator_id, &CPER_CREATOR_PSTORE))
1016 goto skip; 1016 goto skip;
1017 1017
1018 record->buf = kmalloc(len, GFP_KERNEL); 1018 record->buf = kmalloc(len, GFP_KERNEL);
@@ -1024,15 +1024,12 @@ skip:
1024 record->id = record_id; 1024 record->id = record_id;
1025 record->compressed = false; 1025 record->compressed = false;
1026 record->ecc_notice_size = 0; 1026 record->ecc_notice_size = 0;
1027 if (uuid_le_cmp(rcd->sec_hdr.section_type, 1027 if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG_Z)) {
1028 CPER_SECTION_TYPE_DMESG_Z) == 0) {
1029 record->type = PSTORE_TYPE_DMESG; 1028 record->type = PSTORE_TYPE_DMESG;
1030 record->compressed = true; 1029 record->compressed = true;
1031 } else if (uuid_le_cmp(rcd->sec_hdr.section_type, 1030 } else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG))
1032 CPER_SECTION_TYPE_DMESG) == 0)
1033 record->type = PSTORE_TYPE_DMESG; 1031 record->type = PSTORE_TYPE_DMESG;
1034 else if (uuid_le_cmp(rcd->sec_hdr.section_type, 1032 else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_MCE))
1035 CPER_SECTION_TYPE_MCE) == 0)
1036 record->type = PSTORE_TYPE_MCE; 1033 record->type = PSTORE_TYPE_MCE;
1037 else 1034 else
1038 record->type = PSTORE_TYPE_MAX; 1035 record->type = PSTORE_TYPE_MAX;
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index f008ba7c9ced..0b5ae91fd0fb 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -25,6 +25,7 @@
25 * GNU General Public License for more details. 25 * GNU General Public License for more details.
26 */ 26 */
27 27
28#include <linux/arm_sdei.h>
28#include <linux/kernel.h> 29#include <linux/kernel.h>
29#include <linux/moduleparam.h> 30#include <linux/moduleparam.h>
30#include <linux/init.h> 31#include <linux/init.h>
@@ -33,7 +34,6 @@
33#include <linux/interrupt.h> 34#include <linux/interrupt.h>
34#include <linux/timer.h> 35#include <linux/timer.h>
35#include <linux/cper.h> 36#include <linux/cper.h>
36#include <linux/kdebug.h>
37#include <linux/platform_device.h> 37#include <linux/platform_device.h>
38#include <linux/mutex.h> 38#include <linux/mutex.h>
39#include <linux/ratelimit.h> 39#include <linux/ratelimit.h>
@@ -42,6 +42,7 @@
42#include <linux/llist.h> 42#include <linux/llist.h>
43#include <linux/genalloc.h> 43#include <linux/genalloc.h>
44#include <linux/pci.h> 44#include <linux/pci.h>
45#include <linux/pfn.h>
45#include <linux/aer.h> 46#include <linux/aer.h>
46#include <linux/nmi.h> 47#include <linux/nmi.h>
47#include <linux/sched/clock.h> 48#include <linux/sched/clock.h>
@@ -85,6 +86,15 @@
85 ((struct acpi_hest_generic_status *) \ 86 ((struct acpi_hest_generic_status *) \
86 ((struct ghes_estatus_node *)(estatus_node) + 1)) 87 ((struct ghes_estatus_node *)(estatus_node) + 1))
87 88
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
88static inline bool is_hest_type_generic_v2(struct ghes *ghes) 98static inline bool is_hest_type_generic_v2(struct ghes *ghes)
89{ 99{
90 return ghes->generic->header.type == ACPI_HEST_TYPE_GENERIC_ERROR_V2; 100 return ghes->generic->header.type == ACPI_HEST_TYPE_GENERIC_ERROR_V2;
@@ -115,11 +125,10 @@ static DEFINE_MUTEX(ghes_list_mutex);
115 * handler, but general ioremap can not be used in atomic context, so 125 * handler, but general ioremap can not be used in atomic context, so
116 * the fixmap is used instead. 126 * the fixmap is used instead.
117 * 127 *
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
119 * simultaneously. 129 * simultaneously.
120 */ 130 */
121static DEFINE_RAW_SPINLOCK(ghes_ioremap_lock_nmi); 131static DEFINE_SPINLOCK(ghes_notify_lock_irq);
122static DEFINE_SPINLOCK(ghes_ioremap_lock_irq);
123 132
124static struct gen_pool *ghes_estatus_pool; 133static struct gen_pool *ghes_estatus_pool;
125static unsigned long ghes_estatus_pool_size_request; 134static unsigned long ghes_estatus_pool_size_request;
@@ -129,82 +138,49 @@ static atomic_t ghes_estatus_cache_alloced;
129 138
130static int ghes_panic_timeout __read_mostly = 30; 139static int ghes_panic_timeout __read_mostly = 30;
131 140
132static void __iomem *ghes_ioremap_pfn_nmi(u64 pfn) 141static void __iomem *ghes_map(u64 pfn, enum fixed_addresses fixmap_idx)
133{ 142{
134 phys_addr_t paddr; 143 phys_addr_t paddr;
135 pgprot_t prot; 144 pgprot_t prot;
136 145
137 paddr = pfn << PAGE_SHIFT; 146 paddr = PFN_PHYS(pfn);
138 prot = arch_apei_get_mem_attribute(paddr); 147 prot = arch_apei_get_mem_attribute(paddr);
139 __set_fixmap(FIX_APEI_GHES_NMI, paddr, prot); 148 __set_fixmap(fixmap_idx, paddr, prot);
140 149
141 return (void __iomem *) fix_to_virt(FIX_APEI_GHES_NMI); 150 return (void __iomem *) __fix_to_virt(fixmap_idx);
142} 151}
143 152
144static void __iomem *ghes_ioremap_pfn_irq(u64 pfn) 153static void ghes_unmap(void __iomem *vaddr, enum fixed_addresses fixmap_idx)
145{ 154{
146 phys_addr_t paddr; 155 int _idx = virt_to_fix((unsigned long)vaddr);
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 156
156static void ghes_iounmap_nmi(void) 157 WARN_ON_ONCE(fixmap_idx != _idx);
157{ 158 clear_fixmap(fixmap_idx);
158 clear_fixmap(FIX_APEI_GHES_NMI);
159} 159}
160 160
161static void ghes_iounmap_irq(void) 161int ghes_estatus_pool_init(int num_ghes)
162{ 162{
163 clear_fixmap(FIX_APEI_GHES_IRQ); 163 unsigned long addr, len;
164}
165 164
166static int ghes_estatus_pool_init(void)
167{
168 ghes_estatus_pool = gen_pool_create(GHES_ESTATUS_POOL_MIN_ALLOC_ORDER, -1); 165 ghes_estatus_pool = gen_pool_create(GHES_ESTATUS_POOL_MIN_ALLOC_ORDER, -1);
169 if (!ghes_estatus_pool) 166 if (!ghes_estatus_pool)
170 return -ENOMEM; 167 return -ENOMEM;
171 return 0;
172}
173 168
174static void ghes_estatus_pool_free_chunk_page(struct gen_pool *pool, 169 len = GHES_ESTATUS_CACHE_AVG_SIZE * GHES_ESTATUS_CACHE_ALLOCED_MAX;
175 struct gen_pool_chunk *chunk, 170 len += (num_ghes * GHES_ESOURCE_PREALLOC_MAX_SIZE);
176 void *data)
177{
178 free_page(chunk->start_addr);
179}
180
181static 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}
187 171
188static int ghes_estatus_pool_expand(unsigned long len) 172 ghes_estatus_pool_size_request = PAGE_ALIGN(len);
189{ 173 addr = (unsigned long)vmalloc(PAGE_ALIGN(len));
190 unsigned long i, pages, size, addr; 174 if (!addr)
191 int ret; 175 return -ENOMEM;
192 176
193 ghes_estatus_pool_size_request += PAGE_ALIGN(len); 177 /*
194 size = gen_pool_size(ghes_estatus_pool); 178 * New allocation must be visible in all pgd before it can be found by
195 if (size >= ghes_estatus_pool_size_request) 179 * an NMI allocating from the pool.
196 return 0; 180 */
197 pages = (ghes_estatus_pool_size_request - size) / PAGE_SIZE; 181 vmalloc_sync_all();
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 }
206 182
207 return 0; 183 return gen_pool_add(ghes_estatus_pool, addr, PAGE_ALIGN(len), -1);
208} 184}
209 185
210static int map_gen_v2(struct ghes *ghes) 186static int map_gen_v2(struct ghes *ghes)
@@ -217,6 +193,21 @@ static void unmap_gen_v2(struct ghes *ghes)
217 apei_unmap_generic_address(&ghes->generic_v2->read_ack_register); 193 apei_unmap_generic_address(&ghes->generic_v2->read_ack_register);
218} 194}
219 195
196static 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
220static struct ghes *ghes_new(struct acpi_hest_generic *generic) 211static struct ghes *ghes_new(struct acpi_hest_generic *generic)
221{ 212{
222 struct ghes *ghes; 213 struct ghes *ghes;
@@ -289,23 +280,16 @@ static inline int ghes_severity(int severity)
289} 280}
290 281
291static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len, 282static 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)
293{ 285{
294 void __iomem *vaddr; 286 void __iomem *vaddr;
295 unsigned long flags = 0;
296 int in_nmi = in_nmi();
297 u64 offset; 287 u64 offset;
298 u32 trunk; 288 u32 trunk;
299 289
300 while (len > 0) { 290 while (len > 0) {
301 offset = paddr - (paddr & PAGE_MASK); 291 offset = paddr - (paddr & PAGE_MASK);
302 if (in_nmi) { 292 vaddr = ghes_map(PHYS_PFN(paddr), fixmap_idx);
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 }
309 trunk = PAGE_SIZE - offset; 293 trunk = PAGE_SIZE - offset;
310 trunk = min(trunk, len); 294 trunk = min(trunk, len);
311 if (from_phys) 295 if (from_phys)
@@ -315,72 +299,114 @@ static void ghes_copy_tofrom_phys(void *buffer, u64 paddr, u32 len,
315 len -= trunk; 299 len -= trunk;
316 paddr += trunk; 300 paddr += trunk;
317 buffer += trunk; 301 buffer += trunk;
318 if (in_nmi) { 302 ghes_unmap(vaddr, fixmap_idx);
319 ghes_iounmap_nmi(); 303 }
320 raw_spin_unlock(&ghes_ioremap_lock_nmi); 304}
321 } else { 305
322 ghes_iounmap_irq(); 306/* Check the top-level record header has an appropriate size. */
323 spin_unlock_irqrestore(&ghes_ioremap_lock_irq, flags); 307static int __ghes_check_estatus(struct ghes *ghes,
324 } 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;
325 } 325 }
326
327 return 0;
326} 328}
327 329
328static int ghes_read_estatus(struct ghes *ghes, int silent) 330/* Read the CPER block, returning its address, and header in estatus. */
331static int __ghes_peek_estatus(struct ghes *ghes,
332 struct acpi_hest_generic_status *estatus,
333 u64 *buf_paddr, enum fixed_addresses fixmap_idx)
329{ 334{
330 struct acpi_hest_generic *g = ghes->generic; 335 struct acpi_hest_generic *g = ghes->generic;
331 u64 buf_paddr;
332 u32 len;
333 int rc; 336 int rc;
334 337
335 rc = apei_read(&buf_paddr, &g->error_status_address); 338 rc = apei_read(buf_paddr, &g->error_status_address);
336 if (rc) { 339 if (rc) {
337 if (!silent && printk_ratelimit()) 340 *buf_paddr = 0;
338 pr_warning(FW_WARN GHES_PFX 341 pr_warn_ratelimited(FW_WARN GHES_PFX
339"Failed to read error status block address for hardware error source: %d.\n", 342"Failed to read error status block address for hardware error source: %d.\n",
340 g->header.source_id); 343 g->header.source_id);
341 return -EIO; 344 return -EIO;
342 } 345 }
343 if (!buf_paddr) 346 if (!*buf_paddr)
344 return -ENOENT; 347 return -ENOENT;
345 348
346 ghes_copy_tofrom_phys(ghes->estatus, buf_paddr, 349 ghes_copy_tofrom_phys(estatus, *buf_paddr, sizeof(*estatus), 1,
347 sizeof(*ghes->estatus), 1); 350 fixmap_idx);
348 if (!ghes->estatus->block_status) 351 if (!estatus->block_status) {
352 *buf_paddr = 0;
349 return -ENOENT; 353 return -ENOENT;
354 }
350 355
351 ghes->buffer_paddr = buf_paddr; 356 return __ghes_check_estatus(ghes, estatus);
352 ghes->flags |= GHES_TO_CLEAR; 357}
353 358
354 rc = -EIO; 359static int __ghes_read_estatus(struct acpi_hest_generic_status *estatus,
355 len = cper_estatus_len(ghes->estatus); 360 u64 buf_paddr, enum fixed_addresses fixmap_idx,
356 if (len < sizeof(*ghes->estatus)) 361 size_t buf_len)
357 goto err_read_block; 362{
358 if (len > ghes->generic->error_block_length) 363 ghes_copy_tofrom_phys(estatus, buf_paddr, buf_len, 1, fixmap_idx);
359 goto err_read_block; 364 if (cper_estatus_check(estatus)) {
360 if (cper_estatus_check_header(ghes->estatus)) 365 pr_warn_ratelimited(FW_WARN GHES_PFX
361 goto err_read_block; 366 "Failed to read error status block!\n");
362 ghes_copy_tofrom_phys(ghes->estatus + 1, 367 return -EIO;
363 buf_paddr + sizeof(*ghes->estatus), 368 }
364 len - sizeof(*ghes->estatus), 1); 369
365 if (cper_estatus_check(ghes->estatus)) 370 return 0;
366 goto err_read_block;
367 rc = 0;
368
369err_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;
374} 371}
375 372
376static void ghes_clear_estatus(struct ghes *ghes) 373static int ghes_read_estatus(struct ghes *ghes,
374 struct acpi_hest_generic_status *estatus,
375 u64 *buf_paddr, enum fixed_addresses fixmap_idx)
377{ 376{
378 ghes->estatus->block_status = 0; 377 int rc;
379 if (!(ghes->flags & GHES_TO_CLEAR)) 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
391static 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)
380 return; 398 return;
381 ghes_copy_tofrom_phys(ghes->estatus, ghes->buffer_paddr, 399
382 sizeof(ghes->estatus->block_status), 0); 400 ghes_copy_tofrom_phys(estatus, buf_paddr,
383 ghes->flags &= ~GHES_TO_CLEAR; 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);
384} 410}
385 411
386static void ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, int sev) 412static void ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, int sev)
@@ -672,26 +698,13 @@ static void ghes_estatus_cache_add(
672 rcu_read_unlock(); 698 rcu_read_unlock();
673} 699}
674 700
675static int ghes_ack_error(struct acpi_hest_generic_v2 *gv2) 701static void __ghes_panic(struct ghes *ghes,
702 struct acpi_hest_generic_status *estatus,
703 u64 buf_paddr, enum fixed_addresses fixmap_idx)
676{ 704{
677 int rc; 705 __ghes_print_estatus(KERN_EMERG, ghes->generic, estatus);
678 u64 val = 0;
679 706
680 rc = apei_read(&val, &gv2->read_ack_register); 707 ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx);
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
690static void __ghes_panic(struct ghes *ghes)
691{
692 __ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus);
693
694 ghes_clear_estatus(ghes);
695 708
696 /* reboot to log the error! */ 709 /* reboot to log the error! */
697 if (!panic_timeout) 710 if (!panic_timeout)
@@ -701,34 +714,25 @@ static void __ghes_panic(struct ghes *ghes)
701 714
702static int ghes_proc(struct ghes *ghes) 715static int ghes_proc(struct ghes *ghes)
703{ 716{
717 struct acpi_hest_generic_status *estatus = ghes->estatus;
718 u64 buf_paddr;
704 int rc; 719 int rc;
705 720
706 rc = ghes_read_estatus(ghes, 0); 721 rc = ghes_read_estatus(ghes, estatus, &buf_paddr, FIX_APEI_GHES_IRQ);
707 if (rc) 722 if (rc)
708 goto out; 723 goto out;
709 724
710 if (ghes_severity(ghes->estatus->error_severity) >= GHES_SEV_PANIC) { 725 if (ghes_severity(estatus->error_severity) >= GHES_SEV_PANIC)
711 __ghes_panic(ghes); 726 __ghes_panic(ghes, estatus, buf_paddr, FIX_APEI_GHES_IRQ);
712 }
713 727
714 if (!ghes_estatus_cached(ghes->estatus)) { 728 if (!ghes_estatus_cached(estatus)) {
715 if (ghes_print_estatus(NULL, ghes->generic, ghes->estatus)) 729 if (ghes_print_estatus(NULL, ghes->generic, estatus))
716 ghes_estatus_cache_add(ghes->generic, ghes->estatus); 730 ghes_estatus_cache_add(ghes->generic, estatus);
717 } 731 }
718 ghes_do_proc(ghes, ghes->estatus); 732 ghes_do_proc(ghes, estatus);
719 733
720out: 734out:
721 ghes_clear_estatus(ghes); 735 ghes_clear_estatus(ghes, estatus, buf_paddr, FIX_APEI_GHES_IRQ);
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);
732 736
733 return rc; 737 return rc;
734} 738}
@@ -751,8 +755,11 @@ static void ghes_add_timer(struct ghes *ghes)
751static void ghes_poll_func(struct timer_list *t) 755static void ghes_poll_func(struct timer_list *t)
752{ 756{
753 struct ghes *ghes = from_timer(ghes, t, timer); 757 struct ghes *ghes = from_timer(ghes, t, timer);
758 unsigned long flags;
754 759
760 spin_lock_irqsave(&ghes_notify_lock_irq, flags);
755 ghes_proc(ghes); 761 ghes_proc(ghes);
762 spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
756 if (!(ghes->flags & GHES_EXITING)) 763 if (!(ghes->flags & GHES_EXITING))
757 ghes_add_timer(ghes); 764 ghes_add_timer(ghes);
758} 765}
@@ -760,9 +767,12 @@ static void ghes_poll_func(struct timer_list *t)
760static irqreturn_t ghes_irq_func(int irq, void *data) 767static irqreturn_t ghes_irq_func(int irq, void *data)
761{ 768{
762 struct ghes *ghes = data; 769 struct ghes *ghes = data;
770 unsigned long flags;
763 int rc; 771 int rc;
764 772
773 spin_lock_irqsave(&ghes_notify_lock_irq, flags);
765 rc = ghes_proc(ghes); 774 rc = ghes_proc(ghes);
775 spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
766 if (rc) 776 if (rc)
767 return IRQ_NONE; 777 return IRQ_NONE;
768 778
@@ -773,14 +783,17 @@ static int ghes_notify_hed(struct notifier_block *this, unsigned long event,
773 void *data) 783 void *data)
774{ 784{
775 struct ghes *ghes; 785 struct ghes *ghes;
786 unsigned long flags;
776 int ret = NOTIFY_DONE; 787 int ret = NOTIFY_DONE;
777 788
789 spin_lock_irqsave(&ghes_notify_lock_irq, flags);
778 rcu_read_lock(); 790 rcu_read_lock();
779 list_for_each_entry_rcu(ghes, &ghes_hed, list) { 791 list_for_each_entry_rcu(ghes, &ghes_hed, list) {
780 if (!ghes_proc(ghes)) 792 if (!ghes_proc(ghes))
781 ret = NOTIFY_OK; 793 ret = NOTIFY_OK;
782 } 794 }
783 rcu_read_unlock(); 795 rcu_read_unlock();
796 spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
784 797
785 return ret; 798 return ret;
786} 799}
@@ -789,66 +802,20 @@ static struct notifier_block ghes_notifier_hed = {
789 .notifier_call = ghes_notify_hed, 802 .notifier_call = ghes_notify_hed,
790}; 803};
791 804
792#ifdef CONFIG_ACPI_APEI_SEA
793static 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 */
799int 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
813static 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
820static 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 */
828static inline void ghes_sea_add(struct ghes *ghes) { }
829static inline void ghes_sea_remove(struct ghes *ghes) { }
830#endif /* CONFIG_ACPI_APEI_SEA */
831
832#ifdef CONFIG_HAVE_ACPI_APEI_NMI
833/* 805/*
834 * printk is not safe in NMI context. So in NMI handler, we allocate 806 * Handlers for CPER records may not be NMI safe. For example,
835 * required memory from lock-less memory allocator 807 * memory_failure_queue() takes spinlocks and calls schedule_work_on().
836 * (ghes_estatus_pool), save estatus into it, put them into lock-less 808 * In any NMI-like handler, memory from ghes_estatus_pool is used to save
837 * list (ghes_estatus_llist), then delay printk into IRQ context via 809 * estatus, and added to the ghes_estatus_llist. irq_work_queue() causes
838 * irq_work (ghes_proc_irq_work). ghes_estatus_size_request record 810 * ghes_proc_in_irq() to run in IRQ context where each estatus in
839 * required pool size by all NMI error source. 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.
840 */ 815 */
841static struct llist_head ghes_estatus_llist; 816static struct llist_head ghes_estatus_llist;
842static struct irq_work ghes_proc_irq_work; 817static struct irq_work ghes_proc_irq_work;
843 818
844/*
845 * NMI may be triggered on any CPU, so ghes_in_nmi is used for
846 * having only one concurrent reader.
847 */
848static atomic_t ghes_in_nmi = ATOMIC_INIT(0);
849
850static LIST_HEAD(ghes_nmi);
851
852static void ghes_proc_in_irq(struct irq_work *irq_work) 819static void ghes_proc_in_irq(struct irq_work *irq_work)
853{ 820{
854 struct llist_node *llnode, *next; 821 struct llist_node *llnode, *next;
@@ -905,96 +872,154 @@ static void ghes_print_queued_estatus(void)
905 } 872 }
906} 873}
907 874
908/* Save estatus for further processing in IRQ context */ 875static int ghes_in_nmi_queue_one_entry(struct ghes *ghes,
909static void __process_error(struct ghes *ghes) 876 enum fixed_addresses fixmap_idx)
910{ 877{
911#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG 878 struct acpi_hest_generic_status *estatus, tmp_header;
912 u32 len, node_len;
913 struct ghes_estatus_node *estatus_node; 879 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;
915 883
916 if (ghes_estatus_cached(ghes->estatus)) 884 if (!IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG))
917 return; 885 return -EOPNOTSUPP;
918 886
919 len = cper_estatus_len(ghes->estatus); 887 rc = __ghes_peek_estatus(ghes, &tmp_header, &buf_paddr, fixmap_idx);
920 node_len = GHES_ESTATUS_NODE_LEN(len); 888 if (rc) {
889 ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx);
890 return rc;
891 }
921 892
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);
922 estatus_node = (void *)gen_pool_alloc(ghes_estatus_pool, node_len); 901 estatus_node = (void *)gen_pool_alloc(ghes_estatus_pool, node_len);
923 if (!estatus_node) 902 if (!estatus_node)
924 return; 903 return -ENOMEM;
925 904
926 estatus_node->ghes = ghes; 905 estatus_node->ghes = ghes;
927 estatus_node->generic = ghes->generic; 906 estatus_node->generic = ghes->generic;
928 estatus = GHES_ESTATUS_FROM_NODE(estatus_node); 907 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}
933 908
934static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs) 909 if (__ghes_read_estatus(estatus, buf_paddr, fixmap_idx, len)) {
935{ 910 ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx);
936 struct ghes *ghes; 911 rc = -ENOENT;
937 int sev, ret = NMI_DONE; 912 goto no_work;
913 }
938 914
939 if (!atomic_add_unless(&ghes_in_nmi, 1, 1)) 915 sev = ghes_severity(estatus->error_severity);
940 return ret; 916 if (sev >= GHES_SEV_PANIC) {
917 ghes_print_queued_estatus();
918 __ghes_panic(ghes, estatus, buf_paddr, fixmap_idx);
919 }
941 920
942 list_for_each_entry_rcu(ghes, &ghes_nmi, list) { 921 ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx);
943 if (ghes_read_estatus(ghes, 1)) {
944 ghes_clear_estatus(ghes);
945 continue;
946 } else {
947 ret = NMI_HANDLED;
948 }
949 922
950 sev = ghes_severity(ghes->estatus->error_severity); 923 /* This error has been reported before, don't process it again. */
951 if (sev >= GHES_SEV_PANIC) { 924 if (ghes_estatus_cached(estatus))
952 oops_begin(); 925 goto no_work;
953 ghes_print_queued_estatus();
954 __ghes_panic(ghes);
955 }
956 926
957 if (!(ghes->flags & GHES_TO_CLEAR)) 927 llist_add(&estatus_node->llnode, &ghes_estatus_llist);
958 continue; 928
929 return rc;
930
931no_work:
932 gen_pool_free(ghes_estatus_pool, (unsigned long)estatus_node,
933 node_len);
934
935 return rc;
936}
959 937
960 __process_error(ghes); 938static int ghes_in_nmi_spool_from_list(struct list_head *rcu_list,
961 ghes_clear_estatus(ghes); 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;
962 } 948 }
949 rcu_read_unlock();
963 950
964#ifdef CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG 951 if (IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG) && !ret)
965 if (ret == NMI_HANDLED)
966 irq_work_queue(&ghes_proc_irq_work); 952 irq_work_queue(&ghes_proc_irq_work);
967#endif 953
968 atomic_dec(&ghes_in_nmi);
969 return ret; 954 return ret;
970} 955}
971 956
972static unsigned long ghes_esource_prealloc_size( 957#ifdef CONFIG_ACPI_APEI_SEA
973 const struct acpi_hest_generic *generic) 958static 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 */
964int ghes_notify_sea(void)
974{ 965{
975 unsigned long block_length, prealloc_records, prealloc_size; 966 static DEFINE_RAW_SPINLOCK(ghes_notify_lock_sea);
967 int rv;
976 968
977 block_length = min_t(unsigned long, generic->error_block_length, 969 raw_spin_lock(&ghes_notify_lock_sea);
978 GHES_ESTATUS_MAX_SIZE); 970 rv = ghes_in_nmi_spool_from_list(&ghes_sea, FIX_APEI_GHES_SEA);
979 prealloc_records = max_t(unsigned long, 971 raw_spin_unlock(&ghes_notify_lock_sea);
980 generic->records_to_preallocate, 1);
981 prealloc_size = min_t(unsigned long, block_length * prealloc_records,
982 GHES_ESOURCE_PREALLOC_MAX_SIZE);
983 972
984 return prealloc_size; 973 return rv;
985} 974}
986 975
987static void ghes_estatus_pool_shrink(unsigned long len) 976static void ghes_sea_add(struct ghes *ghes)
988{ 977{
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);
990} 981}
991 982
992static void ghes_nmi_add(struct ghes *ghes) 983static void ghes_sea_remove(struct ghes *ghes)
993{ 984{
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 */
991static inline void ghes_sea_add(struct ghes *ghes) { }
992static 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 */
1000static atomic_t ghes_in_nmi = ATOMIC_INIT(0);
1001
1002static LIST_HEAD(ghes_nmi);
1003
1004static 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);
995 1016
996 len = ghes_esource_prealloc_size(ghes->generic); 1017 atomic_dec(&ghes_in_nmi);
997 ghes_estatus_pool_expand(len); 1018 return ret;
1019}
1020
1021static void ghes_nmi_add(struct ghes *ghes)
1022{
998 mutex_lock(&ghes_list_mutex); 1023 mutex_lock(&ghes_list_mutex);
999 if (list_empty(&ghes_nmi)) 1024 if (list_empty(&ghes_nmi))
1000 register_nmi_handler(NMI_LOCAL, ghes_notify_nmi, 0, "ghes"); 1025 register_nmi_handler(NMI_LOCAL, ghes_notify_nmi, 0, "ghes");
@@ -1004,8 +1029,6 @@ static void ghes_nmi_add(struct ghes *ghes)
1004 1029
1005static void ghes_nmi_remove(struct ghes *ghes) 1030static void ghes_nmi_remove(struct ghes *ghes)
1006{ 1031{
1007 unsigned long len;
1008
1009 mutex_lock(&ghes_list_mutex); 1032 mutex_lock(&ghes_list_mutex);
1010 list_del_rcu(&ghes->list); 1033 list_del_rcu(&ghes->list);
1011 if (list_empty(&ghes_nmi)) 1034 if (list_empty(&ghes_nmi))
@@ -1016,24 +1039,79 @@ static void ghes_nmi_remove(struct ghes *ghes)
1016 * freed after NMI handler finishes. 1039 * freed after NMI handler finishes.
1017 */ 1040 */
1018 synchronize_rcu(); 1041 synchronize_rcu();
1019 len = ghes_esource_prealloc_size(ghes->generic);
1020 ghes_estatus_pool_shrink(len);
1021} 1042}
1043#else /* CONFIG_HAVE_ACPI_APEI_NMI */
1044static inline void ghes_nmi_add(struct ghes *ghes) { }
1045static inline void ghes_nmi_remove(struct ghes *ghes) { }
1046#endif /* CONFIG_HAVE_ACPI_APEI_NMI */
1022 1047
1023static void ghes_nmi_init_cxt(void) 1048static void ghes_nmi_init_cxt(void)
1024{ 1049{
1025 init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq); 1050 init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq);
1026} 1051}
1027#else /* CONFIG_HAVE_ACPI_APEI_NMI */ 1052
1028static inline void ghes_nmi_add(struct ghes *ghes) { } 1053static int __ghes_sdei_callback(struct ghes *ghes,
1029static inline void ghes_nmi_remove(struct ghes *ghes) { } 1054 enum fixed_addresses fixmap_idx)
1030static inline void ghes_nmi_init_cxt(void) { } 1055{
1031#endif /* CONFIG_HAVE_ACPI_APEI_NMI */ 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
1065static 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
1079static 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
1093static 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
1102static 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}
1032 1109
1033static int ghes_probe(struct platform_device *ghes_dev) 1110static int ghes_probe(struct platform_device *ghes_dev)
1034{ 1111{
1035 struct acpi_hest_generic *generic; 1112 struct acpi_hest_generic *generic;
1036 struct ghes *ghes = NULL; 1113 struct ghes *ghes = NULL;
1114 unsigned long flags;
1037 1115
1038 int rc = -EINVAL; 1116 int rc = -EINVAL;
1039 1117
@@ -1064,6 +1142,13 @@ static int ghes_probe(struct platform_device *ghes_dev)
1064 goto err; 1142 goto err;
1065 } 1143 }
1066 break; 1144 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;
1067 case ACPI_HEST_NOTIFY_LOCAL: 1152 case ACPI_HEST_NOTIFY_LOCAL:
1068 pr_warning(GHES_PFX "Generic hardware error source: %d notified via local interrupt is not supported!\n", 1153 pr_warning(GHES_PFX "Generic hardware error source: %d notified via local interrupt is not supported!\n",
1069 generic->header.source_id); 1154 generic->header.source_id);
@@ -1127,6 +1212,11 @@ static int ghes_probe(struct platform_device *ghes_dev)
1127 case ACPI_HEST_NOTIFY_NMI: 1212 case ACPI_HEST_NOTIFY_NMI:
1128 ghes_nmi_add(ghes); 1213 ghes_nmi_add(ghes);
1129 break; 1214 break;
1215 case ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED:
1216 rc = apei_sdei_register_ghes(ghes);
1217 if (rc)
1218 goto err;
1219 break;
1130 default: 1220 default:
1131 BUG(); 1221 BUG();
1132 } 1222 }
@@ -1136,7 +1226,9 @@ static int ghes_probe(struct platform_device *ghes_dev)
1136 ghes_edac_register(ghes, &ghes_dev->dev); 1226 ghes_edac_register(ghes, &ghes_dev->dev);
1137 1227
1138 /* Handle any pending errors right away */ 1228 /* Handle any pending errors right away */
1229 spin_lock_irqsave(&ghes_notify_lock_irq, flags);
1139 ghes_proc(ghes); 1230 ghes_proc(ghes);
1231 spin_unlock_irqrestore(&ghes_notify_lock_irq, flags);
1140 1232
1141 return 0; 1233 return 0;
1142 1234
@@ -1150,6 +1242,7 @@ err:
1150 1242
1151static int ghes_remove(struct platform_device *ghes_dev) 1243static int ghes_remove(struct platform_device *ghes_dev)
1152{ 1244{
1245 int rc;
1153 struct ghes *ghes; 1246 struct ghes *ghes;
1154 struct acpi_hest_generic *generic; 1247 struct acpi_hest_generic *generic;
1155 1248
@@ -1182,6 +1275,11 @@ static int ghes_remove(struct platform_device *ghes_dev)
1182 case ACPI_HEST_NOTIFY_NMI: 1275 case ACPI_HEST_NOTIFY_NMI:
1183 ghes_nmi_remove(ghes); 1276 ghes_nmi_remove(ghes);
1184 break; 1277 break;
1278 case ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED:
1279 rc = apei_sdei_unregister_ghes(ghes);
1280 if (rc)
1281 return rc;
1282 break;
1185 default: 1283 default:
1186 BUG(); 1284 BUG();
1187 break; 1285 break;
@@ -1230,18 +1328,9 @@ static int __init ghes_init(void)
1230 1328
1231 ghes_nmi_init_cxt(); 1329 ghes_nmi_init_cxt();
1232 1330
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
1242 rc = platform_driver_register(&ghes_platform_driver); 1331 rc = platform_driver_register(&ghes_platform_driver);
1243 if (rc) 1332 if (rc)
1244 goto err_pool_exit; 1333 goto err;
1245 1334
1246 rc = apei_osc_setup(); 1335 rc = apei_osc_setup();
1247 if (rc == 0 && osc_sb_apei_support_acked) 1336 if (rc == 0 && osc_sb_apei_support_acked)
@@ -1254,8 +1343,6 @@ static int __init ghes_init(void)
1254 pr_info(GHES_PFX "Failed to enable APEI firmware first mode.\n"); 1343 pr_info(GHES_PFX "Failed to enable APEI firmware first mode.\n");
1255 1344
1256 return 0; 1345 return 0;
1257err_pool_exit:
1258 ghes_estatus_pool_exit();
1259err: 1346err:
1260 return rc; 1347 return rc;
1261} 1348}
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
index b1e9f81ebeea..8113ddb14d28 100644
--- a/drivers/acpi/apei/hest.c
+++ b/drivers/acpi/apei/hest.c
@@ -32,6 +32,7 @@
32#include <linux/io.h> 32#include <linux/io.h>
33#include <linux/platform_device.h> 33#include <linux/platform_device.h>
34#include <acpi/apei.h> 34#include <acpi/apei.h>
35#include <acpi/ghes.h>
35 36
36#include "apei-internal.h" 37#include "apei-internal.h"
37 38
@@ -53,6 +54,7 @@ static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
53 [ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge), 54 [ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
54 [ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic), 55 [ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
55 [ACPI_HEST_TYPE_GENERIC_ERROR_V2] = sizeof(struct acpi_hest_generic_v2), 56 [ACPI_HEST_TYPE_GENERIC_ERROR_V2] = sizeof(struct acpi_hest_generic_v2),
57 [ACPI_HEST_TYPE_IA32_DEFERRED_CHECK] = -1,
56}; 58};
57 59
58static int hest_esrc_len(struct acpi_hest_header *hest_hdr) 60static 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)
75 mc = (struct acpi_hest_ia_machine_check *)hest_hdr; 77 mc = (struct acpi_hest_ia_machine_check *)hest_hdr;
76 len = sizeof(*mc) + mc->num_hardware_banks * 78 len = sizeof(*mc) + mc->num_hardware_banks *
77 sizeof(struct acpi_hest_ia_error_bank); 79 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);
78 } 85 }
79 BUG_ON(len == -1); 86 BUG_ON(len == -1);
80 87
@@ -203,6 +210,11 @@ static int __init hest_ghes_dev_register(unsigned int ghes_count)
203 rc = apei_hest_parse(hest_parse_ghes, &ghes_arr); 210 rc = apei_hest_parse(hest_parse_ghes, &ghes_arr);
204 if (rc) 211 if (rc)
205 goto err; 212 goto err;
213
214 rc = ghes_estatus_pool_init(ghes_count);
215 if (rc)
216 goto err;
217
206out: 218out:
207 kfree(ghes_arr.ghes_devs); 219 kfree(ghes_arr.ghes_devs);
208 return rc; 220 return rc;
@@ -251,7 +263,9 @@ void __init acpi_hest_init(void)
251 rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count); 263 rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
252 if (rc) 264 if (rc)
253 goto err; 265 goto err;
254 rc = hest_ghes_dev_register(ghes_count); 266
267 if (ghes_count)
268 rc = hest_ghes_dev_register(ghes_count);
255 if (rc) 269 if (rc)
256 goto err; 270 goto err;
257 } 271 }
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 147f6c7ea59c..6ecbbabf1233 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -799,10 +799,24 @@ const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
799} 799}
800EXPORT_SYMBOL_GPL(acpi_match_device); 800EXPORT_SYMBOL_GPL(acpi_match_device);
801 801
802static 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
802const void *acpi_device_get_match_data(const struct device *dev) 813const void *acpi_device_get_match_data(const struct device *dev)
803{ 814{
804 const struct acpi_device_id *match; 815 const struct acpi_device_id *match;
805 816
817 if (!dev->driver->acpi_match_table)
818 return acpi_of_device_get_match_data(dev);
819
806 match = acpi_match_device(dev->driver->acpi_match_table, dev); 820 match = acpi_match_device(dev->driver->acpi_match_table, dev);
807 if (!match) 821 if (!match)
808 return NULL; 822 return NULL;
diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c
index 4451877f83b6..aa972dc5cb7e 100644
--- a/drivers/acpi/custom_method.c
+++ b/drivers/acpi/custom_method.c
@@ -79,14 +79,8 @@ static const struct file_operations cm_fops = {
79 79
80static int __init acpi_custom_method_init(void) 80static int __init acpi_custom_method_init(void)
81{ 81{
82 if (acpi_debugfs_dir == NULL)
83 return -ENOENT;
84
85 cm_dentry = debugfs_create_file("custom_method", S_IWUSR, 82 cm_dentry = debugfs_create_file("custom_method", S_IWUSR,
86 acpi_debugfs_dir, NULL, &cm_fops); 83 acpi_debugfs_dir, NULL, &cm_fops);
87 if (cm_dentry == NULL)
88 return -ENODEV;
89
90 return 0; 84 return 0;
91} 85}
92 86
diff --git a/drivers/acpi/dptf/Makefile b/drivers/acpi/dptf/Makefile
index 06ea8809583d..e6032e47e83f 100644
--- a/drivers/acpi/dptf/Makefile
+++ b/drivers/acpi/dptf/Makefile
@@ -1,4 +1,2 @@
1obj-$(CONFIG_ACPI) += int340x_thermal.o 1obj-$(CONFIG_ACPI) += int340x_thermal.o
2obj-$(CONFIG_DPTF_POWER) += dptf_power.o 2obj-$(CONFIG_DPTF_POWER) += dptf_power.o
3
4ccflags-y += -Idrivers/acpi
diff --git a/drivers/acpi/dptf/int340x_thermal.c b/drivers/acpi/dptf/int340x_thermal.c
index 86364097e236..0aa7c2e62e95 100644
--- a/drivers/acpi/dptf/int340x_thermal.c
+++ b/drivers/acpi/dptf/int340x_thermal.c
@@ -12,7 +12,7 @@
12#include <linux/acpi.h> 12#include <linux/acpi.h>
13#include <linux/module.h> 13#include <linux/module.h>
14 14
15#include "internal.h" 15#include "../internal.h"
16 16
17#define INT3401_DEVICE 0X01 17#define INT3401_DEVICE 0X01
18static const struct acpi_device_id int340x_thermal_device_ids[] = { 18static const struct acpi_device_id int340x_thermal_device_ids[] = {
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 9d66a47d32fb..48d4815603e5 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -186,14 +186,17 @@ static void advance_transaction(struct acpi_ec *ec);
186static void acpi_ec_event_handler(struct work_struct *work); 186static void acpi_ec_event_handler(struct work_struct *work);
187static void acpi_ec_event_processor(struct work_struct *work); 187static void acpi_ec_event_processor(struct work_struct *work);
188 188
189struct acpi_ec *boot_ec, *first_ec; 189struct acpi_ec *first_ec;
190EXPORT_SYMBOL(first_ec); 190EXPORT_SYMBOL(first_ec);
191
192static struct acpi_ec *boot_ec;
191static bool boot_ec_is_ecdt = false; 193static bool boot_ec_is_ecdt = false;
192static struct workqueue_struct *ec_query_wq; 194static struct workqueue_struct *ec_query_wq;
193 195
194static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */ 196static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */
195static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */ 197static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */
196static int EC_FLAGS_IGNORE_DSDT_GPE; /* Needs ECDT GPE as correction setting */ 198static int EC_FLAGS_IGNORE_DSDT_GPE; /* Needs ECDT GPE as correction setting */
199static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
197 200
198/* -------------------------------------------------------------------------- 201/* --------------------------------------------------------------------------
199 * Logging/Debugging 202 * Logging/Debugging
@@ -499,6 +502,26 @@ static inline void __acpi_ec_disable_event(struct acpi_ec *ec)
499 ec_log_drv("event blocked"); 502 ec_log_drv("event blocked");
500} 503}
501 504
505/*
506 * Process _Q events that might have accumulated in the EC.
507 * Run with locked ec mutex.
508 */
509static 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
502static void acpi_ec_enable_event(struct acpi_ec *ec) 525static void acpi_ec_enable_event(struct acpi_ec *ec)
503{ 526{
504 unsigned long flags; 527 unsigned long flags;
@@ -507,6 +530,10 @@ static void acpi_ec_enable_event(struct acpi_ec *ec)
507 if (acpi_ec_started(ec)) 530 if (acpi_ec_started(ec))
508 __acpi_ec_enable_event(ec); 531 __acpi_ec_enable_event(ec);
509 spin_unlock_irqrestore(&ec->lock, flags); 532 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);
510} 537}
511 538
512#ifdef CONFIG_PM_SLEEP 539#ifdef CONFIG_PM_SLEEP
@@ -1539,49 +1566,6 @@ static int acpi_ec_setup(struct acpi_ec *ec, bool handle_events)
1539 return ret; 1566 return ret;
1540} 1567}
1541 1568
1542static 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
1585static bool acpi_ec_ecdt_get_handle(acpi_handle *phandle) 1569static bool acpi_ec_ecdt_get_handle(acpi_handle *phandle)
1586{ 1570{
1587 struct acpi_table_ecdt *ecdt_ptr; 1571 struct acpi_table_ecdt *ecdt_ptr;
@@ -1601,43 +1585,34 @@ static bool acpi_ec_ecdt_get_handle(acpi_handle *phandle)
1601 return true; 1585 return true;
1602} 1586}
1603 1587
1604static 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
1614static int acpi_ec_add(struct acpi_device *device) 1588static int acpi_ec_add(struct acpi_device *device)
1615{ 1589{
1616 struct acpi_ec *ec = NULL; 1590 struct acpi_ec *ec = NULL;
1617 int ret; 1591 bool dep_update = true;
1618 bool is_ecdt = false;
1619 acpi_status status; 1592 acpi_status status;
1593 int ret;
1620 1594
1621 strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); 1595 strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
1622 strcpy(acpi_device_class(device), ACPI_EC_CLASS); 1596 strcpy(acpi_device_class(device), ACPI_EC_CLASS);
1623 1597
1624 if (!strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) { 1598 if (!strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) {
1625 is_ecdt = true; 1599 boot_ec_is_ecdt = true;
1626 ec = boot_ec; 1600 ec = boot_ec;
1601 dep_update = false;
1627 } else { 1602 } else {
1628 ec = acpi_ec_alloc(); 1603 ec = acpi_ec_alloc();
1629 if (!ec) 1604 if (!ec)
1630 return -ENOMEM; 1605 return -ENOMEM;
1606
1631 status = ec_parse_device(device->handle, 0, ec, NULL); 1607 status = ec_parse_device(device->handle, 0, ec, NULL);
1632 if (status != AE_CTRL_TERMINATE) { 1608 if (status != AE_CTRL_TERMINATE) {
1633 ret = -EINVAL; 1609 ret = -EINVAL;
1634 goto err_alloc; 1610 goto err_alloc;
1635 } 1611 }
1636 }
1637 1612
1638 if (acpi_is_boot_ec(ec)) { 1613 if (boot_ec && ec->command_addr == boot_ec->command_addr &&
1639 boot_ec_is_ecdt = is_ecdt; 1614 ec->data_addr == boot_ec->data_addr) {
1640 if (!is_ecdt) { 1615 boot_ec_is_ecdt = false;
1641 /* 1616 /*
1642 * Trust PNP0C09 namespace location rather than 1617 * Trust PNP0C09 namespace location rather than
1643 * ECDT ID. But trust ECDT GPE rather than _GPE 1618 * ECDT ID. But trust ECDT GPE rather than _GPE
@@ -1649,12 +1624,17 @@ static int acpi_ec_add(struct acpi_device *device)
1649 acpi_ec_free(ec); 1624 acpi_ec_free(ec);
1650 ec = boot_ec; 1625 ec = boot_ec;
1651 } 1626 }
1652 ret = acpi_config_boot_ec(ec, ec->handle, true, is_ecdt); 1627 }
1653 } else 1628
1654 ret = acpi_ec_setup(ec, true); 1629 ret = acpi_ec_setup(ec, true);
1655 if (ret) 1630 if (ret)
1656 goto err_query; 1631 goto err_query;
1657 1632
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
1658 device->driver_data = ec; 1638 device->driver_data = ec;
1659 1639
1660 ret = !!request_region(ec->data_addr, 1, "EC data"); 1640 ret = !!request_region(ec->data_addr, 1, "EC data");
@@ -1662,7 +1642,7 @@ static int acpi_ec_add(struct acpi_device *device)
1662 ret = !!request_region(ec->command_addr, 1, "EC cmd"); 1642 ret = !!request_region(ec->command_addr, 1, "EC cmd");
1663 WARN(!ret, "Could not request EC cmd io port 0x%lx", ec->command_addr); 1643 WARN(!ret, "Could not request EC cmd io port 0x%lx", ec->command_addr);
1664 1644
1665 if (!is_ecdt) { 1645 if (dep_update) {
1666 /* Reprobe devices depending on the EC */ 1646 /* Reprobe devices depending on the EC */
1667 acpi_walk_dep_device_list(ec->handle); 1647 acpi_walk_dep_device_list(ec->handle);
1668 } 1648 }
@@ -1730,10 +1710,10 @@ static const struct acpi_device_id ec_device_ids[] = {
1730 * namespace EC before the main ACPI device enumeration process. It is 1710 * namespace EC before the main ACPI device enumeration process. It is
1731 * retained for historical reason and will be deprecated in the future. 1711 * retained for historical reason and will be deprecated in the future.
1732 */ 1712 */
1733int __init acpi_ec_dsdt_probe(void) 1713void __init acpi_ec_dsdt_probe(void)
1734{ 1714{
1735 acpi_status status;
1736 struct acpi_ec *ec; 1715 struct acpi_ec *ec;
1716 acpi_status status;
1737 int ret; 1717 int ret;
1738 1718
1739 /* 1719 /*
@@ -1743,21 +1723,22 @@ int __init acpi_ec_dsdt_probe(void)
1743 * picking up an invalid EC device. 1723 * picking up an invalid EC device.
1744 */ 1724 */
1745 if (boot_ec) 1725 if (boot_ec)
1746 return -ENODEV; 1726 return;
1747 1727
1748 ec = acpi_ec_alloc(); 1728 ec = acpi_ec_alloc();
1749 if (!ec) 1729 if (!ec)
1750 return -ENOMEM; 1730 return;
1731
1751 /* 1732 /*
1752 * At this point, the namespace is initialized, so start to find 1733 * At this point, the namespace is initialized, so start to find
1753 * the namespace objects. 1734 * the namespace objects.
1754 */ 1735 */
1755 status = acpi_get_devices(ec_device_ids[0].id, 1736 status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device, ec, NULL);
1756 ec_parse_device, ec, NULL);
1757 if (ACPI_FAILURE(status) || !ec->handle) { 1737 if (ACPI_FAILURE(status) || !ec->handle) {
1758 ret = -ENODEV; 1738 acpi_ec_free(ec);
1759 goto error; 1739 return;
1760 } 1740 }
1741
1761 /* 1742 /*
1762 * When the DSDT EC is available, always re-configure boot EC to 1743 * When the DSDT EC is available, always re-configure boot EC to
1763 * have _REG evaluated. _REG can only be evaluated after the 1744 * have _REG evaluated. _REG can only be evaluated after the
@@ -1765,11 +1746,16 @@ int __init acpi_ec_dsdt_probe(void)
1765 * At this point, the GPE is not fully initialized, so do not to 1746 * At this point, the GPE is not fully initialized, so do not to
1766 * handle the events. 1747 * handle the events.
1767 */ 1748 */
1768 ret = acpi_config_boot_ec(ec, ec->handle, false, false); 1749 ret = acpi_ec_setup(ec, false);
1769error: 1750 if (ret) {
1770 if (ret)
1771 acpi_ec_free(ec); 1751 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");
1773} 1759}
1774 1760
1775/* 1761/*
@@ -1821,6 +1807,31 @@ static int ec_flag_query_handshake(const struct dmi_system_id *id)
1821#endif 1807#endif
1822 1808
1823/* 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 */
1826static 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
1834/*
1824 * Some ECDTs contain wrong register addresses. 1835 * Some ECDTs contain wrong register addresses.
1825 * MSI MS-171F 1836 * MSI MS-171F
1826 * https://bugzilla.kernel.org/show_bug.cgi?id=12461 1837 * https://bugzilla.kernel.org/show_bug.cgi?id=12461
@@ -1869,39 +1880,38 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = {
1869 ec_honor_ecdt_gpe, "ASUS X580VD", { 1880 ec_honor_ecdt_gpe, "ASUS X580VD", {
1870 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 1881 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
1871 DMI_MATCH(DMI_PRODUCT_NAME, "X580VD"),}, NULL}, 1882 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},
1872 {}, 1886 {},
1873}; 1887};
1874 1888
1875int __init acpi_ec_ecdt_probe(void) 1889void __init acpi_ec_ecdt_probe(void)
1876{ 1890{
1877 int ret;
1878 acpi_status status;
1879 struct acpi_table_ecdt *ecdt_ptr; 1891 struct acpi_table_ecdt *ecdt_ptr;
1880 struct acpi_ec *ec; 1892 struct acpi_ec *ec;
1893 acpi_status status;
1894 int ret;
1881 1895
1882 ec = acpi_ec_alloc(); 1896 /* Generate a boot ec context. */
1883 if (!ec)
1884 return -ENOMEM;
1885 /*
1886 * Generate a boot ec context
1887 */
1888 dmi_check_system(ec_dmi_table); 1897 dmi_check_system(ec_dmi_table);
1889 status = acpi_get_table(ACPI_SIG_ECDT, 1, 1898 status = acpi_get_table(ACPI_SIG_ECDT, 1,
1890 (struct acpi_table_header **)&ecdt_ptr); 1899 (struct acpi_table_header **)&ecdt_ptr);
1891 if (ACPI_FAILURE(status)) { 1900 if (ACPI_FAILURE(status))
1892 ret = -ENODEV; 1901 return;
1893 goto error;
1894 }
1895 1902
1896 if (!ecdt_ptr->control.address || !ecdt_ptr->data.address) { 1903 if (!ecdt_ptr->control.address || !ecdt_ptr->data.address) {
1897 /* 1904 /*
1898 * Asus X50GL: 1905 * Asus X50GL:
1899 * https://bugzilla.kernel.org/show_bug.cgi?id=11880 1906 * https://bugzilla.kernel.org/show_bug.cgi?id=11880
1900 */ 1907 */
1901 ret = -ENODEV; 1908 return;
1902 goto error;
1903 } 1909 }
1904 1910
1911 ec = acpi_ec_alloc();
1912 if (!ec)
1913 return;
1914
1905 if (EC_FLAGS_CORRECT_ECDT) { 1915 if (EC_FLAGS_CORRECT_ECDT) {
1906 ec->command_addr = ecdt_ptr->data.address; 1916 ec->command_addr = ecdt_ptr->data.address;
1907 ec->data_addr = ecdt_ptr->control.address; 1917 ec->data_addr = ecdt_ptr->control.address;
@@ -1910,16 +1920,22 @@ int __init acpi_ec_ecdt_probe(void)
1910 ec->data_addr = ecdt_ptr->data.address; 1920 ec->data_addr = ecdt_ptr->data.address;
1911 } 1921 }
1912 ec->gpe = ecdt_ptr->gpe; 1922 ec->gpe = ecdt_ptr->gpe;
1923 ec->handle = ACPI_ROOT_OBJECT;
1913 1924
1914 /* 1925 /*
1915 * At this point, the namespace is not initialized, so do not find 1926 * At this point, the namespace is not initialized, so do not find
1916 * the namespace objects, or handle the events. 1927 * the namespace objects, or handle the events.
1917 */ 1928 */
1918 ret = acpi_config_boot_ec(ec, ACPI_ROOT_OBJECT, false, true); 1929 ret = acpi_ec_setup(ec, false);
1919error: 1930 if (ret) {
1920 if (ret)
1921 acpi_ec_free(ec); 1931 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");
1923} 1939}
1924 1940
1925#ifdef CONFIG_PM_SLEEP 1941#ifdef CONFIG_PM_SLEEP
diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
index dd70d6c2bca0..23faa66ea772 100644
--- a/drivers/acpi/ec_sys.c
+++ b/drivers/acpi/ec_sys.c
@@ -108,52 +108,32 @@ static const struct file_operations acpi_ec_io_ops = {
108 .llseek = default_llseek, 108 .llseek = default_llseek,
109}; 109};
110 110
111static int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count) 111static void acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count)
112{ 112{
113 struct dentry *dev_dir; 113 struct dentry *dev_dir;
114 char name[64]; 114 char name[64];
115 umode_t mode = 0400; 115 umode_t mode = 0400;
116 116
117 if (ec_device_count == 0) { 117 if (ec_device_count == 0)
118 acpi_ec_debugfs_dir = debugfs_create_dir("ec", NULL); 118 acpi_ec_debugfs_dir = debugfs_create_dir("ec", NULL);
119 if (!acpi_ec_debugfs_dir)
120 return -ENOMEM;
121 }
122 119
123 sprintf(name, "ec%u", ec_device_count); 120 sprintf(name, "ec%u", ec_device_count);
124 dev_dir = debugfs_create_dir(name, acpi_ec_debugfs_dir); 121 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 }
130 122
131 if (!debugfs_create_x32("gpe", 0444, dev_dir, &first_ec->gpe)) 123 debugfs_create_x32("gpe", 0444, dev_dir, &first_ec->gpe);
132 goto error; 124 debugfs_create_bool("use_global_lock", 0444, dev_dir,
133 if (!debugfs_create_bool("use_global_lock", 0444, dev_dir, 125 &first_ec->global_lock);
134 &first_ec->global_lock))
135 goto error;
136 126
137 if (write_support) 127 if (write_support)
138 mode = 0600; 128 mode = 0600;
139 if (!debugfs_create_file("io", mode, dev_dir, ec, &acpi_ec_io_ops)) 129 debugfs_create_file("io", mode, dev_dir, ec, &acpi_ec_io_ops);
140 goto error;
141
142 return 0;
143
144error:
145 debugfs_remove_recursive(acpi_ec_debugfs_dir);
146 return -ENOMEM;
147} 130}
148 131
149static int __init acpi_ec_sys_init(void) 132static int __init acpi_ec_sys_init(void)
150{ 133{
151 int err = 0;
152 if (first_ec) 134 if (first_ec)
153 err = acpi_ec_add_debugfs(first_ec, 0); 135 acpi_ec_add_debugfs(first_ec, 0);
154 else 136 return 0;
155 err = -ENODEV;
156 return err;
157} 137}
158 138
159static void __exit acpi_ec_sys_exit(void) 139static void __exit acpi_ec_sys_exit(void)
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 6a9e1fb8913a..6eaf06db7752 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -192,8 +192,8 @@ extern struct acpi_ec *first_ec;
192typedef int (*acpi_ec_query_func) (void *data); 192typedef int (*acpi_ec_query_func) (void *data);
193 193
194int acpi_ec_init(void); 194int acpi_ec_init(void);
195int acpi_ec_ecdt_probe(void); 195void acpi_ec_ecdt_probe(void);
196int acpi_ec_dsdt_probe(void); 196void acpi_ec_dsdt_probe(void);
197void acpi_ec_block_transactions(void); 197void acpi_ec_block_transactions(void);
198void acpi_ec_unblock_transactions(void); 198void acpi_ec_unblock_transactions(void);
199void acpi_ec_mark_gpe_for_wake(void); 199void acpi_ec_mark_gpe_for_wake(void);
diff --git a/drivers/acpi/irq.c b/drivers/acpi/irq.c
index 7c352cba0528..c3b2222e2129 100644
--- a/drivers/acpi/irq.c
+++ b/drivers/acpi/irq.c
@@ -196,7 +196,7 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
196 fwnode = acpi_gsi_domain_id; 196 fwnode = acpi_gsi_domain_id;
197 acpi_irq_parse_one_match(fwnode, irq->interrupts[ctx->index], 197 acpi_irq_parse_one_match(fwnode, irq->interrupts[ctx->index],
198 irq->triggering, irq->polarity, 198 irq->triggering, irq->polarity,
199 irq->sharable, ctx); 199 irq->shareable, ctx);
200 return AE_CTRL_TERMINATE; 200 return AE_CTRL_TERMINATE;
201 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: 201 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
202 eirq = &ares->data.extended_irq; 202 eirq = &ares->data.extended_irq;
@@ -209,7 +209,7 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
209 fwnode = acpi_get_irq_source_fwhandle(&eirq->resource_source); 209 fwnode = acpi_get_irq_source_fwhandle(&eirq->resource_source);
210 acpi_irq_parse_one_match(fwnode, eirq->interrupts[ctx->index], 210 acpi_irq_parse_one_match(fwnode, eirq->interrupts[ctx->index],
211 eirq->triggering, eirq->polarity, 211 eirq->triggering, eirq->polarity,
212 eirq->sharable, ctx); 212 eirq->shareable, ctx);
213 return AE_CTRL_TERMINATE; 213 return AE_CTRL_TERMINATE;
214 } 214 }
215 215
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index d5eec352a6e1..df70b1eaef58 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -317,10 +317,10 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
317 resource->res.data.irq.polarity = 317 resource->res.data.irq.polarity =
318 link->irq.polarity; 318 link->irq.polarity;
319 if (link->irq.triggering == ACPI_EDGE_SENSITIVE) 319 if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
320 resource->res.data.irq.sharable = 320 resource->res.data.irq.shareable =
321 ACPI_EXCLUSIVE; 321 ACPI_EXCLUSIVE;
322 else 322 else
323 resource->res.data.irq.sharable = ACPI_SHARED; 323 resource->res.data.irq.shareable = ACPI_SHARED;
324 resource->res.data.irq.interrupt_count = 1; 324 resource->res.data.irq.interrupt_count = 1;
325 resource->res.data.irq.interrupts[0] = irq; 325 resource->res.data.irq.interrupts[0] = irq;
326 break; 326 break;
@@ -335,10 +335,10 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
335 resource->res.data.extended_irq.polarity = 335 resource->res.data.extended_irq.polarity =
336 link->irq.polarity; 336 link->irq.polarity;
337 if (link->irq.triggering == ACPI_EDGE_SENSITIVE) 337 if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
338 resource->res.data.irq.sharable = 338 resource->res.data.irq.shareable =
339 ACPI_EXCLUSIVE; 339 ACPI_EXCLUSIVE;
340 else 340 else
341 resource->res.data.irq.sharable = ACPI_SHARED; 341 resource->res.data.irq.shareable = ACPI_SHARED;
342 resource->res.data.extended_irq.interrupt_count = 1; 342 resource->res.data.extended_irq.interrupt_count = 1;
343 resource->res.data.extended_irq.interrupts[0] = irq; 343 resource->res.data.extended_irq.interrupts[0] = irq;
344 /* ignore resource_source, it's optional */ 344 /* ignore resource_source, it's optional */
diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
index da031b1df6f5..ad31c50de3be 100644
--- a/drivers/acpi/pptt.c
+++ b/drivers/acpi/pptt.c
@@ -451,6 +451,11 @@ static struct acpi_pptt_processor *acpi_find_processor_package_id(struct acpi_ta
451 return cpu; 451 return cpu;
452} 452}
453 453
454static 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
454/** 459/**
455 * topology_get_acpi_cpu_tag() - Find a unique topology value for a feature 460 * topology_get_acpi_cpu_tag() - Find a unique topology value for a feature
456 * @table: Pointer to the head of the PPTT table 461 * @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)
498 503
499 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); 504 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
500 if (ACPI_FAILURE(status)) { 505 if (ACPI_FAILURE(status)) {
501 pr_warn_once("No PPTT table found, cpu topology may be inaccurate\n"); 506 acpi_pptt_warn_missing();
502 return -ENOENT; 507 return -ENOENT;
503 } 508 }
504 retval = topology_get_acpi_cpu_tag(table, cpu, level, flag); 509 retval = topology_get_acpi_cpu_tag(table, cpu, level, flag);
@@ -531,7 +536,7 @@ int acpi_find_last_cache_level(unsigned int cpu)
531 acpi_cpu_id = get_acpi_id_for_cpu(cpu); 536 acpi_cpu_id = get_acpi_id_for_cpu(cpu);
532 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); 537 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
533 if (ACPI_FAILURE(status)) { 538 if (ACPI_FAILURE(status)) {
534 pr_warn_once("No PPTT table found, cache topology may be inaccurate\n"); 539 acpi_pptt_warn_missing();
535 } else { 540 } else {
536 number_of_levels = acpi_find_cache_levels(table, acpi_cpu_id); 541 number_of_levels = acpi_find_cache_levels(table, acpi_cpu_id);
537 acpi_put_table(table); 542 acpi_put_table(table);
@@ -563,7 +568,7 @@ int cache_setup_acpi(unsigned int cpu)
563 568
564 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); 569 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
565 if (ACPI_FAILURE(status)) { 570 if (ACPI_FAILURE(status)) {
566 pr_warn_once("No PPTT table found, cache topology may be inaccurate\n"); 571 acpi_pptt_warn_missing();
567 return -ENOENT; 572 return -ENOENT;
568 } 573 }
569 574
@@ -617,7 +622,7 @@ int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
617 622
618 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table); 623 status = acpi_get_table(ACPI_SIG_PPTT, 0, &table);
619 if (ACPI_FAILURE(status)) { 624 if (ACPI_FAILURE(status)) {
620 pr_warn_once("No PPTT table found, topology may be inaccurate\n"); 625 acpi_pptt_warn_missing();
621 return -ENOENT; 626 return -ENOENT;
622 } 627 }
623 628
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 316a0fc785e3..d556f2144de8 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -476,7 +476,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
476 } 476 }
477 acpi_dev_get_irqresource(res, irq->interrupts[index], 477 acpi_dev_get_irqresource(res, irq->interrupts[index],
478 irq->triggering, irq->polarity, 478 irq->triggering, irq->polarity,
479 irq->sharable, true); 479 irq->shareable, true);
480 break; 480 break;
481 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: 481 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
482 ext_irq = &ares->data.extended_irq; 482 ext_irq = &ares->data.extended_irq;
@@ -487,7 +487,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
487 if (is_gsi(ext_irq)) 487 if (is_gsi(ext_irq))
488 acpi_dev_get_irqresource(res, ext_irq->interrupts[index], 488 acpi_dev_get_irqresource(res, ext_irq->interrupts[index],
489 ext_irq->triggering, ext_irq->polarity, 489 ext_irq->triggering, ext_irq->polarity,
490 ext_irq->sharable, false); 490 ext_irq->shareable, false);
491 else 491 else
492 acpi_dev_irqresource_disabled(res, 0); 492 acpi_dev_irqresource_disabled(res, 0);
493 break; 493 break;
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 48eabb6c2d4f..8fccbe49612a 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -473,14 +473,22 @@ static DECLARE_BITMAP(acpi_initrd_installed, NR_ACPI_INITRD_TABLES);
473 473
474void __init acpi_table_upgrade(void) 474void __init acpi_table_upgrade(void)
475{ 475{
476 void *data = (void *)initrd_start; 476 void *data;
477 size_t size = initrd_end - initrd_start; 477 size_t size;
478 int sig, no, table_nr = 0, total_offset = 0; 478 int sig, no, table_nr = 0, total_offset = 0;
479 long offset = 0; 479 long offset = 0;
480 struct acpi_table_header *table; 480 struct acpi_table_header *table;
481 char cpio_path[32] = "kernel/firmware/acpi/"; 481 char cpio_path[32] = "kernel/firmware/acpi/";
482 struct cpio_data file; 482 struct cpio_data file;
483 483
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
484 if (data == NULL || size == 0) 492 if (data == NULL || size == 0)
485 return; 493 return;
486 494
diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
index 9a8e286dd86f..c6df14802741 100644
--- a/drivers/acpi/x86/utils.c
+++ b/drivers/acpi/x86/utils.c
@@ -56,6 +56,11 @@ static const struct always_present_id always_present_ids[] = {
56 */ 56 */
57 ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT), {}), 57 ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT), {}),
58 ENTRY("80862288", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}), 58 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 }),
59 /* 64 /*
60 * The INT0002 device is necessary to clear wakeup interrupt sources 65 * The INT0002 device is necessary to clear wakeup interrupt sources
61 * on Cherry Trail devices, without it we get nobody cared IRQ msgs. 66 * on Cherry Trail devices, without it we get nobody cared IRQ msgs.
diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c
index c64c7da73829..e6376f985ef7 100644
--- a/drivers/firmware/arm_sdei.c
+++ b/drivers/firmware/arm_sdei.c
@@ -2,6 +2,7 @@
2// Copyright (C) 2017 Arm Ltd. 2// Copyright (C) 2017 Arm Ltd.
3#define pr_fmt(fmt) "sdei: " fmt 3#define pr_fmt(fmt) "sdei: " fmt
4 4
5#include <acpi/ghes.h>
5#include <linux/acpi.h> 6#include <linux/acpi.h>
6#include <linux/arm_sdei.h> 7#include <linux/arm_sdei.h>
7#include <linux/arm-smccc.h> 8#include <linux/arm-smccc.h>
@@ -887,6 +888,73 @@ static void sdei_smccc_hvc(unsigned long function_id,
887 arm_smccc_hvc(function_id, arg0, arg1, arg2, arg3, arg4, 0, 0, res); 888 arm_smccc_hvc(function_id, arg0, arg1, arg2, arg3, arg4, 0, 0, res);
888} 889}
889 890
891int 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
928int 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
890static int sdei_get_conduit(struct platform_device *pdev) 958static int sdei_get_conduit(struct platform_device *pdev)
891{ 959{
892 const char *method; 960 const char *method;
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
index 6a966ecdd80a..8fa977c7861f 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
@@ -534,19 +534,24 @@ EXPORT_SYMBOL_GPL(cper_estatus_check_header);
534int cper_estatus_check(const struct acpi_hest_generic_status *estatus) 534int cper_estatus_check(const struct acpi_hest_generic_status *estatus)
535{ 535{
536 struct acpi_hest_generic_data *gdata; 536 struct acpi_hest_generic_data *gdata;
537 unsigned int data_len, gedata_len; 537 unsigned int data_len, record_size;
538 int rc; 538 int rc;
539 539
540 rc = cper_estatus_check_header(estatus); 540 rc = cper_estatus_check_header(estatus);
541 if (rc) 541 if (rc)
542 return rc; 542 return rc;
543
543 data_len = estatus->data_length; 544 data_len = estatus->data_length;
544 545
545 apei_estatus_for_each_section(estatus, gdata) { 546 apei_estatus_for_each_section(estatus, gdata) {
546 gedata_len = acpi_hest_get_error_length(gdata); 547 if (sizeof(struct acpi_hest_generic_data) > data_len)
547 if (gedata_len > data_len - acpi_hest_get_size(gdata)) 548 return -EINVAL;
549
550 record_size = acpi_hest_get_record_size(gdata);
551 if (record_size > data_len)
548 return -EINVAL; 552 return -EINVAL;
549 data_len -= acpi_hest_get_record_size(gdata); 553
554 data_len -= record_size;
550 } 555 }
551 if (data_len) 556 if (data_len)
552 return -EINVAL; 557 return -EINVAL;
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 259cf6ab969b..667f472fdbbd 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -892,7 +892,7 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,
892 * event but only if the access here is ACPI_READ. In that 892 * event but only if the access here is ACPI_READ. In that
893 * case we "borrow" the event GPIO instead. 893 * case we "borrow" the event GPIO instead.
894 */ 894 */
895 if (!found && agpio->sharable == ACPI_SHARED && 895 if (!found && agpio->shareable == ACPI_SHARED &&
896 function == ACPI_READ) { 896 function == ACPI_READ) {
897 struct acpi_gpio_event *event; 897 struct acpi_gpio_event *event;
898 898
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index b205b037fd61..4bfbfa3f78e6 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -4392,7 +4392,7 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context)
4392 list_add(&interrupt->list, &dev->interrupts); 4392 list_add(&interrupt->list, &dev->interrupts);
4393 interrupt->irq.triggering = p->triggering; 4393 interrupt->irq.triggering = p->triggering;
4394 interrupt->irq.polarity = p->polarity; 4394 interrupt->irq.polarity = p->polarity;
4395 interrupt->irq.sharable = p->sharable; 4395 interrupt->irq.shareable = p->shareable;
4396 interrupt->irq.interrupt_count = 1; 4396 interrupt->irq.interrupt_count = 1;
4397 interrupt->irq.interrupts[0] = p->interrupts[i]; 4397 interrupt->irq.interrupts[0] = p->interrupts[i];
4398 } 4398 }
@@ -4546,7 +4546,7 @@ static int sony_pic_enable(struct acpi_device *device,
4546 memcpy(&resource->res3.data.irq, &irq->irq, 4546 memcpy(&resource->res3.data.irq, &irq->irq,
4547 sizeof(struct acpi_resource_irq)); 4547 sizeof(struct acpi_resource_irq));
4548 /* we requested a shared irq */ 4548 /* we requested a shared irq */
4549 resource->res3.data.irq.sharable = ACPI_SHARED; 4549 resource->res3.data.irq.shareable = ACPI_SHARED;
4550 4550
4551 resource->res4.type = ACPI_RESOURCE_TYPE_END_TAG; 4551 resource->res4.type = ACPI_RESOURCE_TYPE_END_TAG;
4552 resource->res4.length = sizeof(struct acpi_resource); 4552 resource->res4.length = sizeof(struct acpi_resource);
@@ -4565,7 +4565,7 @@ static int sony_pic_enable(struct acpi_device *device,
4565 memcpy(&resource->res2.data.irq, &irq->irq, 4565 memcpy(&resource->res2.data.irq, &irq->irq,
4566 sizeof(struct acpi_resource_irq)); 4566 sizeof(struct acpi_resource_irq));
4567 /* we requested a shared irq */ 4567 /* we requested a shared irq */
4568 resource->res2.data.irq.sharable = ACPI_SHARED; 4568 resource->res2.data.irq.shareable = ACPI_SHARED;
4569 4569
4570 resource->res3.type = ACPI_RESOURCE_TYPE_END_TAG; 4570 resource->res3.type = ACPI_RESOURCE_TYPE_END_TAG;
4571 resource->res3.length = sizeof(struct acpi_resource); 4571 resource->res3.length = sizeof(struct acpi_resource);
@@ -4779,7 +4779,7 @@ static int sony_pic_add(struct acpi_device *device)
4779 irq->irq.interrupts[0], 4779 irq->irq.interrupts[0],
4780 irq->irq.triggering, 4780 irq->irq.triggering,
4781 irq->irq.polarity, 4781 irq->irq.polarity,
4782 irq->irq.sharable); 4782 irq->irq.shareable);
4783 spic_dev.cur_irq = irq; 4783 spic_dev.cur_irq = irq;
4784 break; 4784 break;
4785 } 4785 }
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index 43d8ed577e70..c79417ca1b3c 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -215,7 +215,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
215 if (i >= 0) { 215 if (i >= 0) {
216 flags = acpi_dev_irq_flags(gpio->triggering, 216 flags = acpi_dev_irq_flags(gpio->triggering,
217 gpio->polarity, 217 gpio->polarity,
218 gpio->sharable); 218 gpio->shareable);
219 } else { 219 } else {
220 flags = IORESOURCE_DISABLED; 220 flags = IORESOURCE_DISABLED;
221 } 221 }
@@ -324,7 +324,7 @@ static __init void pnpacpi_parse_irq_option(struct pnp_dev *dev,
324 if (p->interrupts[i]) 324 if (p->interrupts[i])
325 __set_bit(p->interrupts[i], map.bits); 325 __set_bit(p->interrupts[i], map.bits);
326 326
327 flags = acpi_dev_irq_flags(p->triggering, p->polarity, p->sharable); 327 flags = acpi_dev_irq_flags(p->triggering, p->polarity, p->shareable);
328 pnp_register_irq_resource(dev, option_flags, &map, flags); 328 pnp_register_irq_resource(dev, option_flags, &map, flags);
329} 329}
330 330
@@ -348,7 +348,7 @@ static __init void pnpacpi_parse_ext_irq_option(struct pnp_dev *dev,
348 } 348 }
349 } 349 }
350 350
351 flags = acpi_dev_irq_flags(p->triggering, p->polarity, p->sharable); 351 flags = acpi_dev_irq_flags(p->triggering, p->polarity, p->shareable);
352 pnp_register_irq_resource(dev, option_flags, &map, flags); 352 pnp_register_irq_resource(dev, option_flags, &map, flags);
353} 353}
354 354
@@ -681,7 +681,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev,
681 decode_irq_flags(dev, p->flags, &triggering, &polarity, &shareable); 681 decode_irq_flags(dev, p->flags, &triggering, &polarity, &shareable);
682 irq->triggering = triggering; 682 irq->triggering = triggering;
683 irq->polarity = polarity; 683 irq->polarity = polarity;
684 irq->sharable = shareable; 684 irq->shareable = shareable;
685 irq->interrupt_count = 1; 685 irq->interrupt_count = 1;
686 irq->interrupts[0] = p->start; 686 irq->interrupts[0] = p->start;
687 687
@@ -689,7 +689,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev,
689 (int) p->start, 689 (int) p->start,
690 triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", 690 triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge",
691 polarity == ACPI_ACTIVE_LOW ? "low" : "high", 691 polarity == ACPI_ACTIVE_LOW ? "low" : "high",
692 irq->sharable == ACPI_SHARED ? "shared" : "exclusive", 692 irq->shareable == ACPI_SHARED ? "shared" : "exclusive",
693 irq->descriptor_length); 693 irq->descriptor_length);
694} 694}
695 695
@@ -711,14 +711,14 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev,
711 extended_irq->producer_consumer = ACPI_CONSUMER; 711 extended_irq->producer_consumer = ACPI_CONSUMER;
712 extended_irq->triggering = triggering; 712 extended_irq->triggering = triggering;
713 extended_irq->polarity = polarity; 713 extended_irq->polarity = polarity;
714 extended_irq->sharable = shareable; 714 extended_irq->shareable = shareable;
715 extended_irq->interrupt_count = 1; 715 extended_irq->interrupt_count = 1;
716 extended_irq->interrupts[0] = p->start; 716 extended_irq->interrupts[0] = p->start;
717 717
718 pnp_dbg(&dev->dev, " encode irq %d %s %s %s\n", (int) p->start, 718 pnp_dbg(&dev->dev, " encode irq %d %s %s %s\n", (int) p->start,
719 triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", 719 triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge",
720 polarity == ACPI_ACTIVE_LOW ? "low" : "high", 720 polarity == ACPI_ACTIVE_LOW ? "low" : "high",
721 extended_irq->sharable == ACPI_SHARED ? "shared" : "exclusive"); 721 extended_irq->shareable == ACPI_SHARED ? "shared" : "exclusive");
722} 722}
723 723
724static void pnpacpi_encode_dma(struct pnp_dev *dev, 724static void pnpacpi_encode_dma(struct pnp_dev *dev,
diff --git a/include/acpi/acbuffer.h b/include/acpi/acbuffer.h
index 6488d572739c..c2acd29f973d 100644
--- a/include/acpi/acbuffer.h
+++ b/include/acpi/acbuffer.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acbuffer.h - Support for buffers returned by ACPI predefined names 4 * Name: acbuffer.h - Support for buffers returned by ACPI predefined names
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 53c088247d36..16a83959e616 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acconfig.h - Global configuration constants 4 * Name: acconfig.h - Global configuration constants
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -141,7 +141,7 @@
141 141
142/* 142/*
143 * Maximal number of elements the Result Stack can contain, 143 * 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
145 * result_size and result_count (now u8). 145 * result_size and result_count (now u8).
146 */ 146 */
147#define ACPI_RESULTS_OBJ_NUM_MAX 255 147#define ACPI_RESULTS_OBJ_NUM_MAX 255
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 09f46050961f..233a72f169bb 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acexcep.h - Exception codes returned by the ACPI subsystem 4 * Name: acexcep.h - Exception codes returned by the ACPI subsystem
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -311,7 +311,8 @@ static const struct acpi_exception_info acpi_gbl_exception_names_aml[] = {
311 "An ACPI name contains invalid character(s)"), 311 "An ACPI name contains invalid character(s)"),
312 EXCEP_TXT("AE_AML_NAME_NOT_FOUND", 312 EXCEP_TXT("AE_AML_NAME_NOT_FOUND",
313 "Could not resolve a named reference"), 313 "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"),
315 EXCEP_TXT("AE_AML_INVALID_SPACE_ID", 316 EXCEP_TXT("AE_AML_INVALID_SPACE_ID",
316 "An Operation Region SpaceID is invalid"), 317 "An Operation Region SpaceID is invalid"),
317 EXCEP_TXT("AE_AML_STRING_LIMIT", 318 EXCEP_TXT("AE_AML_STRING_LIMIT",
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index 6f69a4f638f8..8b3eae96706a 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acnames.h - Global names and strings 4 * Name: acnames.h - Global names and strings
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 6db9a6d40c85..30b1ae53689f 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acoutput.h -- debug output 4 * Name: acoutput.h -- debug output
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -201,6 +201,7 @@
201#define ACPI_EXCEPTION(plist) acpi_exception plist 201#define ACPI_EXCEPTION(plist) acpi_exception plist
202#define ACPI_ERROR(plist) acpi_error plist 202#define ACPI_ERROR(plist) acpi_error plist
203#define ACPI_BIOS_WARNING(plist) acpi_bios_warning plist 203#define ACPI_BIOS_WARNING(plist) acpi_bios_warning plist
204#define ACPI_BIOS_EXCEPTION(plist) acpi_bios_exception plist
204#define ACPI_BIOS_ERROR(plist) acpi_bios_error plist 205#define ACPI_BIOS_ERROR(plist) acpi_bios_error plist
205#define ACPI_DEBUG_OBJECT(obj,l,i) acpi_ex_do_debug_object(obj,l,i) 206#define ACPI_DEBUG_OBJECT(obj,l,i) acpi_ex_do_debug_object(obj,l,i)
206 207
@@ -213,6 +214,7 @@
213#define ACPI_EXCEPTION(plist) 214#define ACPI_EXCEPTION(plist)
214#define ACPI_ERROR(plist) 215#define ACPI_ERROR(plist)
215#define ACPI_BIOS_WARNING(plist) 216#define ACPI_BIOS_WARNING(plist)
217#define ACPI_BIOS_EXCEPTION(plist)
216#define ACPI_BIOS_ERROR(plist) 218#define ACPI_BIOS_ERROR(plist)
217#define ACPI_DEBUG_OBJECT(obj,l,i) 219#define ACPI_DEBUG_OBJECT(obj,l,i)
218 220
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index ccdc5981bc91..bc7d39ecf574 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acpi.h - Master public include file used to interface to ACPICA 4 * Name: acpi.h - Master public include file used to interface to ACPICA
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index eb1f21af7556..1b59fb61f67d 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -5,7 +5,7 @@
5 * interfaces must be implemented by OSL to interface the 5 * interfaces must be implemented by OSL to interface the
6 * ACPI components to the host operating system. 6 * ACPI components to the host operating system.
7 * 7 *
8 * Copyright (C) 2000 - 2018, Intel Corp. 8 * Copyright (C) 2000 - 2019, Intel Corp.
9 * 9 *
10 *****************************************************************************/ 10 *****************************************************************************/
11 11
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 7aa38b648564..24dbb4e742a6 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acpixf.h - External interfaces to the ACPI subsystem 4 * Name: acpixf.h - External interfaces to the ACPI subsystem
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -12,7 +12,7 @@
12 12
13/* Current ACPICA subsystem version in YYYYMMDD format */ 13/* Current ACPICA subsystem version in YYYYMMDD format */
14 14
15#define ACPI_CA_VERSION 0x20181213 15#define ACPI_CA_VERSION 0x20190215
16 16
17#include <acpi/acconfig.h> 17#include <acpi/acconfig.h>
18#include <acpi/actypes.h> 18#include <acpi/actypes.h>
@@ -157,14 +157,6 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
157ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE); 157ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
158 158
159/* 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 */
165ACPI_INIT_GLOBAL(u8, acpi_gbl_execute_tables_as_methods, TRUE);
166
167/*
168 * Optionally use 32-bit FADT addresses if and when there is a conflict 160 * Optionally use 32-bit FADT addresses if and when there is a conflict
169 * (address mismatch) between the 32-bit and 64-bit versions of the 161 * (address mismatch) between the 32-bit and 64-bit versions of the
170 * address. Although ACPICA adheres to the ACPI specification which 162 * address. Although ACPICA adheres to the ACPI specification which
@@ -903,6 +895,12 @@ ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
903 acpi_bios_error(const char *module_name, 895 acpi_bios_error(const char *module_name,
904 u32 line_number, 896 u32 line_number,
905 const char *format, ...)) 897 const char *format, ...))
898ACPI_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, ...))
906ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) 904ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
907 void ACPI_INTERNAL_VAR_XFACE 905 void ACPI_INTERNAL_VAR_XFACE
908 acpi_bios_warning(const char *module_name, 906 acpi_bios_warning(const char *module_name,
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index 724ad5f29a16..62930583219f 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acrestyp.h - Defines, types, and structures for resource descriptors 4 * Name: acrestyp.h - Defines, types, and structures for resource descriptors
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -139,7 +139,7 @@ struct acpi_resource_irq {
139 u8 descriptor_length; 139 u8 descriptor_length;
140 u8 triggering; 140 u8 triggering;
141 u8 polarity; 141 u8 polarity;
142 u8 sharable; 142 u8 shareable;
143 u8 wake_capable; 143 u8 wake_capable;
144 u8 interrupt_count; 144 u8 interrupt_count;
145 u8 interrupts[1]; 145 u8 interrupts[1];
@@ -328,7 +328,7 @@ struct acpi_resource_extended_irq {
328 u8 producer_consumer; 328 u8 producer_consumer;
329 u8 triggering; 329 u8 triggering;
330 u8 polarity; 330 u8 polarity;
331 u8 sharable; 331 u8 shareable;
332 u8 wake_capable; 332 u8 wake_capable;
333 u8 interrupt_count; 333 u8 interrupt_count;
334 struct acpi_resource_source resource_source; 334 struct acpi_resource_source resource_source;
@@ -348,7 +348,7 @@ struct acpi_resource_gpio {
348 u8 connection_type; 348 u8 connection_type;
349 u8 producer_consumer; /* For values, see Producer/Consumer above */ 349 u8 producer_consumer; /* For values, see Producer/Consumer above */
350 u8 pin_config; 350 u8 pin_config;
351 u8 sharable; /* For values, see Interrupt Attributes above */ 351 u8 shareable; /* For values, see Interrupt Attributes above */
352 u8 wake_capable; /* For values, see Interrupt Attributes above */ 352 u8 wake_capable; /* For values, see Interrupt Attributes above */
353 u8 io_restriction; 353 u8 io_restriction;
354 u8 triggering; /* For values, see Interrupt Attributes above */ 354 u8 triggering; /* For values, see Interrupt Attributes above */
@@ -508,7 +508,7 @@ struct acpi_resource_uart_serialbus {
508struct acpi_resource_pin_function { 508struct acpi_resource_pin_function {
509 u8 revision_id; 509 u8 revision_id;
510 u8 pin_config; 510 u8 pin_config;
511 u8 sharable; /* For values, see Interrupt Attributes above */ 511 u8 shareable; /* For values, see Interrupt Attributes above */
512 u16 function_number; 512 u16 function_number;
513 u16 pin_table_length; 513 u16 pin_table_length;
514 u16 vendor_length; 514 u16 vendor_length;
@@ -520,7 +520,7 @@ struct acpi_resource_pin_function {
520struct acpi_resource_pin_config { 520struct acpi_resource_pin_config {
521 u8 revision_id; 521 u8 revision_id;
522 u8 producer_consumer; /* For values, see Producer/Consumer above */ 522 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 */
524 u8 pin_config_type; 524 u8 pin_config_type;
525 u32 pin_config_value; 525 u32 pin_config_value;
526 u16 pin_table_length; 526 u16 pin_table_length;
@@ -560,7 +560,7 @@ struct acpi_resource_pin_group {
560struct acpi_resource_pin_group_function { 560struct acpi_resource_pin_group_function {
561 u8 revision_id; 561 u8 revision_id;
562 u8 producer_consumer; /* For values, see Producer/Consumer above */ 562 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 */
564 u16 function_number; 564 u16 function_number;
565 u16 vendor_length; 565 u16 vendor_length;
566 struct acpi_resource_source resource_source; 566 struct acpi_resource_source resource_source;
@@ -571,7 +571,7 @@ struct acpi_resource_pin_group_function {
571struct acpi_resource_pin_group_config { 571struct acpi_resource_pin_group_config {
572 u8 revision_id; 572 u8 revision_id;
573 u8 producer_consumer; /* For values, see Producer/Consumer above */ 573 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 */
575 u8 pin_config_type; /* For values, see pin_config_type above */ 575 u8 pin_config_type; /* For values, see pin_config_type above */
576 u32 pin_config_value; 576 u32 pin_config_value;
577 u16 vendor_length; 577 u16 vendor_length;
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 0a977eca0a74..65cc9cbf1141 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: actbl.h - Basic ACPI Table Definitions 4 * Name: actbl.h - Basic ACPI Table Definitions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index ab424509cae9..d14037ddf108 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: actbl1.h - Additional ACPI table definitions 4 * Name: actbl1.h - Additional ACPI table definitions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -562,7 +562,7 @@ struct acpi_dmar_hardware_unit {
562 562
563#define ACPI_DMAR_INCLUDE_ALL (1) 563#define ACPI_DMAR_INCLUDE_ALL (1)
564 564
565/* 1: Reserved Memory Defininition */ 565/* 1: Reserved Memory Definition */
566 566
567struct acpi_dmar_reserved_memory { 567struct acpi_dmar_reserved_memory {
568 struct acpi_dmar_header header; 568 struct acpi_dmar_header header;
@@ -1001,6 +1001,11 @@ struct acpi_table_gtdt {
1001#define ACPI_GTDT_INTERRUPT_POLARITY (1<<1) 1001#define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
1002#define ACPI_GTDT_ALWAYS_ON (1<<2) 1002#define ACPI_GTDT_ALWAYS_ON (1<<2)
1003 1003
1004struct acpi_gtdt_el2 {
1005 u32 virtual_el2_timer_gsiv;
1006 u32 virtual_el2_timer_flags;
1007};
1008
1004/* Common GTDT subtable header */ 1009/* Common GTDT subtable header */
1005 1010
1006struct acpi_gtdt_header { 1011struct acpi_gtdt_header {
@@ -1390,7 +1395,7 @@ struct acpi_table_hmat {
1390/* Values for HMAT structure types */ 1395/* Values for HMAT structure types */
1391 1396
1392enum acpi_hmat_type { 1397enum 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 */
1394 ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */ 1399 ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */
1395 ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */ 1400 ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */
1396 ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */ 1401 ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
@@ -1406,17 +1411,17 @@ struct acpi_hmat_structure {
1406 * HMAT Structures, correspond to Type in struct acpi_hmat_structure 1411 * HMAT Structures, correspond to Type in struct acpi_hmat_structure
1407 */ 1412 */
1408 1413
1409/* 0: Memory subystem address range */ 1414/* 0: Memory proximity domain attributes */
1410 1415
1411struct acpi_hmat_address_range { 1416struct acpi_hmat_proximity_domain {
1412 struct acpi_hmat_structure header; 1417 struct acpi_hmat_structure header;
1413 u16 flags; 1418 u16 flags;
1414 u16 reserved1; 1419 u16 reserved1;
1415 u32 processor_PD; /* Processor proximity domain */ 1420 u32 processor_PD; /* Processor proximity domain */
1416 u32 memory_PD; /* Memory proximity domain */ 1421 u32 memory_PD; /* Memory proximity domain */
1417 u32 reserved2; 1422 u32 reserved2;
1418 u64 physical_address_base; /* Physical address range base */ 1423 u64 reserved3;
1419 u64 physical_address_length; /* Physical address range length */ 1424 u64 reserved4;
1420}; 1425};
1421 1426
1422/* Masks for Flags field above */ 1427/* Masks for Flags field above */
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index c50ef7e6b942..e45ced27f4c3 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec) 4 * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -143,7 +143,7 @@ struct acpi_iort_memory_access {
143 */ 143 */
144struct acpi_iort_its_group { 144struct acpi_iort_its_group {
145 u32 its_count; 145 u32 its_count;
146 u32 identifiers[1]; /* GIC ITS identifier arrary */ 146 u32 identifiers[1]; /* GIC ITS identifier array */
147}; 147};
148 148
149struct acpi_iort_named_component { 149struct acpi_iort_named_component {
@@ -623,7 +623,7 @@ struct acpi_madt_local_x2apic_nmi {
623 u8 reserved[3]; /* reserved - must be zero */ 623 u8 reserved[3]; /* reserved - must be zero */
624}; 624};
625 625
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) */
627 627
628struct acpi_madt_generic_interrupt { 628struct acpi_madt_generic_interrupt {
629 struct acpi_subtable_header header; 629 struct acpi_subtable_header header;
@@ -641,7 +641,8 @@ struct acpi_madt_generic_interrupt {
641 u64 gicr_base_address; 641 u64 gicr_base_address;
642 u64 arm_mpidr; 642 u64 arm_mpidr;
643 u8 efficiency_class; 643 u8 efficiency_class;
644 u8 reserved2[3]; 644 u8 reserved2[1];
645 u16 spe_interrupt; /* ACPI 6.3 */
645}; 646};
646 647
647/* Masks for Flags field above */ 648/* Masks for Flags field above */
@@ -1361,6 +1362,7 @@ struct acpi_pdtt_channel {
1361 1362
1362#define ACPI_PDTT_RUNTIME_TRIGGER (1) 1363#define ACPI_PDTT_RUNTIME_TRIGGER (1)
1363#define ACPI_PDTT_WAIT_COMPLETION (1<<1) 1364#define ACPI_PDTT_WAIT_COMPLETION (1<<1)
1365#define ACPI_PDTT_TRIGGER_ORDER (1<<2)
1364 1366
1365/******************************************************************************* 1367/*******************************************************************************
1366 * 1368 *
@@ -1472,8 +1474,11 @@ struct acpi_pptt_processor {
1472 1474
1473/* Flags */ 1475/* Flags */
1474 1476
1475#define ACPI_PPTT_PHYSICAL_PACKAGE (1) /* Physical package */ 1477#define ACPI_PPTT_PHYSICAL_PACKAGE (1)
1476#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID (2) /* ACPI Processor ID valid */ 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 */
1477 1482
1478/* 1: Cache Type Structure */ 1483/* 1: Cache Type Structure */
1479 1484
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index ea1ca49c9c1b..7a58c10ce421 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: actbl3.h - ACPI Table Definitions 4 * Name: actbl3.h - ACPI Table Definitions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -190,7 +190,8 @@ enum acpi_srat_type {
190 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2, 190 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
191 ACPI_SRAT_TYPE_GICC_AFFINITY = 3, 191 ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
192 ACPI_SRAT_TYPE_GIC_ITS_AFFINITY = 4, /* ACPI 6.2 */ 192 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 */
194}; 195};
195 196
196/* 197/*
@@ -271,6 +272,22 @@ struct acpi_srat_gic_its_affinity {
271 u32 its_id; 272 u32 its_id;
272}; 273};
273 274
275/* 5: Generic Initiator Affinity Structure (ACPI 6.3) */
276
277struct 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
274/******************************************************************************* 291/*******************************************************************************
275 * 292 *
276 * STAO - Status Override Table (_STA override) - ACPI 6.0 293 * STAO - Status Override Table (_STA override) - ACPI 6.0
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 2590627dbfcc..f73382e82c26 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: actypes.h - Common data types for the entire ACPI subsystem 4 * Name: actypes.h - Common data types for the entire ACPI subsystem
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
@@ -617,8 +617,9 @@ typedef u64 acpi_integer;
617#define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C 617#define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C
618#define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D 618#define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D
619#define ACPI_NOTIFY_MEMORY_UPDATE (u8) 0x0E 619#define ACPI_NOTIFY_MEMORY_UPDATE (u8) 0x0E
620#define ACPI_NOTIFY_DISCONNECT_RECOVER (u8) 0x0F
620 621
621#define ACPI_GENERIC_NOTIFY_MAX 0x0E 622#define ACPI_GENERIC_NOTIFY_MAX 0x0F
622#define ACPI_SPECIFIC_NOTIFY_MAX 0x84 623#define ACPI_SPECIFIC_NOTIFY_MAX 0x84
623 624
624/* 625/*
@@ -885,15 +886,6 @@ typedef u8 acpi_adr_space_type;
885#define ACPI_ENABLE_EVENT 1 886#define ACPI_ENABLE_EVENT 1
886#define ACPI_DISABLE_EVENT 0 887#define ACPI_DISABLE_EVENT 0
887 888
888/* Sleep function dispatch */
889
890typedef acpi_status (*acpi_sleep_function) (u8 sleep_state);
891
892struct acpi_sleep_functions {
893 acpi_sleep_function legacy_function;
894 acpi_sleep_function extended_function;
895};
896
897/* 889/*
898 * External ACPI object definition 890 * External ACPI object definition
899 */ 891 */
diff --git a/include/acpi/acuuid.h b/include/acpi/acuuid.h
index e63f214531ad..23262cab047a 100644
--- a/include/acpi/acuuid.h
+++ b/include/acpi/acuuid.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acuuid.h - ACPI-related UUID/GUID definitions 4 * Name: acuuid.h - ACPI-related UUID/GUID definitions
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
index 82cb4eb225a4..e3f1cddb4ac8 100644
--- a/include/acpi/ghes.h
+++ b/include/acpi/ghes.h
@@ -13,7 +13,6 @@
13 * estatus: memory buffer for error status block, allocated during 13 * estatus: memory buffer for error status block, allocated during
14 * HEST parsing. 14 * HEST parsing.
15 */ 15 */
16#define GHES_TO_CLEAR 0x0001
17#define GHES_EXITING 0x0002 16#define GHES_EXITING 0x0002
18 17
19struct ghes { 18struct ghes {
@@ -22,7 +21,6 @@ struct ghes {
22 struct acpi_hest_generic_v2 *generic_v2; 21 struct acpi_hest_generic_v2 *generic_v2;
23 }; 22 };
24 struct acpi_hest_generic_status *estatus; 23 struct acpi_hest_generic_status *estatus;
25 u64 buffer_paddr;
26 unsigned long flags; 24 unsigned long flags;
27 union { 25 union {
28 struct list_head list; 26 struct list_head list;
@@ -52,6 +50,8 @@ enum {
52 GHES_SEV_PANIC = 0x3, 50 GHES_SEV_PANIC = 0x3,
53}; 51};
54 52
53int ghes_estatus_pool_init(int num_ghes);
54
55/* From drivers/edac/ghes_edac.c */ 55/* From drivers/edac/ghes_edac.c */
56 56
57#ifdef CONFIG_EDAC_GHES 57#ifdef CONFIG_EDAC_GHES
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index f444e5b0fdaa..35ab3f87cc29 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acenv.h - Host and compiler configuration 4 * Name: acenv.h - Host and compiler configuration
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/acpi/platform/acenvex.h b/include/acpi/platform/acenvex.h
index 47d690eafe4c..2e36c8344897 100644
--- a/include/acpi/platform/acenvex.h
+++ b/include/acpi/platform/acenvex.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acenvex.h - Extra host and compiler configuration 4 * Name: acenvex.h - Extra host and compiler configuration
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 085db95a3dae..6a0705b433d2 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acgcc.h - GCC specific defines, etc. 4 * Name: acgcc.h - GCC specific defines, etc.
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/acpi/platform/acgccex.h b/include/acpi/platform/acgccex.h
index 5d2b667af829..8dda2856aca1 100644
--- a/include/acpi/platform/acgccex.h
+++ b/include/acpi/platform/acgccex.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acgccex.h - Extra GCC specific defines, etc. 4 * Name: acgccex.h - Extra GCC specific defines, etc.
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/acpi/platform/acintel.h b/include/acpi/platform/acintel.h
index 626265833a54..d2cc247248cb 100644
--- a/include/acpi/platform/acintel.h
+++ b/include/acpi/platform/acintel.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: acintel.h - VC specific defines, etc. 4 * Name: acintel.h - VC specific defines, etc.
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index e3d21d014fcc..9ff328fd946a 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: aclinux.h - OS specific defines, etc. for Linux 4 * Name: aclinux.h - OS specific defines, etc. for Linux
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/acpi/platform/aclinuxex.h b/include/acpi/platform/aclinuxex.h
index d754a1b12721..cc4f1eb53cba 100644
--- a/include/acpi/platform/aclinuxex.h
+++ b/include/acpi/platform/aclinuxex.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Name: aclinuxex.h - Extra OS specific defines, etc. for Linux 4 * Name: aclinuxex.h - Extra OS specific defines, etc. for Linux
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/include/linux/arm_sdei.h b/include/linux/arm_sdei.h
index 942afbd544b7..3305ea7f9dc7 100644
--- a/include/linux/arm_sdei.h
+++ b/include/linux/arm_sdei.h
@@ -11,7 +11,11 @@ enum sdei_conduit_types {
11 CONDUIT_HVC, 11 CONDUIT_HVC,
12}; 12};
13 13
14#include <acpi/ghes.h>
15
16#ifdef CONFIG_ARM_SDE_INTERFACE
14#include <asm/sdei.h> 17#include <asm/sdei.h>
18#endif
15 19
16/* Arch code should override this to set the entry point from firmware... */ 20/* Arch code should override this to set the entry point from firmware... */
17#ifndef sdei_arch_get_entry_point 21#ifndef sdei_arch_get_entry_point
@@ -39,6 +43,11 @@ int sdei_event_unregister(u32 event_num);
39int sdei_event_enable(u32 event_num); 43int sdei_event_enable(u32 event_num);
40int sdei_event_disable(u32 event_num); 44int sdei_event_disable(u32 event_num);
41 45
46/* GHES register/unregister helpers */
47int sdei_register_ghes(struct ghes *ghes, sdei_event_callback *normal_cb,
48 sdei_event_callback *critical_cb);
49int sdei_unregister_ghes(struct ghes *ghes);
50
42#ifdef CONFIG_ARM_SDE_INTERFACE 51#ifdef CONFIG_ARM_SDE_INTERFACE
43/* For use by arch code when CPU hotplug notifiers are not appropriate. */ 52/* For use by arch code when CPU hotplug notifiers are not appropriate. */
44int sdei_mask_local_cpu(void); 53int sdei_mask_local_cpu(void);
diff --git a/include/linux/initrd.h b/include/linux/initrd.h
index 14beaff9b445..d77fe34fb00a 100644
--- a/include/linux/initrd.h
+++ b/include/linux/initrd.h
@@ -25,3 +25,6 @@ extern phys_addr_t phys_initrd_start;
25extern unsigned long phys_initrd_size; 25extern unsigned long phys_initrd_size;
26 26
27extern unsigned int real_root_dev; 27extern unsigned int real_root_dev;
28
29extern char __initramfs_start[];
30extern unsigned long __initramfs_size;
diff --git a/tools/power/acpi/common/cmfsize.c b/tools/power/acpi/common/cmfsize.c
index ff8025de8237..28c11c6b4d06 100644
--- a/tools/power/acpi/common/cmfsize.c
+++ b/tools/power/acpi/common/cmfsize.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: cfsize - Common get file size function 4 * Module Name: cfsize - Common get file size function
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/tools/power/acpi/common/getopt.c b/tools/power/acpi/common/getopt.c
index 7be89b873661..6b41d8b64a00 100644
--- a/tools/power/acpi/common/getopt.c
+++ b/tools/power/acpi/common/getopt.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: getopt 4 * Module Name: getopt
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
index a20c703f8b7d..2a1fd9182f94 100644
--- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
+++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: oslinuxtbl - Linux OSL for obtaining ACPI tables 4 * Module Name: oslinuxtbl - Linux OSL for obtaining ACPI tables
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/tools/power/acpi/os_specific/service_layers/osunixdir.c b/tools/power/acpi/os_specific/service_layers/osunixdir.c
index 4fd44e218a83..30913f124dd5 100644
--- a/tools/power/acpi/os_specific/service_layers/osunixdir.c
+++ b/tools/power/acpi/os_specific/service_layers/osunixdir.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: osunixdir - Unix directory access interfaces 4 * Module Name: osunixdir - Unix directory access interfaces
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/tools/power/acpi/os_specific/service_layers/osunixmap.c b/tools/power/acpi/os_specific/service_layers/osunixmap.c
index 93d8359309b6..29dfb47adfeb 100644
--- a/tools/power/acpi/os_specific/service_layers/osunixmap.c
+++ b/tools/power/acpi/os_specific/service_layers/osunixmap.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: osunixmap - Unix OSL for file mappings 4 * Module Name: osunixmap - Unix OSL for file mappings
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/tools/power/acpi/os_specific/service_layers/osunixxf.c b/tools/power/acpi/os_specific/service_layers/osunixxf.c
index 8a88e87778bd..83d3b3b829b8 100644
--- a/tools/power/acpi/os_specific/service_layers/osunixxf.c
+++ b/tools/power/acpi/os_specific/service_layers/osunixxf.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: osunixxf - UNIX OSL interfaces 4 * Module Name: osunixxf - UNIX OSL interfaces
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/tools/power/acpi/tools/acpidump/acpidump.h b/tools/power/acpi/tools/acpidump/acpidump.h
index f69f1f559743..2eb0aaa4f462 100644
--- a/tools/power/acpi/tools/acpidump/acpidump.h
+++ b/tools/power/acpi/tools/acpidump/acpidump.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: acpidump.h - Include file for acpi_dump utility 4 * Module Name: acpidump.h - Include file for acpi_dump utility
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/tools/power/acpi/tools/acpidump/apdump.c b/tools/power/acpi/tools/acpidump/apdump.c
index a9848de32d8e..e256c2ac5ddc 100644
--- a/tools/power/acpi/tools/acpidump/apdump.c
+++ b/tools/power/acpi/tools/acpidump/apdump.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: apdump - Dump routines for ACPI tables (acpidump) 4 * Module Name: apdump - Dump routines for ACPI tables (acpidump)
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/tools/power/acpi/tools/acpidump/apfiles.c b/tools/power/acpi/tools/acpidump/apfiles.c
index e86207e5afcf..49972bc78bc5 100644
--- a/tools/power/acpi/tools/acpidump/apfiles.c
+++ b/tools/power/acpi/tools/acpidump/apfiles.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: apfiles - File-related functions for acpidump utility 4 * Module Name: apfiles - File-related functions for acpidump utility
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/tools/power/acpi/tools/acpidump/apmain.c b/tools/power/acpi/tools/acpidump/apmain.c
index 2d9b94b631cb..d8f1b57537d3 100644
--- a/tools/power/acpi/tools/acpidump/apmain.c
+++ b/tools/power/acpi/tools/acpidump/apmain.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module Name: apmain - Main module for the acpidump utility 4 * Module Name: apmain - Main module for the acpidump utility
5 * 5 *
6 * Copyright (C) 2000 - 2018, Intel Corp. 6 * Copyright (C) 2000 - 2019, Intel Corp.
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
index 30251e288629..e9d28a7ca673 100644
--- a/virt/kvm/arm/mmu.c
+++ b/virt/kvm/arm/mmu.c
@@ -27,10 +27,10 @@
27#include <asm/kvm_arm.h> 27#include <asm/kvm_arm.h>
28#include <asm/kvm_mmu.h> 28#include <asm/kvm_mmu.h>
29#include <asm/kvm_mmio.h> 29#include <asm/kvm_mmio.h>
30#include <asm/kvm_ras.h>
30#include <asm/kvm_asm.h> 31#include <asm/kvm_asm.h>
31#include <asm/kvm_emulate.h> 32#include <asm/kvm_emulate.h>
32#include <asm/virt.h> 33#include <asm/virt.h>
33#include <asm/system_misc.h>
34 34
35#include "trace.h" 35#include "trace.h"
36 36
@@ -1906,7 +1906,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu, struct kvm_run *run)
1906 * For RAS the host kernel may handle this abort. 1906 * For RAS the host kernel may handle this abort.
1907 * There is no need to pass the error into the guest. 1907 * There is no need to pass the error into the guest.
1908 */ 1908 */
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)))
1910 return 1; 1910 return 1;
1911 1911
1912 if (unlikely(!is_iabt)) { 1912 if (unlikely(!is_iabt)) {