public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-acpi@vger.kernel.org
Subject: [PATCH AUTOSEL 4.20 079/105] ACPI: EC: Look for ECDT EC after calling acpi_load_tables()
Date: Tue, 12 Feb 2019 21:33:10 -0500	[thread overview]
Message-ID: <20190213023336.19019-79-sashal@kernel.org> (raw)
In-Reply-To: <20190213023336.19019-1-sashal@kernel.org>

From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

[ Upstream commit b1c0330823fe842dbb34641f1410f0afa51c29d3 ]

Some systems have had functional issues since commit 5a8361f7ecce
(ACPICA: Integrate package handling with module-level code) that,
among other things, changed the initial values of the
acpi_gbl_group_module_level_code and acpi_gbl_parse_table_as_term_list
global flags in ACPICA which implicitly caused acpi_ec_ecdt_probe() to
be called before acpi_load_tables() on the vast majority of platforms.

Namely, before commit 5a8361f7ecce, acpi_load_tables() was called from
acpi_early_init() if acpi_gbl_parse_table_as_term_list was FALSE and
acpi_gbl_group_module_level_code was TRUE, which almost always was
the case as FALSE and TRUE were their initial values, respectively.
The acpi_gbl_parse_table_as_term_list value would be changed to TRUE
for a couple of platforms in acpi_quirks_dmi_table[], but it remained
FALSE in the vast majority of cases.

After commit 5a8361f7ecce, the initial values of the two flags have
been reversed, so in effect acpi_load_tables() has not been called
from acpi_early_init() any more.  That, in turn, affects
acpi_ec_ecdt_probe() which is invoked before acpi_load_tables() now
and it is not possible to evaluate the _REG method for the EC address
space handler installed by it.  That effectively causes the EC address
space to be inaccessible to AML on platforms with an ECDT matching the
EC device definition in the DSDT and functional problems ensue in
there.

Because the default behavior before commit 5a8361f7ecce was to call
acpi_ec_ecdt_probe() after acpi_load_tables(), it should be safe to
do that again.  Moreover, the EC address space handler installed by
acpi_ec_ecdt_probe() is only needed for AML to be able to access the
EC address space and the only AML that can run during acpi_load_tables()
is module-level code which only is allowed to access address spaces
with default handlers (memory, I/O and PCI config space).

For this reason, move the acpi_ec_ecdt_probe() invocation back to
acpi_bus_init(), from where it was taken away by commit d737f333b211
(ACPI: probe ECDT before loading AML tables regardless of module-level
code flag), and put it after the invocation of acpi_load_tables() to
restore the original code ordering from before commit 5a8361f7ecce.

Fixes: 5a8361f7ecce ("ACPICA: Integrate package handling with module-level code")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=199981
Reported-by: step-ali <sunmooon15@gmail.com>
Reported-by: Charles Stanhope <charles.stanhope@gmail.com>
Tested-by: Charles Stanhope <charles.stanhope@gmail.com>
Reported-by: Paulo Nascimento <paulo.ulusu@googlemail.com>
Reported-by: David Purton <dcpurton@marshwiggle.net>
Reported-by: Adam Harvey <adam@adamharvey.name>
Reported-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Jean-Marc Lenoir <archlinux@jihemel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/bus.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index bb3d96dea6db..26d4164d394f 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -1054,18 +1054,6 @@ void __init acpi_early_init(void)
 		goto error0;
 	}
 
-	/*
-	 * ACPI 2.0 requires the EC driver to be loaded and work before
-	 * the EC device is found in the namespace (i.e. before
-	 * acpi_load_tables() is called).
-	 *
-	 * This is accomplished by looking for the ECDT table, and getting
-	 * the EC parameters out of that.
-	 *
-	 * Ignore the result. Not having an ECDT is not fatal.
-	 */
-	status = acpi_ec_ecdt_probe();
-
 #ifdef CONFIG_X86
 	if (!acpi_ioapic) {
 		/* compatible (0) means level (3) */
@@ -1142,6 +1130,18 @@ static int __init acpi_bus_init(void)
 		goto error1;
 	}
 
