PCI: Disable ACPI wakeup on MSI MS-1592 and MS-1594 dGPU root port
Subsystems (3)
PATCH 1/1 PCI: Disable ACPI wakeup on MSI MS-1592 and MS-1594 dGPU root port
On MSI Summit E16 Flip A12UCT (motherboard MS-1592, BIOS E1592IMS.111) and MSI Prestige 16 Studio A13VE / Summit E16 Flip A13VET (motherboard MS-1594, BIOS E1594IMS.115), the I2C touchpad (ELAN0305:00, 04F3:31FD) permanently stops generating interrupts as soon as the discrete NVIDIA GPU (0000:01:00.0) and its parent PCIe Root Port (0000:00:06.0, \_SB.PC00.PEG0) enter D3cold.
In the platform's SSDT (MSI_NB / AdlP_Rvp), \_SB.PC00.PEG0 sets its wake GPIO (WAKG) from the BIOS NVS variable P1WP, which erroneously points to GPP_A20 (INTC1055:00 pin 62) -- the GPIO interrupt line wired to the touchpad.
During boot, \_SB.PC00.PEG0.PON() calls \_SB.SHPO(WAKG, One), setting PAD_CFG0_GPP_A20.GPIROUTSCI = 0 and HostSwOwn = 1 so the OS GPIO driver owns the pin. However, when the root port runtime-suspends to D3cold, Linux enables ACPI wakeup via \_SB.PC00.PEG0._DSW(1, 0, 3), which sets WKEN = 1. Subsequent evaluation of \_SB.PC00.PEG0.PXP._OFF -> POFF() executes:
If (CondRefOf (WAKG))
{
If (((WAKG != Zero) && WKEN))
{
\_SB.SHPO (WAKG, Zero)
}
}This switches GPP_A20 ownership to ACPI GPE mode (HostSwOwn = 0, GPIROUTSCI = 1), silencing the touchpad interrupt until the dGPU wakes back up to D0. Under Windows, _DSW is not armed for S0 D3cold on this root port, leaving WKEN = 0 so POFF() powers off the dGPU (\PIN.OFF(PWRG)) without touching GPP_A20.
Add a PCI quirk for boards MS-1592 and MS-1594 on root port 0000:00:06.0 (8086:464d on 12th Gen Alder Lake-P and 8086:a74d on 13th Gen Raptor Lake-P/H) to disable ACPI wakeup capability. This keeps WKEN = 0 so the root port and dGPU still reach D3cold normally while leaving GPP_A20 owned by the GPIO driver.
--- drivers/pci/quirks.c | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+)
drivers/pci/quirks.c +50 -0
@@ -3941,6 +3941,56 @@ static void quirk_apple_poweroff_thunderbolt(struct pci_dev *dev)DECLARE_PCI_FIXUP_SUSPEND_LATE (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C , quirk_apple_poweroff_thunderbolt); + +/* +* On MSI Summit E16 Flip A12UCT (board MS-1592) and MSI Prestige 16 Studio +* A13VE / Summit E16 Flip A13VET (board MS-1594), the BIOS SSDT (MSI_NB / +* AdlP_Rvp) assigns the touchpad's GPIO interrupt pin (GPP_A20) as the PCIe +* wake GPIO (WAKG / P1WP) for the dGPU root port (\_SB.PC00.PEG0, 0000:00:06.0). +* +* When ACPI wakeup is armed on this root port via _DSW (setting WKEN = 1), +* subsequent D3cold transitions (\_SB.PC00.PEG0.PXP._OFF -> POFF) call +* \_SB.SHPO(WAKG, Zero), switching GPP_A20 ownership from GPIO driver mode +* to ACPI GPE mode and permanently freezing the I2C touchpad (ELAN0305:00). +* +* Disable ACPI wakeup on this root port so _DSW is not armed and WKEN +* remains zero during D3cold transitions. +*/ +static const struct dmi_system_id msi_peg0_no_wakeup_dmi_table[] = { + { + .ident ="MSI MS-1592" , + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Micro-Star International Co., Ltd." ), +DMI_MATCH (DMI_BOARD_NAME ,"MS-1592" ), + }, + }, + { + .ident ="MSI MS-1594" , + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Micro-Star International Co., Ltd." ), +DMI_MATCH (DMI_BOARD_NAME ,"MS-1594" ), + }, + }, + { } +}; + +static void quirk_msi_peg0_no_wakeup (struct pci_dev *dev) +{ +struct acpi_device *adev =ACPI_COMPANION (&dev->dev); + +if (!adev ||pci_dev_id (dev) !=PCI_DEVID (0 ,PCI_DEVFN (6 ,0 ))) +return ; + +if (!dmi_check_system (msi_peg0_no_wakeup_dmi_table)) +return ; + +pci_info (dev,FW_BUG "Disabling ACPI wakeup to avoid touchpad GPIO (GPP_A20) takeover in D3cold\n" ); +device_wakeup_disable (&dev->dev); +device_set_wakeup_capable (&dev->dev, false); + adev->wakeup.flags.valid =0 ; +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x464d , quirk_msi_peg0_no_wakeup); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0xa74d , quirk_msi_peg0_no_wakeup);#endif /*
Signature · 1 line
2.55.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] PCI: unbalanced ACPI power dependent cleanup in quirk_msi_peg0_no_wakeup() --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] PCI: unbalanced ACPI power dependent cleanup in quirk_msi_peg0_no_wakeup() --
commit f7da2ed74b979227b2829513aae8ba6e3fc051b4
Author: Victor Carreras <[email protected]>
PCI: Disable ACPI wakeup on MSI MS-1592 and MS-1594 dGPU root port
This patch adds a PCI final fixup quirk for MSI MS-1592 and MS-1594 boards to disable ACPI wakeup on the dGPU PCIe root port (0000:00:06.0), preventing firmware from switching the touchpad's GPIO interrupt pin into ACPI GPE mode during D3cold transitions.
Quoted 9 lines
drivers/pci/quirks.c +1
-0@@ -3969,6 +3969,56 @@ static void quirk_apple_poweroff_thunderbolt(struct pci_dev *dev)DECLARE_PCI_FIXUP_SUSPEND_LATE (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C , quirk_apple_poweroff_thunderbolt); +
[ ... ]
Quoted 7 lines
drivers/pci/quirks.c +7
-0+static void quirk_msi_peg0_no_wakeup (struct pci_dev *dev) +{ +struct acpi_device *adev =ACPI_COMPANION (&dev->dev); + +if (!adev ||pci_dev_id (dev) !=PCI_DEVID (0 ,PCI_DEVFN (6 ,0 ))) +return ; +
drivers/pci/quirks.c static void quirk_apple_poweroff_thunderbolt(struct pci_dev *dev) · line 3993
Quoted 10 lines
drivers/pci/quirks.c +10
-0+if (!dmi_check_system (msi_peg0_no_wakeup_dmi_table)) +return ; + +pci_info (dev,FW_BUG "Disabling ACPI wakeup to avoid touchpad GPIO (GPP_A20) takeover in D3cold\n" ); +device_wakeup_disable (&dev->dev); +device_set_wakeup_capable (&dev->dev, false); + adev->wakeup.flags.valid =0 ; +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x464d , quirk_msi_peg0_no_wakeup); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0xa74d , quirk_msi_peg0_no_wakeup);
[Severity: High]
Does clearing adev->wakeup.flags.valid in a DECLARE_PCI_FIXUP_FINAL quirk without removing the ACPI power resource dependent leave a dangling pointer on resource->dependents if the PCI device is later removed?
During device enumeration, pci_device_add() -> device_add() -> acpi_device_notify() -> pci_acpi_setup() runs before pci_fixup_final quirks are applied:
drivers/pci/pci-acpi.c:pci_acpi_setup() {
...
if (!adev->wakeup.flags.valid)
return;
device_set_wakeup_capable(dev, true);
if (pci_dev->bridge_d3)
device_wakeup_enable(dev);
acpi_pci_wakeup(pci_dev, false);
acpi_device_power_add_dependent(adev, dev);
...
}Because adev->wakeup.flags.valid is still set when pci_acpi_setup() runs, acpi_device_power_add_dependent() links a struct acpi_power_dependent_device entry holding an unreferenced dep->dev = &dev->dev pointer onto the D0 power resource's dependents list (here, \_SB.PC00.PEG0.PXP).
When quirk_msi_peg0_no_wakeup() subsequently clears adev->wakeup.flags.valid, any later removal of the root port (for example via sysfs remove -> pci_stop_and_remove_bus_device() -> pci_destroy_dev() -> device_del() -> acpi_device_notify_remove() -> pci_acpi_cleanup()) will skip removing that dependent entry:
drivers/pci/pci-acpi.c:pci_acpi_cleanup() {
struct acpi_device *adev = ACPI_COMPANION(dev);
struct pci_dev *pci_dev = to_pci_dev(dev);
if (adev->wakeup.flags.valid) {
acpi_device_power_remove_dependent(adev, dev);
if (pci_dev->bridge_d3)
device_wakeup_disable(dev);
device_set_wakeup_capable(dev, false);
}
}Once struct pci_dev is freed, if the power resource is turned on again with another dependent present (such as during a PCI bus rescan), __acpi_power_on() iterates resource->dependents and passes the freed dep->dev pointer to dev_dbg() and pm_request_resume().
In addition, clearing adev->wakeup.flags.valid causes acpi_free_power_resources_lists() to skip freeing adev->wakeup.resources on ACPI device teardown, and causes pci_acpi_setup() on a subsequent bus rescan to return early before calling acpi_dev_power_up_children_with_adr(adev).
Since pci_acpi_setup() and pm_runtime_put() have already run by the time final quirks execute, and runtime/system suspend paths check device_can_wakeup(&dev->dev) (in pci_Full_Power_On / pci_target_state / pci_finish_runtime_suspend / pci_prepare_to_sleep) before invoking acpi_pci_wakeup(), is setting device_wakeup_disable(&dev->dev) and device_set_wakeup_capable(&dev->dev, false) sufficient on its own without clearing adev->wakeup.flags.valid, or should acpi_device_power_remove_dependent(adev, &dev->dev) be called if adev->wakeup.flags.valid is cleared?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 45 lines · Victor Carreras
+++
b/drivers/pci/quirks.cdrivers/pci/quirks.c +40
-0@@ -3941,6 +3941,56 @@ static void quirk_apple_poweroff_thunderbolt(struct pci_dev *dev)DECLARE_PCI_FIXUP_SUSPEND_LATE (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C , quirk_apple_poweroff_thunderbolt); + +/* +* On MSI Summit E16 Flip A12UCT (board MS-1592) and MSI Prestige 16 Studio +* A13VE / Summit E16 Flip A13VET (board MS-1594), the BIOS SSDT (MSI_NB / +* AdlP_Rvp) assigns the touchpad's GPIO interrupt pin (GPP_A20) as the PCIe +* wake GPIO (WAKG / P1WP) for the dGPU root port (\_SB.PC00.PEG0, 0000:00:06.0). +* +* When ACPI wakeup is armed on this root port via _DSW (setting WKEN = 1), +* subsequent D3cold transitions (\_SB.PC00.PEG0.PXP._OFF -> POFF) call +* \_SB.SHPO(WAKG, Zero), switching GPP_A20 ownership from GPIO driver mode +* to ACPI GPE mode and permanently freezing the I2C touchpad (ELAN0305:00). +* +* Disable ACPI wakeup on this root port so _DSW is not armed and WKEN +* remains zero during D3cold transitions. +*/ +static const struct dmi_system_id msi_peg0_no_wakeup_dmi_table[] = { + { + .ident ="MSI MS-1592" , + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Micro-Star International Co., Ltd." ), +DMI_MATCH (DMI_BOARD_NAME ,"MS-1592" ), + }, + }, + { + .ident ="MSI MS-1594" , + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Micro-Star International Co., Ltd." ), +DMI_MATCH (DMI_BOARD_NAME ,"MS-1594" ), + }, + }, + { } +}; + +static void quirk_msi_peg0_no_wakeup (struct pci_dev *dev) +{ +struct acpi_device *adev =ACPI_COMPANION (&dev->dev); + +if (!adev ||pci_dev_id (dev) !=PCI_DEVID (0 ,PCI_DEVFN (6 ,0 ))) +return ; +
drivers/pci/quirks.c static void quirk_apple_poweroff_thunderbolt(struct pci_dev *dev) · line 3993
Quoted 10 lines
drivers/pci/quirks.c +10
-0+if (!dmi_check_system (msi_peg0_no_wakeup_dmi_table)) +return ; + +pci_info (dev,FW_BUG "Disabling ACPI wakeup to avoid touchpad GPIO (GPP_A20) takeover in D3cold\n" ); +device_wakeup_disable (&dev->dev); +device_set_wakeup_capable (&dev->dev, false); + adev->wakeup.flags.valid =0 ; +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x464d , quirk_msi_peg0_no_wakeup); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0xa74d , quirk_msi_peg0_no_wakeup);
This is x86-specific but drivers/pci/quirks.c is used by all arches. It should rather live e.g. in drivers/acpi/x86/utils.c.
Thanks,
Lukas
Quoted 2 lines · Lukas Wunner
This is x86-specific but
drivers/pci/quirks.cis used by all arches. It should rather live e.g. indrivers/acpi/x86/utils.c.
Thanks for the review, Lukas. I have moved the quirk to drivers/acpi/x86/utils.c in v2 (and dropped clearing adev->wakeup.flags.valid so pci_acpi_setup()/pci_acpi_cleanup() power dependent tracking remains balanced).
Best regards,
Victor
PATCH v2 1/1 ACPI: x86: Disable wakeup on MSI MS-1592 and MS-1594 dGPU root port
In reply to Victor CarrerasOn MSI Summit E16 Flip A12UCT (motherboard MS-1592, BIOS E1592IMS.111) and MSI Prestige 16 Studio A13VE / Summit E16 Flip A13VET (motherboard MS-1594, BIOS E1594IMS.115), the I2C touchpad (ELAN0305:00, 04F3:31FD) permanently stops generating interrupts as soon as the discrete NVIDIA GPU (0000:01:00.0) and its parent PCIe Root Port (0000:00:06.0, \_SB.PC00.PEG0) enter D3cold.
In the platform's SSDT (MSI_NB / AdlP_Rvp), \_SB.PC00.PEG0 sets its wake GPIO (WAKG) from the BIOS NVS variable P1WP, which erroneously points to GPP_A20 (INTC1055:00 pin 62) -- the GPIO interrupt line wired to the touchpad.
During boot, \_SB.PC00.PEG0.PON() calls \_SB.SHPO(WAKG, One), setting PAD_CFG0_GPP_A20.GPIROUTSCI = 0 and HostSwOwn = 1 so the OS GPIO driver owns the pin. However, when the root port runtime-suspends to D3cold, Linux enables ACPI wakeup via \_SB.PC00.PEG0._DSW(1, 0, 3), which sets WKEN = 1. Subsequent evaluation of \_SB.PC00.PEG0.PXP._OFF -> POFF() executes:
If (CondRefOf (WAKG))
{
If (((WAKG != Zero) && WKEN))
{
\_SB.SHPO (WAKG, Zero)
}
}This switches GPP_A20 ownership to ACPI GPE mode (HostSwOwn = 0, GPIROUTSCI = 1), silencing the touchpad interrupt until the dGPU wakes back up to D0. Under Windows, _DSW is not armed for S0 D3cold on this root port, leaving WKEN = 0 so POFF() powers off the dGPU (\PIN.OFF(PWRG)) without touching GPP_A20.
Add a PCI quirk in drivers/acpi/x86/utils.c for boards MS-1592 and MS-1594 on root port 0000:00:06.0 (8086:464d on 12th Gen Alder Lake-P and 8086:a74d on 13th Gen Raptor Lake-P/H) to disable wakeup capability. This keeps WKEN = 0 so the root port and dGPU still reach D3cold normally while leaving GPP_A20 owned by the GPIO driver.
---
Changes in v2:
- Move the quirk from drivers/pci/quirks.c to drivers/acpi/x86/utils.c
as it is x86-specific (Lukas Wunner).
- Drop clearing adev->wakeup.flags.valid in the final fixup so ACPI
power resource dependent tracking between pci_acpi_setup() and pci_acpi_cleanup() remains balanced.
- Link to v1: https://lore.kernel.org/r/[email protected]
drivers/acpi/x86/utils.c | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
drivers/acpi/x86/utils.c +47 -0
@@ -665,3 +665,50 @@ void __init acpi_proc_quirk_mwait_check(void)*/ dmi_check_system (acpi_proc_quirk_mwait_dmi_table); } + +/* +* On MSI Summit E16 Flip A12UCT (board MS-1592) and MSI Prestige 16 Studio +* A13VE / Summit E16 Flip A13VET (board MS-1594), the BIOS SSDT (MSI_NB / +* AdlP_Rvp) assigns the touchpad's GPIO interrupt pin (GPP_A20) as the PCIe +* wake GPIO (WAKG / P1WP) for the dGPU root port (\_SB.PC00.PEG0, 0000:00:06.0). +* +* When ACPI wakeup is armed on this root port via _DSW (setting WKEN = 1), +* subsequent D3cold transitions (\_SB.PC00.PEG0.PXP._OFF -> POFF) call +* \_SB.SHPO(WAKG, Zero), switching GPP_A20 ownership from GPIO driver mode +* to ACPI GPE mode and permanently freezing the I2C touchpad (ELAN0305:00). +* +* Disable wakeup on this root port so _DSW is not armed and WKEN remains zero +* during D3cold transitions. +*/ +static const struct dmi_system_id msi_peg0_no_wakeup_dmi_table[] = { + { + .ident ="MSI MS-1592" , + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Micro-Star International Co., Ltd." ), +DMI_MATCH (DMI_BOARD_NAME ,"MS-1592" ), + }, + }, + { + .ident ="MSI MS-1594" , + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Micro-Star International Co., Ltd." ), +DMI_MATCH (DMI_BOARD_NAME ,"MS-1594" ), + }, + }, + {} +}; + +static void quirk_msi_peg0_no_wakeup (struct pci_dev *dev) +{ +if (pci_dev_id (dev) !=PCI_DEVID (0 ,PCI_DEVFN (6 ,0 ))) +return ; + +if (!dmi_check_system (msi_peg0_no_wakeup_dmi_table)) +return ; + +pci_info (dev,FW_BUG "Disabling ACPI wakeup to avoid touchpad GPIO (GPP_A20) takeover in D3cold\n" ); +device_wakeup_disable (&dev->dev); +device_set_wakeup_capable (&dev->dev, false); +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x464d , quirk_msi_peg0_no_wakeup); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0xa74d , quirk_msi_peg0_no_wakeup);
Signature · 1 line
2.55.0
[email protected]
AI reviewRe: [PATCH v2] ACPI: x86: Disable wakeup on MSI MS-1592 and MS-1594 dGPU root port
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] ACPI: x86: quirk_msi_peg0_no_wakeup() fails to block _DSW() in D3cold --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] ACPI: x86: quirk_msi_peg0_no_wakeup() fails to block _DSW() in D3cold --
commit 234606e6357f6c832bc95f0db9d5907bb7aeaec6
Author: Victor Carreras <[email protected]>
ACPI: x86: Disable wakeup on MSI MS-1592 and MS-1594 dGPU root port
This patch adds a final PCI fixup quirk for MSI MS-1592 and MS-1594 boards on root port 0000:00:06.0 to disable wakeup capability. This aims to prevent \_SB.PC00.PEG0._DSW from arming wakeup during D3cold transitions so that BIOS power-off methods do not switch the touchpad interrupt GPIO (GPP_A20) to ACPI GPE mode.
Quoted 5 lines
drivers/acpi/x86/utils.c +0
-0@@ -665,3 +665,50 @@ void __init acpi_proc_quirk_mwait_check(void)
[ ... ]
Quoted 4 lines
drivers/acpi/x86/utils.c +4
-0+static void quirk_msi_peg0_no_wakeup (struct pci_dev *dev) +{ +if (pci_dev_id (dev) !=PCI_DEVID (0 ,PCI_DEVFN (6 ,0 ))) +return ;
drivers/acpi/x86/utils.c void __init acpi_proc_quirk_mwait_check(void) · line 714
Quoted 10 lines
drivers/acpi/x86/utils.c +10
-0+ +if (!dmi_check_system (msi_peg0_no_wakeup_dmi_table)) +return ; + +pci_info (dev,FW_BUG "Disabling ACPI wakeup to avoid touchpad GPIO (GPP_A20) takeover in D3cold\n" ); +device_wakeup_disable (&dev->dev); +device_set_wakeup_capable (&dev->dev, false); +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x464d , quirk_msi_peg0_no_wakeup); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0xa74d , quirk_msi_peg0_no_wakeup);
[Severity: High]
Will clearing should_wakeup and can_wakeup in a final fixup without clearing adev->wakeup.flags.valid actually prevent \_SB.PC00.PEG0._DSW(1, 0, 3) from being evaluated when the dGPU and root port runtime-suspend to D3cold?
There appear to be two runtime-suspend paths that still evaluate _DSW on 0000:00:06.0:
1. Direct root port runtime suspend:
quirk_msi_peg0_no_wakeup() runs during pci_fixup_device(pci_fixup_final, dev) in drivers/pci/bus.c:pci_bus_add_device(), before device_initial_probe() and before pcie_portdrv_init() runs at device_initcall time.
When pcie_portdriver later binds to root port 0000:00:06.0 and probes the PME service, pcie_pme_probe() -> pcie_pme_mark_devices() -> pcie_pme_can_wakeup() in drivers/pci/pcie/pme.c sets can_wakeup back to true:
static int pcie_pme_can_wakeup(struct pci_dev *dev, void *ign)
{
device_set_wakeup_capable(&dev->dev, true);
return 0;
}When 0000:00:06.0 later runtime-suspends, drivers/pci/pci.c:pci_pm_runtime_suspend() -> pci_finish_runtime_suspend() executes:
__pci_enable_wake(dev, target_state, pci_dev_run_wake(dev));
Unlike pci_enable_wake() (which checks device_may_wakeup()), pci_dev_run_wake() checks dev->pme_support and device_can_wakeup(&dev->dev) while ignoring should_wakeup. __pci_enable_wake() then calls platform_pci_set_wakeup(dev, true) -> acpi_pci_wakeup(dev, true) in drivers/pci/pci-acpi.c:
int acpi_pci_wakeup(struct pci_dev *dev, bool enable)
{
if (acpi_pci_disabled)
return 0;
if (acpi_pm_device_can_wakeup(&dev->dev))
return acpi_pm_set_device_wakeup(&dev->dev, enable);
return acpi_pci_propagate_wakeup(dev->bus, enable);
}Because acpi_pm_device_can_wakeup() in drivers/acpi/device_pm.c only checks adev->wakeup.flags.valid (which is no longer cleared in v2), acpi_pm_set_device_wakeup() -> acpi_enable_wakeup_device_power() -> acpi_device_sleep_wake(adev, 1, 0, 3) will still evaluate \_SB.PC00.PEG0._DSW.
2. Wakeup propagation from child devices on subordinate bus 0000:01:
Even if dev->dev.power.can_wakeup stayed false on 0000:00:06.0, child devices on bus 0000:01 (such as the NVIDIA dGPU at 0000:01:00.0) have their own pme_support and power.can_wakeup = true. When a child device runtime-suspends, pci_finish_runtime_suspend() -> __pci_enable_wake() calls acpi_pci_wakeup(child, true) -> acpi_pci_propagate_wakeup(child->bus, true) in drivers/pci/pci-acpi.c:
static int acpi_pci_propagate_wakeup(struct pci_bus *bus, bool enable)
{
while (bus->parent) {
if (acpi_pm_device_can_wakeup(&bus->self->dev))
return acpi_pm_set_device_wakeup(&bus->self->dev, enable);
bus = bus->parent;
}acpi_pci_propagate_wakeup() walks up to bus->self (0000:00:06.0), checks only acpi_pm_device_can_wakeup(&bus->self->dev) (adev->wakeup.flags.valid), and calls acpi_pm_set_device_wakeup(&bus->self->dev, true), evaluating \_SB.PC00.PEG0._DSW(1, 0, 3).
Would clearing adev->wakeup.flags.valid in a DECLARE_PCI_FIXUP_EARLY or DECLARE_PCI_FIXUP_HEADER quirk (which runs after pci_set_acpi_fwnode() in pci_setup_device(), but before pci_acpi_setup() in pci_device_add() -> device_add()) avoid this issue while keeping pci_acpi_setup() and pci_acpi_cleanup() balanced?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Rafael J. Wysocki (Intel)
maintainerRe: [PATCH v2] ACPI: x86: Disable wakeup on MSI MS-1592 and MS-1594 dGPU root port
In reply to Victor CarrerasQuoted 40 lines · Victor Carreras
On MSI Summit E16 Flip A12UCT (motherboard MS-1592, BIOS E1592IMS.111) and MSI Prestige 16 Studio A13VE / Summit E16 Flip A13VET (motherboard MS-1594, BIOS E1594IMS.115), the I2C touchpad (ELAN0305:00, 04F3:31FD) permanently stops generating interrupts as soon as the discrete NVIDIA GPU (0000:01:00.0) and its parent PCIe Root Port (0000:00:06.0, \_SB.PC00.PEG0) enter D3cold.
In the platform's SSDT (
MSI_NB/AdlP_Rvp), \_SB.PC00.PEG0 sets its wake GPIO (WAKG) from the BIOS NVS variable P1WP, which erroneously points toGPP_A20(INTC1055:00 pin 62) -- the GPIO interrupt line wired to the touchpad.During boot, \_SB.PC00.PEG0.PON() calls \_SB.SHPO(WAKG, One), setting PAD_CFG0_GPP_A20.GPIROUTSCI = 0 and HostSwOwn = 1 so the OS GPIO driver owns the pin. However, when the root port runtime-suspends to D3cold, Linux enables ACPI wakeup via \_SB.PC00.PEG0._DSW(1, 0, 3), which sets WKEN = 1. Subsequent evaluation of \_SB.PC00.PEG0.PXP._OFF ->
POFF()executes:If (CondRefOf (WAKG)) { If (((WAKG != Zero) && WKEN)) { \_SB.SHPO (WAKG, Zero) } }This switches
GPP_A20ownership to ACPI GPE mode (HostSwOwn = 0, GPIROUTSCI = 1), silencing the touchpad interrupt until the dGPU wakes back up to D0. Under Windows,_DSWis not armed for S0 D3cold on this root port, leaving WKEN = 0 soPOFF()powers off the dGPU (\PIN.OFF(PWRG)) without touchingGPP_A20.Add a PCI quirk in
drivers/acpi/x86/utils.cfor boards MS-1592 and MS-1594 on root port 0000:00:06.0 (8086:464d on 12th Gen Alder Lake-P and 8086:a74d on 13th Gen Raptor Lake-P/H) to disable wakeup capability. This keeps WKEN = 0 so the root port and dGPU still reach D3cold normally while leavingGPP_A20owned by the GPIO driver.
Quoted 3 lines
Please see Sashiko's feedback on this one and let me know what you think about it:
https://sashiko.dev/#/patchset/20261024054711.21587-1-vicajilau%40gmail.com
Quoted 70 lines
---
Changes in v2:
- Move the quirk fromdrivers/pci/quirks.ctodrivers/acpi/x86/utils.c
as it is x86-specific (Lukas Wunner).
- Drop clearingadev->wakeup.flags.validin the final fixup so ACPI
power resource dependent tracking betweenpci_acpi_setup()andpci_acpi_cleanup()remains balanced.
- Link to v1: https://lore.kernel.org/r/[email protected]drivers/acpi/x86/utils.c | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)drivers/acpi/x86/utils.c +47
-1@@ -665,3 +665,50 @@ void __init acpi_proc_quirk_mwait_check(void)*/ dmi_check_system (acpi_proc_quirk_mwait_dmi_table); } + +/* +* On MSI Summit E16 Flip A12UCT (board MS-1592) and MSI Prestige 16 Studio +* A13VE / Summit E16 Flip A13VET (board MS-1594), the BIOS SSDT (MSI_NB / +* AdlP_Rvp) assigns the touchpad's GPIO interrupt pin (GPP_A20) as the PCIe +* wake GPIO (WAKG / P1WP) for the dGPU root port (\_SB.PC00.PEG0, 0000:00:06.0). +* +* When ACPI wakeup is armed on this root port via _DSW (setting WKEN = 1), +* subsequent D3cold transitions (\_SB.PC00.PEG0.PXP._OFF -> POFF) call +* \_SB.SHPO(WAKG, Zero), switching GPP_A20 ownership from GPIO driver mode +* to ACPI GPE mode and permanently freezing the I2C touchpad (ELAN0305:00). +* +* Disable wakeup on this root port so _DSW is not armed and WKEN remains zero +* during D3cold transitions. +*/ +static const struct dmi_system_id msi_peg0_no_wakeup_dmi_table[] = { + { + .ident ="MSI MS-1592" , + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Micro-Star International Co., Ltd." ), +DMI_MATCH (DMI_BOARD_NAME ,"MS-1592" ), + }, + }, + { + .ident ="MSI MS-1594" , + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Micro-Star International Co., Ltd." ), +DMI_MATCH (DMI_BOARD_NAME ,"MS-1594" ), + }, + }, + {} +}; + +static void quirk_msi_peg0_no_wakeup (struct pci_dev *dev) +{ +if (pci_dev_id (dev) !=PCI_DEVID (0 ,PCI_DEVFN (6 ,0 ))) +return ; + +if (!dmi_check_system (msi_peg0_no_wakeup_dmi_table)) +return ; + +pci_info (dev,FW_BUG "Disabling ACPI wakeup to avoid touchpad GPIO (GPP_A20) takeover in D3cold\n" ); +device_wakeup_disable (&dev->dev); +device_set_wakeup_capable (&dev->dev, false); +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x464d , quirk_msi_peg0_no_wakeup); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0xa74d , quirk_msi_peg0_no_wakeup); --2.55.0
Re: [PATCH v2] ACPI: x86: Disable wakeup on MSI MS-1592 and MS-1594 dGPU root port
Quoted 2 lines · Rafael J. Wysocki
Please see Sashiko's feedback on this one and let me know what you think about it:
Hi Rafael,
Sashiko is right, v2 does not work as intended. Clearing can_wakeup in a final fixup is undone by pcie_pme_can_wakeup() when the PME service binds, and in any case acpi_pci_wakeup() and acpi_pci_propagate_wakeup() only look at adev->wakeup.flags.valid, so _DSW on PEG0 still gets evaluated, both for the root port itself and when wakeup is propagated from the dGPU below it.
v3 follows the suggestion: it clears adev->wakeup.flags.valid from a DECLARE_PCI_FIXUP_EARLY quirk, which runs in pci_setup_device() after pci_set_acpi_fwnode() and before device_add() calls pci_acpi_setup(), so pci_acpi_setup() and pci_acpi_cleanup() stay balanced and both paths skip PEG0. With v3 and the SSDT workaround removed, the root port and the dGPU reach D3cold on my MS-1594 and the touchpad keeps working across repeated D3cold cycles. I'm sending it as a reply to this thread.
Thanks,
Victor
PATCH v3 1/1 ACPI: x86: Disable wakeup on MSI MS-1592 and MS-1594 dGPU root port
In reply to Victor CarrerasOn MSI Summit E16 Flip A12UCT (motherboard MS-1592, BIOS E1592IMS.111) and MSI Prestige 16 Studio A13VE / Summit E16 Flip A13VET (motherboard MS-1594, BIOS E1594IMS.115), the I2C touchpad (ELAN0305:00, 04F3:31FD) permanently stops generating interrupts as soon as the discrete NVIDIA GPU (0000:01:00.0) and its parent PCIe Root Port (0000:00:06.0, \_SB.PC00.PEG0) enter D3cold.
In the platform's SSDT (MSI_NB / AdlP_Rvp), \_SB.PC00.PEG0 sets its wake GPIO (WAKG) from the BIOS NVS variable P1WP, which erroneously points to GPP_A20 (INTC1055:00 pin 62) -- the GPIO interrupt line wired to the touchpad.
During boot, \_SB.PC00.PEG0.PON() calls \_SB.SHPO(WAKG, One), setting PAD_CFG0_GPP_A20.GPIROUTSCI = 0 and HostSwOwn = 1 so the OS GPIO driver owns the pin. However, when the root port runtime-suspends to D3cold, Linux enables ACPI wakeup via \_SB.PC00.PEG0._DSW(1, 0, 3), which sets WKEN = 1. Subsequent evaluation of \_SB.PC00.PEG0.PXP._OFF -> POFF() executes:
If (CondRefOf (WAKG))
{
If (((WAKG != Zero) && WKEN))
{
\_SB.SHPO (WAKG, Zero)
}
}This switches GPP_A20 ownership to ACPI GPE mode (HostSwOwn = 0, GPIROUTSCI = 1), silencing the touchpad interrupt until the dGPU wakes back up to D0. Under Windows, _DSW is not armed for S0 D3cold on this root port, leaving WKEN = 0 so POFF() powers off the dGPU (\PIN.OFF(PWRG)) without touching GPP_A20.
_DSW on the root port is reached through two paths: acpi_pci_wakeup() on the root port itself, and acpi_pci_propagate_wakeup() when the dGPU below it runtime-suspends. Both only check acpi_pm_device_can_wakeup(), i.e. adev->wakeup.flags.valid, so clearing the device's wakeup capability is not enough (the PCIe PME service sets it again anyway).
Add an early PCI fixup in drivers/acpi/x86/utils.c for boards MS-1592 and MS-1594 on root port 0000:00:06.0 (8086:464d on 12th Gen Alder Lake-P and 8086:a74d on 13th Gen Raptor Lake-P/H) that clears adev->wakeup.flags.valid on its ACPI companion. Early fixups run from pci_setup_device() after pci_set_acpi_fwnode() and before pci_device_add() calls device_add(), so pci_acpi_setup() never sees the port as ACPI wakeup capable and stays balanced with pci_acpi_cleanup(). The root port and dGPU still reach D3cold normally, while GPP_A20 stays owned by the GPIO driver.
---
Changes in v3:
- Clear adev->wakeup.flags.valid from a DECLARE_PCI_FIXUP_EARLY quirk instead of clearing the device wakeup flags in a final fixup. In v2, pcie_pme_mark_devices() set can_wakeup back to true, and acpi_pci_wakeup() / acpi_pci_propagate_wakeup() only check adev->wakeup.flags.valid, so _DSW was still evaluated (sashiko-bot). Running before pci_acpi_setup() keeps setup and cleanup balanced.
- Tested on MS-1594 without the SSDT override: PEG0 no longer shows up in /proc/acpi/wakeup, the root port and dGPU reach D3cold and the touchpad keeps generating interrupts across repeated D3cold cycles.
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Move the quirk from drivers/pci/quirks.c to drivers/acpi/x86/utils.c
as it is x86-specific (Lukas Wunner).
- Link to v1: https://lore.kernel.org/r/[email protected]
drivers/acpi/x86/utils.c | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+)
drivers/acpi/x86/utils.c +53 -0
@@ -665,3 +665,56 @@ void __init acpi_proc_quirk_mwait_check(void)*/ dmi_check_system (acpi_proc_quirk_mwait_dmi_table); } + +/* +* On MSI Summit E16 Flip A12UCT (board MS-1592) and MSI Prestige 16 Studio +* A13VE / Summit E16 Flip A13VET (board MS-1594), the BIOS SSDT (MSI_NB / +* AdlP_Rvp) assigns the touchpad's GPIO interrupt pin (GPP_A20) as the PCIe +* wake GPIO (WAKG / P1WP) for the dGPU root port (\_SB.PC00.PEG0, 0000:00:06.0). +* +* When ACPI wakeup is armed on this root port via _DSW (setting WKEN = 1), +* subsequent D3cold transitions (\_SB.PC00.PEG0.PXP._OFF -> POFF) call +* \_SB.SHPO(WAKG, Zero), switching GPP_A20 ownership from GPIO driver mode +* to ACPI GPE mode and freezing the I2C touchpad (ELAN0305:00). +* +* Mark the root port's ACPI wakeup as invalid so that _DSW is never evaluated +* for it, neither directly nor when wakeup is propagated from the dGPU below +* it. This has to happen before pci_acpi_setup() runs from device_add(), so +* that pci_acpi_setup() and pci_acpi_cleanup() see the same state. +*/ +static const struct dmi_system_id msi_peg0_no_wakeup_dmi_table[] = { + { + .ident ="MSI MS-1592" , + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Micro-Star International Co., Ltd." ), +DMI_MATCH (DMI_BOARD_NAME ,"MS-1592" ), + }, + }, + { + .ident ="MSI MS-1594" , + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Micro-Star International Co., Ltd." ), +DMI_MATCH (DMI_BOARD_NAME ,"MS-1594" ), + }, + }, + {} +}; + +static void quirk_msi_peg0_no_wakeup (struct pci_dev *dev) +{ +struct acpi_device *adev =ACPI_COMPANION (&dev->dev); + +if (!adev || !adev->wakeup.flags.valid) +return ; + +if (pci_dev_id (dev) !=PCI_DEVID (0 ,PCI_DEVFN (6 ,0 ))) +return ; + +if (!dmi_check_system (msi_peg0_no_wakeup_dmi_table)) +return ; + +pci_info (dev,FW_BUG "Disabling ACPI wakeup to avoid touchpad GPIO (GPP_A20) takeover in D3cold\n" ); + adev->wakeup.flags.valid =0 ; +} +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0x464d , quirk_msi_peg0_no_wakeup); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,0xa74d , quirk_msi_peg0_no_wakeup);
Signature · 1 line
2.55.0
[email protected]
AI reviewRe: [PATCH v3] ACPI: x86: Disable wakeup on MSI MS-1592 and MS-1594 dGPU root port
Sashiko has reviewed this patch and found no issues.
Quoted 18 lines
On MSI Summit E16 Flip A12UCT (motherboard MS-1592, BIOS E1592IMS.111) and MSI Prestige 16 Studio A13VE / Summit E16 Flip A13VET (motherboard MS-1594, BIOS E1594IMS.115), the I2C touchpad (ELAN0305:00, 04F3:31FD) permanently stops generating interrupts as soon as the discrete NVIDIA GPU (0000:01:00.0) and its parent PCIe Root Port (0000:00:06.0, \_SB.PC00.PEG0) enter D3cold.
In the platform's SSDT (
MSI_NB/AdlP_Rvp), \_SB.PC00.PEG0 sets its wake GPIO (WAKG) from the BIOS NVS variable P1WP, which erroneously points toGPP_A20(INTC1055:00 pin 62) -- the GPIO interrupt line wired to the touchpad.During boot, \_SB.PC00.PEG0.PON() calls \_SB.SHPO(WAKG, One), setting PAD_CFG0_GPP_A20.GPIROUTSCI = 0 and HostSwOwn = 1 so the OS GPIO driver owns the pin. However, when the root port runtime-suspends to D3cold, [ ... ]
owned by the GPIO driver.
Quoted 3 lines
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1