+	/*
+	 * ACPI 2.0 requires the EC driver to be loaded and work before the EC
+	 * device is found in the namespace.
+	 *
+	 * This is accomplished by looking for the ECDT table and getting the EC
+	 * parameters out of that.
+	 *
+	 * Do that before calling acpi_initialize_objects() which may trigger EC
+	 * address space accesses.
+	 */
+	acpi_ec_ecdt_probe();
+
 	status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
 	if (ACPI_FAILURE(status)) {
 		printk(KERN_ERR PREFIX
-- 
2.19.1


  parent reply	other threads:[~2019-02-13  2:35 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13  2:31 [PATCH AUTOSEL 4.20 001/105] backlight: pwm_bl: Fix devicetree parsing with auto-generated brightness tables Sasha Levin
2019-02-13  2:31 ` [PATCH AUTOSEL 4.20 002/105] mfd: ti_am335x_tscadc: Use PLATFORM_DEVID_AUTO while registering mfd cells Sasha Levin
2019-02-13  2:31 ` [PATCH AUTOSEL 4.20 003/105] pvcalls-front: read all data before closing the connection Sasha Levin
2019-02-13  2:31 ` [PATCH AUTOSEL 4.20 004/105] pvcalls-front: don't try to free unallocated rings Sasha Levin
2019-02-13  2:31 ` [PATCH AUTOSEL 4.20 005/105] pvcalls-front: properly allocate sk Sasha Levin
2019-02-13  2:31 ` [PATCH AUTOSEL 4.20 006/105] pvcalls-back: set -ENOTCONN in pvcalls_conn_back_read Sasha Levin
2019-02-13  2:31 ` [PATCH AUTOSEL 4.20 007/105] mfd: twl-core: Fix section annotations on {,un}protect_pm_master Sasha Levin
2019-02-13  2:31 ` [PATCH AUTOSEL 4.20 008/105] mfd: db8500-prcmu: Fix some section annotations Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 009/105] mfd: mt6397: Do not call irq_domain_remove if PMIC unsupported Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 010/105] mfd: ab8500-core: Return zero in get_register_interruptible() Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 011/105] mfd: bd9571mwv: Add volatile register to make DVFS work Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 012/105] mfd: at91-usart: Add platform dependency Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 013/105] mfd: qcom_rpm: write fw_version to CTRL_REG Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 014/105] mfd: wm5110: Add missing ASRC rate register Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 015/105] mfd: axp20x: Add AC power supply cell for AXP813 Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 016/105] mfd: axp20x: Re-align MFD cell entries Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 017/105] mfd: axp20x: Add supported cells for AXP803 Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 018/105] mfd: cros_ec_dev: Add missing mfd_remove_devices() call in remove Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 019/105] mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe() Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 020/105] mfd: mc13xxx: Fix a missing check of a register-read failure Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 021/105] xen/pvcalls: remove set but not used variable 'intf' Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 022/105] soc/fsl/qe: fix err handling of ucc_of_parse_tdm Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 023/105] qed: Fix qed_chain_set_prod() for PBL chains with non power of 2 page count Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 024/105] qed: Fix qed_ll2_post_rx_buffer_notify_fw() by adding a write memory barrier Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 025/105] net: hns: Fix use after free identified by SLUB debug Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 026/105] selftests: net: fix/improve ip_defrag selftest Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 027/105] bpf: Fix [::] -> [::1] rewrite in sys_sendmsg Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 028/105] selftests/bpf: Test [::] -> [::1] rewrite in sys_sendmsg in test_sock_addr Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 029/105] hwmon: (nct6775) Fix chip ID for NCT6798D Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 030/105] hwmon: (nct6775) Enable IO mapping for NCT6797D and NCT6798D Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 031/105] watchdog: mt7621_wdt/rt2880_wdt: Fix compilation problem Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 032/105] net/mlx4: Get rid of page operation after dma_alloc_coherent Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 033/105] MIPS: ath79: Enable OF serial ports in the default config Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 034/105] xprtrdma: Double free in rpcrdma_sendctxs_create() Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 035/105] mlxsw: spectrum_acl: Add cleanup after C-TCAM update error condition Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 036/105] mlxsw: spectrum: Add VXLAN dependency for spectrum Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 037/105] selftests: forwarding: Add a test for VLAN deletion Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 038/105] netfilter: nf_tables: fix leaking object reference count Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 039/105] scsi: qla4xxx: check return code of qla4xxx_copy_from_fwddb_param Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 040/105] scsi: isci: initialize shost fully before calling scsi_add_host() Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 041/105] include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 042/105] MIPS: jazz: fix 64bit build Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 043/105] netfilter: nft_flow_offload: Fix reverse route lookup Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 044/105] bpf: correctly set initial window on active Fast Open sender Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 045/105] pvcalls-front: Avoid get_free_pages(GFP_KERNEL) under spinlock Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 046/105] selftests: bpf: install files tcp_(server|client)*.py Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 047/105] bpf: fix panic in stack_map_get_build_id() on i386 and arm32 Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 048/105] afs: Set correct lock type for the yfs CreateFile Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 049/105] netfilter: nft_flow_offload: fix interaction with vrf slave device Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 050/105] RDMA/mthca: Clear QP objects during their allocation Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 051/105] powerpc/8xx: fix setting of pagetable for Abatron BDI debug tool Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 052/105] acpi/nfit: Fix race accessing memdev in nfit_get_smbios_id() Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 053/105] net: stmmac: Fix PCI module removal leak Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 054/105] net: stmmac: dwxgmac2: Only clear interrupts that are active Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 055/105] net: stmmac: Check if CBS is supported before configuring Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 056/105] net: stmmac: Fix the logic of checking if RX Watchdog must be enabled Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 057/105] net: stmmac: Prevent RX starvation in stmmac_napi_poll() Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 058/105] isdn: i4l: isdn_tty: Fix some concurrency double-free bugs Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 059/105] scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 060/105] scsi: ufs: Fix system suspend status Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 061/105] scsi: qedi: Add ep_state for login completion on un-reachable targets Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 062/105] scsi: ufs: Fix geometry descriptor size Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 063/105] scsi: qla1280: set 64bit coherent mask Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 064/105] scsi: cxgb4i: add wait_for_completion() Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 065/105] netfilter: nft_flow_offload: fix checking method of conntrack helper Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 066/105] always clear the X2APIC_ENABLE bit for PV guest Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 067/105] drm/meson: add missing of_node_put Sasha Levin
2019-02-13  2:32 ` [PATCH AUTOSEL 4.20 068/105] drm/amdkfd: Don't assign dGPUs to APU topology devices Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 069/105] drm/amd/display: fix PME notification not working in RV desktop Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 070/105] vhost: return EINVAL if iovecs size does not match the message size Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 071/105] vhost/scsi: Use copy_to_iter() to send control queue response Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 072/105] xsk: Check if a queue exists during umem setup Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 073/105] selftests/bpf: install with_tunnels.sh for test_flow_dissector.sh Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 074/105] samples/bpf: workaround clang asm goto compilation errors Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 075/105] SUNRPC: Ensure rq_bytes_sent is reset before request transmission Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 076/105] SUNRPC: Ensure we respect the RPCSEC_GSS sequence number limit Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 077/105] drm/sun4i: backend: add missing of_node_puts Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 078/105] pvcalls-front: fix potential null dereference Sasha Levin
2019-02-13  2:33 ` Sasha Levin [this message]
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 080/105] net: phy: micrel: set soft_reset callback to genphy_soft_reset for KSZ9031 Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 081/105] selftests: tc-testing: drop test on missing tunnel key id Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 082/105] selftests: tc-testing: fix tunnel_key failure if dst_port is unspecified Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 083/105] selftests: tc-testing: fix parsing of ife type Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 084/105] PCI: Fix __initdata issue with "pci=disable_acs_redir" parameter Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 085/105] afs: Don't set vnode->cb_s_break in afs_validate() Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 086/105] afs: Fix key refcounting in file locking code Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 087/105] afs: Provide a function to get a ref on a call Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 088/105] afs: Fix race in async call refcounting Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 089/105] bpf: don't assume build-id length is always 20 bytes Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 090/105] bpf: zero out build_id for BPF_STACK_BUILD_ID_IP Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 091/105] selftests/bpf: retry tests that expect build-id Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 092/105] atm: he: fix sign-extension overflow on large shift Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 093/105] hwmon: (tmp421) Correct the misspelling of the tmp442 compatible attribute in OF device ID table Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 094/105] leds: lp5523: fix a missing check of return value of lp55xx_read Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 095/105] bpf: bpf_setsockopt: reset sock dst on SO_MARK changes Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 096/105] bpf: fix SO_MAX_PACING_RATE to support TCP internal pacing Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 097/105] dpaa_eth: NETIF_F_LLTX requires to do our own update of trans_start Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 098/105] mlxsw: pci: Return error on PCI reset timeout Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 099/105] net: bridge: Mark FDB entries that were added by user as such Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 100/105] mlxsw: spectrum_switchdev: Do not treat static FDB entries as sticky Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 101/105] selftests: forwarding: Add a test case for externally learned FDB entries Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 102/105] bpf: pull in pkt_sched.h header for tooling to fix bpftool build Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 103/105] net/mlx5e: Force CHECKSUM_UNNECESSARY for short ethernet frames Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 104/105] net/mlx5e: Fix wrong (zero) TX drop counter indication for representor Sasha Levin
2019-02-13  2:33 ` [PATCH AUTOSEL 4.20 105/105] isdn: avm: Fix string plus integer warning from Clang Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190213023336.19019-79-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox