* [PATCH] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
@ 2026-11-13 1:48 Kean Ren
2026-11-13 2:12 ` sashiko-bot
2026-11-16 1:42 ` [PATCH v2] " Kean Ren
0 siblings, 2 replies; 11+ messages in thread
From: Kean Ren @ 2026-11-13 1:48 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel
On Lenovo ThinkPad P1 Gen 9 (21UF, Panther Lake), firmware enables the
ACPI wake capability (_PRW) of PCIe root port 00:1c.4, which is the root
port of the primary NVMe SSD. When the NVMe controller is put into D3
during system suspend, a spurious PME is raised on that root port, which
sets ACPI GPE 0x6F (SCI). The SCI fires during the noirq suspend phase
and aborts s2idle before it reaches the low-power state: every suspend
is followed by a wake within ~2.5 seconds with practically zero s2idle
residency.
The downstream NVMe device is not a wake source (its own ACPI wake is
disabled), so the spurious event comes from the root port's wake/PME
path. Disable the root port's wake capability as well.
No firmware with a fix is available: the issue reproduces with BIOS
N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time of
writing. Match the model only; if a fixed BIOS is released later, this
quirk can be removed or restricted to the affected BIOS versions.
Verified on 21UFZE0PCN:
- gpe6F increments by one per suspend/resume on both BIOS versions;
- masking gpe6F, or disabling RP05 wake via /proc/acpi/wakeup, makes
s2idle stay asleep;
- with this quirk, /proc/acpi/wakeup reports RP05 as disabled and
gpe6F no longer increments across repeated suspends.
Signed-off-by: Kean Ren <rh_king@163.com>
---
drivers/pci/quirks.c | 52 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7f1f47ea2ee4..daccfbbec821 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -6595,3 +6595,55 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout);
#endif
+
+/*
+ * Lenovo ThinkPad P1 Gen 9 (21UF): the firmware enables the ACPI wake
+ * capability of PCIe root port 00:1c.4, which is the root port of the
+ * primary NVMe SSD. When the NVMe controller is put into D3 during
+ * system suspend, a spurious PME is raised on that root port, which in
+ * turn fires ACPI GPE 0x6F (SCI) and aborts s2idle before the system
+ * reaches the low-power state. The NVMe device itself is not a wake
+ * source (its own ACPI wake is disabled), so disable the root port's
+ * wake capability as well.
+ *
+ * No firmware with a fix is available: the issue reproduces with BIOS
+ * N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time
+ * of writing. Match the model only; if a fixed BIOS is released later,
+ * this quirk can be removed or restricted to the affected BIOS
+ * versions.
+ */
+static const struct dmi_system_id p1g9_rp05_wakeup_dmi[] __initconst = {
+ {
+ .ident = "Lenovo ThinkPad P1 Gen 9 (21UF)",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "21UFZE0PCN"),
+ },
+ },
+ { }
+};
+
+static int __init pci_fixup_p1g9_rp05_wakeup(void)
+{
+ struct pci_dev *rp;
+
+ if (!dmi_check_system(p1g9_rp05_wakeup_dmi))
+ return 0;
+
+ /* Root port of the primary NVMe SSD (05:00.0). */
+ rp = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0x1c, 4));
+ if (!rp)
+ return 0;
+
+ if (device_can_wakeup(&rp->dev)) {
+ device_set_wakeup_enable(&rp->dev, false);
+ pci_info(rp, "disabled spurious s2idle wake (BIOS %s)\n",
+ dmi_get_system_info(DMI_BIOS_VERSION));
+ } else {
+ pci_warn(rp, "wakeup not enabled, cannot disable spurious s2idle wake\n");
+ }
+ pci_dev_put(rp);
+
+ return 0;
+}
+late_initcall(pci_fixup_p1g9_rp05_wakeup);
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
2026-11-13 1:48 [PATCH] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9 Kean Ren
@ 2026-11-13 2:12 ` sashiko-bot
2026-11-16 1:42 ` [PATCH v2] " Kean Ren
1 sibling, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-13 2:12 UTC (permalink / raw)
To: Kean Ren; +Cc: linux-pci
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] PCI: p1g9_rp05_wakeup_dmi matches single SKU 21UFZE0PCN
instead of 21UF model
--
commit 75de6a519b5eeaae2e4b61c8891c8afd3aa3c727
Author: Kean Ren <rh_king@163.com>
PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
This commit adds a DMI-based PCI quirk to disable ACPI wakeup on PCIe root
port 00:1c.4 on the Lenovo ThinkPad P1 Gen 9 (21UF) to prevent spurious
PMEs from aborting s2idle suspend.
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index f7cd4149f8130..ead7a6c456986 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -6610,3 +6610,55 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout);
> #endif
> +
> +/*
> + * Lenovo ThinkPad P1 Gen 9 (21UF): the firmware enables the ACPI wake
> + * capability of PCIe root port 00:1c.4, which is the root port of the
> + * primary NVMe SSD. When the NVMe controller is put into D3 during
> + * system suspend, a spurious PME is raised on that root port, which in
> + * turn fires ACPI GPE 0x6F (SCI) and aborts s2idle before the system
> + * reaches the low-power state. The NVMe device itself is not a wake
> + * source (its own ACPI wake is disabled), so disable the root port's
> + * wake capability as well.
> + *
> + * No firmware with a fix is available: the issue reproduces with BIOS
> + * N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time
> + * of writing. Match the model only; if a fixed BIOS is released later,
> + * this quirk can be removed or restricted to the affected BIOS
> + * versions.
> + */
> +static const struct dmi_system_id p1g9_rp05_wakeup_dmi[] __initconst = {
> + {
> + .ident = "Lenovo ThinkPad P1 Gen 9 (21UF)",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "21UFZE0PCN"),
> + },
> + },
> + { }
> +};
[Severity: Medium]
Should p1g9_rp05_wakeup_dmi match "21UF" instead of "21UFZE0PCN"?
On Lenovo ThinkPads, DMI_PRODUCT_NAME holds the 10-character Machine Type
Model string, where the first four characters ("21UF") identify the model
and the remaining six ("ZE0PCN") identify a specific factory configuration
and regional SKU. Matching the full "21UFZE0PCN" string leaves the quirk
inactive on all other 21UF configurations running the same BIOS, so s2idle
suspend will still abort on those machines.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113014824.2396883-1-rh_king@163.com?part=1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
2026-11-13 1:48 [PATCH] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9 Kean Ren
2026-11-13 2:12 ` sashiko-bot
@ 2026-11-16 1:42 ` Kean Ren
2026-11-16 2:08 ` sashiko-bot
2026-11-16 6:56 ` [PATCH v3] " Kean Ren
1 sibling, 2 replies; 11+ messages in thread
From: Kean Ren @ 2026-11-16 1:42 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel
On Lenovo ThinkPad P1 Gen 9 (21UF, Panther Lake), firmware enables the
ACPI wake capability (_PRW) of PCIe root port 00:1c.4, which is the root
port of the primary NVMe SSD. When the NVMe controller is put into D3
during system suspend, a spurious PME is raised on that root port, which
sets ACPI GPE 0x6F (SCI). The SCI fires during the noirq suspend phase
and aborts s2idle before it reaches the low-power state: every suspend
is followed by a wake within ~2.5 seconds with practically zero s2idle
residency.
The downstream NVMe device is not a wake source (its own ACPI wake is
disabled), so the spurious event comes from the root port's wake/PME
path. Disable the root port's wake capability as well.
No firmware with a fix is available: the issue reproduces with BIOS
N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time of
writing. Match the 21UF model prefix; all 21UF SKUs share the same
platform and firmware, and the remaining MTM characters encode the
factory configuration and region. If a fixed BIOS is released later,
this quirk can be removed or restricted to the affected BIOS versions.
Verified on 21UFZE0PCN:
- gpe6F increments by one per suspend/resume on both BIOS versions;
- masking gpe6F, or disabling RP05 wake via /proc/acpi/wakeup, makes
s2idle stay asleep;
- with this quirk, /proc/acpi/wakeup reports RP05 as disabled and
gpe6F no longer increments across repeated suspends.
Signed-off-by: Kean Ren <rh_king@163.com>
---
Changes in v2:
- Match the 21UF model prefix instead of the full 21UFZE0PCN MTM so the
quirk also covers the other ThinkPad P1 Gen 9 factory configurations
that share the same platform and firmware.
drivers/pci/quirks.c | 54 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7f1f47ea2ee4..5bf55413a68f 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -6595,3 +6595,57 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout);
#endif
+
+/*
+ * Lenovo ThinkPad P1 Gen 9 (21UF): the firmware enables the ACPI wake
+ * capability of PCIe root port 00:1c.4, which is the root port of the
+ * primary NVMe SSD. When the NVMe controller is put into D3 during
+ * system suspend, a spurious PME is raised on that root port, which in
+ * turn fires ACPI GPE 0x6F (SCI) and aborts s2idle before the system
+ * reaches the low-power state. The NVMe device itself is not a wake
+ * source (its own ACPI wake is disabled), so disable the root port's
+ * wake capability as well.
+ *
+ * No firmware with a fix is available: the issue reproduces with BIOS
+ * N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time
+ * of writing. Match the 21UF model prefix (the remaining MTM
+ * characters encode the factory configuration and region); if a fixed
+ * BIOS is released later, this quirk can be removed or restricted to
+ * the affected BIOS versions.
+ */
+static const struct dmi_system_id p1g9_rp05_wakeup_dmi[] __initconst = {
+ {
+ .ident = "Lenovo ThinkPad P1 Gen 9 (21UF)",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ /* 21UF = ThinkPad P1 Gen 9 model; suffix is the SKU. */
+ DMI_MATCH(DMI_PRODUCT_NAME, "21UF"),
+ },
+ },
+ { }
+};
+
+static int __init pci_fixup_p1g9_rp05_wakeup(void)
+{
+ struct pci_dev *rp;
+
+ if (!dmi_check_system(p1g9_rp05_wakeup_dmi))
+ return 0;
+
+ /* Root port of the primary NVMe SSD (05:00.0). */
+ rp = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0x1c, 4));
+ if (!rp)
+ return 0;
+
+ if (device_can_wakeup(&rp->dev)) {
+ device_set_wakeup_enable(&rp->dev, false);
+ pci_info(rp, "disabled spurious s2idle wake (BIOS %s)\n",
+ dmi_get_system_info(DMI_BIOS_VERSION));
+ } else {
+ pci_warn(rp, "wakeup not enabled, cannot disable spurious s2idle wake\n");
+ }
+ pci_dev_put(rp);
+
+ return 0;
+}
+late_initcall(pci_fixup_p1g9_rp05_wakeup);
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
2026-11-16 1:42 ` [PATCH v2] " Kean Ren
@ 2026-11-16 2:08 ` sashiko-bot
2026-11-16 6:56 ` [PATCH v3] " Kean Ren
1 sibling, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-16 2:08 UTC (permalink / raw)
To: Kean Ren; +Cc: linux-pci
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] PCI: quirks: pci_fixup_p1g9_rp05_wakeup() checks
device_can_wakeup()
--
commit 214973074b1cd82e39015c9a8ebdc8afb6fbe7d3
Author: Kean Ren <rh_king@163.com>
PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
This commit adds a DMI quirk for Lenovo ThinkPad P1 Gen 9 (21UF) laptops
to disable wakeup on PCIe root port 00:1c.4 and prevent spurious PMEs
from aborting s2idle when the primary NVMe SSD enters D3.
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index f7cd4149f8130..d37d225f7f082 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -6610,3 +6610,57 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
[ ... ]
> +static int __init pci_fixup_p1g9_rp05_wakeup(void)
> +{
> + struct pci_dev *rp;
> +
> + if (!dmi_check_system(p1g9_rp05_wakeup_dmi))
> + return 0;
> +
> + /* Root port of the primary NVMe SSD (05:00.0). */
> + rp = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0x1c, 4));
> + if (!rp)
> + return 0;
> +
> + if (device_can_wakeup(&rp->dev)) {
> + device_set_wakeup_enable(&rp->dev, false);
> + pci_info(rp, "disabled spurious s2idle wake (BIOS %s)\n",
> + dmi_get_system_info(DMI_BIOS_VERSION));
> + } else {
> + pci_warn(rp, "wakeup not enabled, cannot disable spurious s2idle wake\n");
> + }
[Severity: Low]
Should this check device_may_wakeup(&rp->dev) instead of
device_can_wakeup(&rp->dev)?
pci_pm_init() and pcie_pme_probe() unconditionally set can_wakeup = true
on PCIe root ports advertising PME support, independent of whether ACPI
_PRW and pci_acpi_setup() enabled wakeup on the port. When wakeup is
not enabled (for example, on a future fixed BIOS that drops _PRW on
RP05), device_can_wakeup(&rp->dev) still returns true, so the quirk
falsely logs that spurious s2idle wake was disabled and the else warning
is never reached for disabled wakeup.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116014214.102524-1-rh_king@163.com?part=1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
2026-11-16 1:42 ` [PATCH v2] " Kean Ren
2026-11-16 2:08 ` sashiko-bot
@ 2026-11-16 6:56 ` Kean Ren
2026-11-16 7:06 ` sashiko-bot
2026-11-16 20:29 ` Bjorn Helgaas
1 sibling, 2 replies; 11+ messages in thread
From: Kean Ren @ 2026-11-16 6:56 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel
On Lenovo ThinkPad P1 Gen 9 (21UF, Panther Lake), firmware enables the
ACPI wake capability (_PRW) of PCIe root port 00:1c.4, which is the root
port of the primary NVMe SSD. When the NVMe controller is put into D3
during system suspend, a spurious PME is raised on that root port, which
sets ACPI GPE 0x6F (SCI). The SCI fires during the noirq suspend phase
and aborts s2idle before it reaches the low-power state: every suspend
is followed by a wake within ~2.5 seconds with practically zero s2idle
residency.
The downstream NVMe device is not a wake source (its own ACPI wake is
disabled), so the spurious event comes from the root port's wake/PME
path. Disable the root port's wake capability as well.
No firmware with a fix is available: the issue reproduces with BIOS
N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time of
writing. Match the 21UF model prefix; all 21UF SKUs share the same
platform and firmware, and the remaining MTM characters encode the
factory configuration and region. If a fixed BIOS is released later,
this quirk can be removed or restricted to the affected BIOS versions.
Verified on 21UFZE0PCN:
- gpe6F increments by one per suspend/resume on both BIOS versions;
- masking gpe6F, or disabling RP05 wake via /proc/acpi/wakeup, makes
s2idle stay asleep;
- with this quirk, /proc/acpi/wakeup reports RP05 as disabled and
gpe6F no longer increments across repeated suspends.
Signed-off-by: Kean Ren <rh_king@163.com>
---
Changes in v3:
- Check device_may_wakeup() instead of device_can_wakeup(): the latter is
set for all PME-capable devices, whether or not wakeup is enabled, so the
quirk could log a disable that did not actually happen. Drop the
corresponding warning; there is nothing to do if wakeup is not enabled.
Changes in v2:
- Match the 21UF model prefix instead of the full 21UFZE0PCN MTM so the
quirk also covers the other ThinkPad P1 Gen 9 factory configurations
that share the same platform and firmware.
drivers/pci/quirks.c | 56 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7f1f47ea2ee4..6ede2ea49b3a 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -6595,3 +6595,59 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout);
#endif
+
+/*
+ * Lenovo ThinkPad P1 Gen 9 (21UF): the firmware enables the ACPI wake
+ * capability of PCIe root port 00:1c.4, which is the root port of the
+ * primary NVMe SSD. When the NVMe controller is put into D3 during
+ * system suspend, a spurious PME is raised on that root port, which in
+ * turn fires ACPI GPE 0x6F (SCI) and aborts s2idle before the system
+ * reaches the low-power state. The NVMe device itself is not a wake
+ * source (its own ACPI wake is disabled), so disable the root port's
+ * wake capability as well.
+ *
+ * No firmware with a fix is available: the issue reproduces with BIOS
+ * N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time
+ * of writing. Match the 21UF model prefix (the remaining MTM
+ * characters encode the factory configuration and region); if a fixed
+ * BIOS is released later, this quirk can be removed or restricted to
+ * the affected BIOS versions.
+ */
+static const struct dmi_system_id p1g9_rp05_wakeup_dmi[] __initconst = {
+ {
+ .ident = "Lenovo ThinkPad P1 Gen 9 (21UF)",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ /* 21UF = ThinkPad P1 Gen 9 model; suffix is the SKU. */
+ DMI_MATCH(DMI_PRODUCT_NAME, "21UF"),
+ },
+ },
+ { }
+};
+
+static int __init pci_fixup_p1g9_rp05_wakeup(void)
+{
+ struct pci_dev *rp;
+
+ if (!dmi_check_system(p1g9_rp05_wakeup_dmi))
+ return 0;
+
+ /* Root port of the primary NVMe SSD (05:00.0). */
+ rp = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0x1c, 4));
+ if (!rp)
+ return 0;
+
+ /*
+ * Disable wakeup only if it is enabled: device_can_wakeup() is set
+ * for all PME-capable devices, even when wakeup is disabled.
+ */
+ if (device_may_wakeup(&rp->dev)) {
+ device_set_wakeup_enable(&rp->dev, false);
+ pci_info(rp, "disabled spurious s2idle wake (BIOS %s)\n",
+ dmi_get_system_info(DMI_BIOS_VERSION));
+ }
+ pci_dev_put(rp);
+
+ return 0;
+}
+late_initcall(pci_fixup_p1g9_rp05_wakeup);
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
2026-11-16 6:56 ` [PATCH v3] " Kean Ren
@ 2026-11-16 7:06 ` sashiko-bot
2026-11-16 20:29 ` Bjorn Helgaas
1 sibling, 0 replies; 11+ messages in thread
From: sashiko-bot @ 2026-11-16 7:06 UTC (permalink / raw)
To: Kean Ren; +Cc: linux-pci
> On Lenovo ThinkPad P1 Gen 9 (21UF, Panther Lake), firmware enables the
> ACPI wake capability (_PRW) of PCIe root port 00:1c.4, which is the root
> port of the primary NVMe SSD. When the NVMe controller is put into D3
> during system suspend, a spurious PME is raised on that root port, which
> sets ACPI GPE 0x6F (SCI). The SCI fires during the noirq suspend phase
> and aborts s2idle before it reaches the low-power state: every suspend
> is followed by a wake within ~2.5 seconds with practically zero s2idle
> residency.
>
> The downstream NVMe device is not a wake source (its own ACPI wake is
> disabled), so the spurious event comes from the root port's wake/PME
> path. Disable the root port's wake capability as well.
>
> No firmware with a fix is available: the issue reproduces with BIOS
> N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time of
> writing. Match the 21UF model prefix; all 21UF SKUs share the same
> platform and firmware, and the remaining MTM characters encode the
> factory configuration and region. If a fixed BIOS is released later,
> this quirk can be removed or restricted to the affected BIOS versions.
>
> Verified on 21UFZE0PCN:
> - gpe6F increments by one per suspend/resume on both BIOS versions;
> - masking gpe6F, or disabling RP05 wake via /proc/acpi/wakeup, makes
> s2idle stay asleep;
> - with this quirk, /proc/acpi/wakeup reports RP05 as disabled and
> gpe6F no longer increments across repeated suspends.
>
> Signed-off-by: Kean Ren <rh_king@163.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116065612.230481-1-rh_king@163.com?part=1
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
2026-11-16 6:56 ` [PATCH v3] " Kean Ren
@ 2026-11-16 20:29 ` Bjorn Helgaas
2026-11-16 20:29 ` Bjorn Helgaas
1 sibling, 0 replies; 11+ messages in thread
From: Bjorn Helgaas @ 2026-11-16 20:29 UTC (permalink / raw)
To: Kean Ren
Cc: Bjorn Helgaas, linux-pci, linux-kernel, Ryan Brue, Derek J. Clark,
Mark Pearson, Timur Tabi, John Hubbard, dri-devel, nouveau,
Lyude Paul
[+cc others from https://lore.kernel.org/linux-pci/20261110-broken-gpe-legion-v4-1-c672bb1c4d91@gmail.com/;
is this the same issue? That is for GPUs, not NVMe, but sounds similar]
On Mon, Nov 16, 2026 at 02:56:12PM +0800, Kean Ren wrote:
> On Lenovo ThinkPad P1 Gen 9 (21UF, Panther Lake), firmware enables the
> ACPI wake capability (_PRW) of PCIe root port 00:1c.4, which is the root
> port of the primary NVMe SSD. When the NVMe controller is put into D3
> during system suspend, a spurious PME is raised on that root port, which
> sets ACPI GPE 0x6F (SCI). The SCI fires during the noirq suspend phase
> and aborts s2idle before it reaches the low-power state: every suspend
> is followed by a wake within ~2.5 seconds with practically zero s2idle
> residency.
>
> The downstream NVMe device is not a wake source (its own ACPI wake is
> disabled), so the spurious event comes from the root port's wake/PME
> path. Disable the root port's wake capability as well.
>
> No firmware with a fix is available: the issue reproduces with BIOS
> N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time of
> writing. Match the 21UF model prefix; all 21UF SKUs share the same
> platform and firmware, and the remaining MTM characters encode the
> factory configuration and region. If a fixed BIOS is released later,
> this quirk can be removed or restricted to the affected BIOS versions.
>
> Verified on 21UFZE0PCN:
> - gpe6F increments by one per suspend/resume on both BIOS versions;
> - masking gpe6F, or disabling RP05 wake via /proc/acpi/wakeup, makes
> s2idle stay asleep;
> - with this quirk, /proc/acpi/wakeup reports RP05 as disabled and
> gpe6F no longer increments across repeated suspends.
>
> Signed-off-by: Kean Ren <rh_king@163.com>
> ---
> Changes in v3:
> - Check device_may_wakeup() instead of device_can_wakeup(): the latter is
> set for all PME-capable devices, whether or not wakeup is enabled, so the
> quirk could log a disable that did not actually happen. Drop the
> corresponding warning; there is nothing to do if wakeup is not enabled.
>
> Changes in v2:
> - Match the 21UF model prefix instead of the full 21UFZE0PCN MTM so the
> quirk also covers the other ThinkPad P1 Gen 9 factory configurations
> that share the same platform and firmware.
>
> drivers/pci/quirks.c | 56 ++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 56 insertions(+)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 7f1f47ea2ee4..6ede2ea49b3a 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -6595,3 +6595,59 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout);
> #endif
> +
> +/*
> + * Lenovo ThinkPad P1 Gen 9 (21UF): the firmware enables the ACPI wake
> + * capability of PCIe root port 00:1c.4, which is the root port of the
> + * primary NVMe SSD. When the NVMe controller is put into D3 during
> + * system suspend, a spurious PME is raised on that root port, which in
> + * turn fires ACPI GPE 0x6F (SCI) and aborts s2idle before the system
> + * reaches the low-power state. The NVMe device itself is not a wake
> + * source (its own ACPI wake is disabled), so disable the root port's
> + * wake capability as well.
> + *
> + * No firmware with a fix is available: the issue reproduces with BIOS
> + * N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time
> + * of writing. Match the 21UF model prefix (the remaining MTM
> + * characters encode the factory configuration and region); if a fixed
> + * BIOS is released later, this quirk can be removed or restricted to
> + * the affected BIOS versions.
> + */
> +static const struct dmi_system_id p1g9_rp05_wakeup_dmi[] __initconst = {
> + {
> + .ident = "Lenovo ThinkPad P1 Gen 9 (21UF)",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> + /* 21UF = ThinkPad P1 Gen 9 model; suffix is the SKU. */
> + DMI_MATCH(DMI_PRODUCT_NAME, "21UF"),
> + },
> + },
> + { }
> +};
> +
> +static int __init pci_fixup_p1g9_rp05_wakeup(void)
> +{
> + struct pci_dev *rp;
> +
> + if (!dmi_check_system(p1g9_rp05_wakeup_dmi))
> + return 0;
> +
> + /* Root port of the primary NVMe SSD (05:00.0). */
> + rp = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0x1c, 4));
> + if (!rp)
> + return 0;
> +
> + /*
> + * Disable wakeup only if it is enabled: device_can_wakeup() is set
> + * for all PME-capable devices, even when wakeup is disabled.
> + */
> + if (device_may_wakeup(&rp->dev)) {
> + device_set_wakeup_enable(&rp->dev, false);
> + pci_info(rp, "disabled spurious s2idle wake (BIOS %s)\n",
> + dmi_get_system_info(DMI_BIOS_VERSION));
> + }
> + pci_dev_put(rp);
> +
> + return 0;
> +}
> +late_initcall(pci_fixup_p1g9_rp05_wakeup);
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
@ 2026-11-16 20:29 ` Bjorn Helgaas
0 siblings, 0 replies; 11+ messages in thread
From: Bjorn Helgaas @ 2026-11-16 20:29 UTC (permalink / raw)
To: Kean Ren
Cc: Bjorn Helgaas, linux-pci, linux-kernel, Ryan Brue, Derek J. Clark,
Mark Pearson, dri-devel, nouveau
[+cc others from https://lore.kernel.org/linux-pci/20261110-broken-gpe-legion-v4-1-c672bb1c4d91@gmail.com/;
is this the same issue? That is for GPUs, not NVMe, but sounds similar]
On Mon, Nov 16, 2026 at 02:56:12PM +0800, Kean Ren wrote:
> On Lenovo ThinkPad P1 Gen 9 (21UF, Panther Lake), firmware enables the
> ACPI wake capability (_PRW) of PCIe root port 00:1c.4, which is the root
> port of the primary NVMe SSD. When the NVMe controller is put into D3
> during system suspend, a spurious PME is raised on that root port, which
> sets ACPI GPE 0x6F (SCI). The SCI fires during the noirq suspend phase
> and aborts s2idle before it reaches the low-power state: every suspend
> is followed by a wake within ~2.5 seconds with practically zero s2idle
> residency.
>
> The downstream NVMe device is not a wake source (its own ACPI wake is
> disabled), so the spurious event comes from the root port's wake/PME
> path. Disable the root port's wake capability as well.
>
> No firmware with a fix is available: the issue reproduces with BIOS
> N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time of
> writing. Match the 21UF model prefix; all 21UF SKUs share the same
> platform and firmware, and the remaining MTM characters encode the
> factory configuration and region. If a fixed BIOS is released later,
> this quirk can be removed or restricted to the affected BIOS versions.
>
> Verified on 21UFZE0PCN:
> - gpe6F increments by one per suspend/resume on both BIOS versions;
> - masking gpe6F, or disabling RP05 wake via /proc/acpi/wakeup, makes
> s2idle stay asleep;
> - with this quirk, /proc/acpi/wakeup reports RP05 as disabled and
> gpe6F no longer increments across repeated suspends.
>
> Signed-off-by: Kean Ren <rh_king@163.com>
> ---
> Changes in v3:
> - Check device_may_wakeup() instead of device_can_wakeup(): the latter is
> set for all PME-capable devices, whether or not wakeup is enabled, so the
> quirk could log a disable that did not actually happen. Drop the
> corresponding warning; there is nothing to do if wakeup is not enabled.
>
> Changes in v2:
> - Match the 21UF model prefix instead of the full 21UFZE0PCN MTM so the
> quirk also covers the other ThinkPad P1 Gen 9 factory configurations
> that share the same platform and firmware.
>
> drivers/pci/quirks.c | 56 ++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 56 insertions(+)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 7f1f47ea2ee4..6ede2ea49b3a 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -6595,3 +6595,59 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout);
> #endif
> +
> +/*
> + * Lenovo ThinkPad P1 Gen 9 (21UF): the firmware enables the ACPI wake
> + * capability of PCIe root port 00:1c.4, which is the root port of the
> + * primary NVMe SSD. When the NVMe controller is put into D3 during
> + * system suspend, a spurious PME is raised on that root port, which in
> + * turn fires ACPI GPE 0x6F (SCI) and aborts s2idle before the system
> + * reaches the low-power state. The NVMe device itself is not a wake
> + * source (its own ACPI wake is disabled), so disable the root port's
> + * wake capability as well.
> + *
> + * No firmware with a fix is available: the issue reproduces with BIOS
> + * N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time
> + * of writing. Match the 21UF model prefix (the remaining MTM
> + * characters encode the factory configuration and region); if a fixed
> + * BIOS is released later, this quirk can be removed or restricted to
> + * the affected BIOS versions.
> + */
> +static const struct dmi_system_id p1g9_rp05_wakeup_dmi[] __initconst = {
> + {
> + .ident = "Lenovo ThinkPad P1 Gen 9 (21UF)",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> + /* 21UF = ThinkPad P1 Gen 9 model; suffix is the SKU. */
> + DMI_MATCH(DMI_PRODUCT_NAME, "21UF"),
> + },
> + },
> + { }
> +};
> +
> +static int __init pci_fixup_p1g9_rp05_wakeup(void)
> +{
> + struct pci_dev *rp;
> +
> + if (!dmi_check_system(p1g9_rp05_wakeup_dmi))
> + return 0;
> +
> + /* Root port of the primary NVMe SSD (05:00.0). */
> + rp = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0x1c, 4));
> + if (!rp)
> + return 0;
> +
> + /*
> + * Disable wakeup only if it is enabled: device_can_wakeup() is set
> + * for all PME-capable devices, even when wakeup is disabled.
> + */
> + if (device_may_wakeup(&rp->dev)) {
> + device_set_wakeup_enable(&rp->dev, false);
> + pci_info(rp, "disabled spurious s2idle wake (BIOS %s)\n",
> + dmi_get_system_info(DMI_BIOS_VERSION));
> + }
> + pci_dev_put(rp);
> +
> + return 0;
> +}
> +late_initcall(pci_fixup_p1g9_rp05_wakeup);
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re:Re: [PATCH v3] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
2026-11-16 20:29 ` Bjorn Helgaas
@ 2026-11-17 6:01 ` 任海
-1 siblings, 0 replies; 11+ messages in thread
From: 任海 @ 2026-11-17 6:01 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Bjorn Helgaas, linux-pci, linux-kernel@vger.kernel.org, Ryan Brue,
derekjohn.clark@gmail.com, mpearson-lenovo@squebb.ca, Timur Tabi,
John Hubbard, dri-devel, nouveau, Lyude Paul
[-- Attachment #1: Type: text/plain, Size: 6540 bytes --]
Hi Bjorn,
Thanks for the pointer and for Cc'ing the relevant people.
I looked at the Legion patch. While both issues involve firmware firing a spurious GPE on a PCIe port, I believe they are distinct problems and should not be merged:
Different trigger context. The Legion quirk targets a runtime D3Cold wake loop: the GPU enters D3Cold, firmware fires a GPE on its parent port, the GPU wakes, and the cycle repeats. It is explicitly driver-independent (reproduces on nouveau/nova, possibly without any driver) . My P1 Gen 9 issue is a system s2idle abort: the NVMe controller enters D3 during suspend, a spurious PME sets GPE 0x6F during the noirq phase, and s2idle never reaches the low-power state .
Different target and scope. Legion matches NVIDIA GPU device IDs and acts on the GPU’s parent ACPI device . My quirk matches the 21UF DMI and disables wakeup on a specific root port (00:1c.4) associated with the primary NVMe SSD .
Different fix mechanism. Legion removes the parent ACPI device’s PM notifier so the spurious GPE no longer causes a wakeup . My quirk calls device_set_wakeup_enable(..., false) on the root port after checking device_may_wakeup() .
So while the underlying firmware misbehavior is similar in spirit, the affected hardware, power-management context, and workaround are different. I don’t think they can be combined.
And more important, I tested that patch not wroking for me.
Thanks,
Kean
At 2026-11-17 04:29:43, "Bjorn Helgaas" <helgaas@kernel.org> wrote:
>[+cc others from https://lore.kernel.org/linux-pci/20261110-broken-gpe-legion-v4-1-c672bb1c4d91@gmail.com/;
>is this the same issue? That is for GPUs, not NVMe, but sounds similar]
>
>On Mon, Nov 16, 2026 at 02:56:12PM +0800, Kean Ren wrote:
>> On Lenovo ThinkPad P1 Gen 9 (21UF, Panther Lake), firmware enables the
>> ACPI wake capability (_PRW) of PCIe root port 00:1c.4, which is the root
>> port of the primary NVMe SSD. When the NVMe controller is put into D3
>> during system suspend, a spurious PME is raised on that root port, which
>> sets ACPI GPE 0x6F (SCI). The SCI fires during the noirq suspend phase
>> and aborts s2idle before it reaches the low-power state: every suspend
>> is followed by a wake within ~2.5 seconds with practically zero s2idle
>> residency.
>>
>> The downstream NVMe device is not a wake source (its own ACPI wake is
>> disabled), so the spurious event comes from the root port's wake/PME
>> path. Disable the root port's wake capability as well.
>>
>> No firmware with a fix is available: the issue reproduces with BIOS
>> N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time of
>> writing. Match the 21UF model prefix; all 21UF SKUs share the same
>> platform and firmware, and the remaining MTM characters encode the
>> factory configuration and region. If a fixed BIOS is released later,
>> this quirk can be removed or restricted to the affected BIOS versions.
>>
>> Verified on 21UFZE0PCN:
>> - gpe6F increments by one per suspend/resume on both BIOS versions;
>> - masking gpe6F, or disabling RP05 wake via /proc/acpi/wakeup, makes
>> s2idle stay asleep;
>> - with this quirk, /proc/acpi/wakeup reports RP05 as disabled and
>> gpe6F no longer increments across repeated suspends.
>>
>> Signed-off-by: Kean Ren <rh_king@163.com>
>> ---
>> Changes in v3:
>> - Check device_may_wakeup() instead of device_can_wakeup(): the latter is
>> set for all PME-capable devices, whether or not wakeup is enabled, so the
>> quirk could log a disable that did not actually happen. Drop the
>> corresponding warning; there is nothing to do if wakeup is not enabled.
>>
>> Changes in v2:
>> - Match the 21UF model prefix instead of the full 21UFZE0PCN MTM so the
>> quirk also covers the other ThinkPad P1 Gen 9 factory configurations
>> that share the same platform and firmware.
>>
>> drivers/pci/quirks.c | 56 ++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 56 insertions(+)
>>
>> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
>> index 7f1f47ea2ee4..6ede2ea49b3a 100644
>> --- a/drivers/pci/quirks.c
>> +++ b/drivers/pci/quirks.c
>> @@ -6595,3 +6595,59 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
>> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout);
>> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout);
>> #endif
>> +
>> +/*
>> + * Lenovo ThinkPad P1 Gen 9 (21UF): the firmware enables the ACPI wake
>> + * capability of PCIe root port 00:1c.4, which is the root port of the
>> + * primary NVMe SSD. When the NVMe controller is put into D3 during
>> + * system suspend, a spurious PME is raised on that root port, which in
>> + * turn fires ACPI GPE 0x6F (SCI) and aborts s2idle before the system
>> + * reaches the low-power state. The NVMe device itself is not a wake
>> + * source (its own ACPI wake is disabled), so disable the root port's
>> + * wake capability as well.
>> + *
>> + * No firmware with a fix is available: the issue reproduces with BIOS
>> + * N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time
>> + * of writing. Match the 21UF model prefix (the remaining MTM
>> + * characters encode the factory configuration and region); if a fixed
>> + * BIOS is released later, this quirk can be removed or restricted to
>> + * the affected BIOS versions.
>> + */
>> +static const struct dmi_system_id p1g9_rp05_wakeup_dmi[] __initconst = {
>> + {
>> + .ident = "Lenovo ThinkPad P1 Gen 9 (21UF)",
>> + .matches = {
>> + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
>> + /* 21UF = ThinkPad P1 Gen 9 model; suffix is the SKU. */
>> + DMI_MATCH(DMI_PRODUCT_NAME, "21UF"),
>> + },
>> + },
>> + { }
>> +};
>> +
>> +static int __init pci_fixup_p1g9_rp05_wakeup(void)
>> +{
>> + struct pci_dev *rp;
>> +
>> + if (!dmi_check_system(p1g9_rp05_wakeup_dmi))
>> + return 0;
>> +
>> + /* Root port of the primary NVMe SSD (05:00.0). */
>> + rp = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0x1c, 4));
>> + if (!rp)
>> + return 0;
>> +
>> + /*
>> + * Disable wakeup only if it is enabled: device_can_wakeup() is set
>> + * for all PME-capable devices, even when wakeup is disabled.
>> + */
>> + if (device_may_wakeup(&rp->dev)) {
>> + device_set_wakeup_enable(&rp->dev, false);
>> + pci_info(rp, "disabled spurious s2idle wake (BIOS %s)\n",
>> + dmi_get_system_info(DMI_BIOS_VERSION));
>> + }
>> + pci_dev_put(rp);
>> +
>> + return 0;
>> +}
>> +late_initcall(pci_fixup_p1g9_rp05_wakeup);
>> --
>> 2.43.0
>>
[-- Attachment #2: Type: text/html, Size: 12868 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re:Re: [PATCH v3] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
@ 2026-11-17 6:01 ` 任海
0 siblings, 0 replies; 11+ messages in thread
From: 任海 @ 2026-11-17 6:01 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Bjorn Helgaas, linux-pci, linux-kernel@vger.kernel.org, Ryan Brue,
derekjohn.clark@gmail.com, mpearson-lenovo@squebb.ca, dri-devel,
nouveau
[-- Attachment #1: Type: text/plain, Size: 6540 bytes --]
Hi Bjorn,
Thanks for the pointer and for Cc'ing the relevant people.
I looked at the Legion patch. While both issues involve firmware firing a spurious GPE on a PCIe port, I believe they are distinct problems and should not be merged:
Different trigger context. The Legion quirk targets a runtime D3Cold wake loop: the GPU enters D3Cold, firmware fires a GPE on its parent port, the GPU wakes, and the cycle repeats. It is explicitly driver-independent (reproduces on nouveau/nova, possibly without any driver) . My P1 Gen 9 issue is a system s2idle abort: the NVMe controller enters D3 during suspend, a spurious PME sets GPE 0x6F during the noirq phase, and s2idle never reaches the low-power state .
Different target and scope. Legion matches NVIDIA GPU device IDs and acts on the GPU’s parent ACPI device . My quirk matches the 21UF DMI and disables wakeup on a specific root port (00:1c.4) associated with the primary NVMe SSD .
Different fix mechanism. Legion removes the parent ACPI device’s PM notifier so the spurious GPE no longer causes a wakeup . My quirk calls device_set_wakeup_enable(..., false) on the root port after checking device_may_wakeup() .
So while the underlying firmware misbehavior is similar in spirit, the affected hardware, power-management context, and workaround are different. I don’t think they can be combined.
And more important, I tested that patch not wroking for me.
Thanks,
Kean
At 2026-11-17 04:29:43, "Bjorn Helgaas" <helgaas@kernel.org> wrote:
>[+cc others from https://lore.kernel.org/linux-pci/20261110-broken-gpe-legion-v4-1-c672bb1c4d91@gmail.com/;
>is this the same issue? That is for GPUs, not NVMe, but sounds similar]
>
>On Mon, Nov 16, 2026 at 02:56:12PM +0800, Kean Ren wrote:
>> On Lenovo ThinkPad P1 Gen 9 (21UF, Panther Lake), firmware enables the
>> ACPI wake capability (_PRW) of PCIe root port 00:1c.4, which is the root
>> port of the primary NVMe SSD. When the NVMe controller is put into D3
>> during system suspend, a spurious PME is raised on that root port, which
>> sets ACPI GPE 0x6F (SCI). The SCI fires during the noirq suspend phase
>> and aborts s2idle before it reaches the low-power state: every suspend
>> is followed by a wake within ~2.5 seconds with practically zero s2idle
>> residency.
>>
>> The downstream NVMe device is not a wake source (its own ACPI wake is
>> disabled), so the spurious event comes from the root port's wake/PME
>> path. Disable the root port's wake capability as well.
>>
>> No firmware with a fix is available: the issue reproduces with BIOS
>> N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time of
>> writing. Match the 21UF model prefix; all 21UF SKUs share the same
>> platform and firmware, and the remaining MTM characters encode the
>> factory configuration and region. If a fixed BIOS is released later,
>> this quirk can be removed or restricted to the affected BIOS versions.
>>
>> Verified on 21UFZE0PCN:
>> - gpe6F increments by one per suspend/resume on both BIOS versions;
>> - masking gpe6F, or disabling RP05 wake via /proc/acpi/wakeup, makes
>> s2idle stay asleep;
>> - with this quirk, /proc/acpi/wakeup reports RP05 as disabled and
>> gpe6F no longer increments across repeated suspends.
>>
>> Signed-off-by: Kean Ren <rh_king@163.com>
>> ---
>> Changes in v3:
>> - Check device_may_wakeup() instead of device_can_wakeup(): the latter is
>> set for all PME-capable devices, whether or not wakeup is enabled, so the
>> quirk could log a disable that did not actually happen. Drop the
>> corresponding warning; there is nothing to do if wakeup is not enabled.
>>
>> Changes in v2:
>> - Match the 21UF model prefix instead of the full 21UFZE0PCN MTM so the
>> quirk also covers the other ThinkPad P1 Gen 9 factory configurations
>> that share the same platform and firmware.
>>
>> drivers/pci/quirks.c | 56 ++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 56 insertions(+)
>>
>> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
>> index 7f1f47ea2ee4..6ede2ea49b3a 100644
>> --- a/drivers/pci/quirks.c
>> +++ b/drivers/pci/quirks.c
>> @@ -6595,3 +6595,59 @@ static void pci_mask_replay_timer_timeout(struct pci_dev *pdev)
>> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout);
>> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout);
>> #endif
>> +
>> +/*
>> + * Lenovo ThinkPad P1 Gen 9 (21UF): the firmware enables the ACPI wake
>> + * capability of PCIe root port 00:1c.4, which is the root port of the
>> + * primary NVMe SSD. When the NVMe controller is put into D3 during
>> + * system suspend, a spurious PME is raised on that root port, which in
>> + * turn fires ACPI GPE 0x6F (SCI) and aborts s2idle before the system
>> + * reaches the low-power state. The NVMe device itself is not a wake
>> + * source (its own ACPI wake is disabled), so disable the root port's
>> + * wake capability as well.
>> + *
>> + * No firmware with a fix is available: the issue reproduces with BIOS
>> + * N4SET31W (1.10) and N4SET32W (1.11), the latest version at the time
>> + * of writing. Match the 21UF model prefix (the remaining MTM
>> + * characters encode the factory configuration and region); if a fixed
>> + * BIOS is released later, this quirk can be removed or restricted to
>> + * the affected BIOS versions.
>> + */
>> +static const struct dmi_system_id p1g9_rp05_wakeup_dmi[] __initconst = {
>> + {
>> + .ident = "Lenovo ThinkPad P1 Gen 9 (21UF)",
>> + .matches = {
>> + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
>> + /* 21UF = ThinkPad P1 Gen 9 model; suffix is the SKU. */
>> + DMI_MATCH(DMI_PRODUCT_NAME, "21UF"),
>> + },
>> + },
>> + { }
>> +};
>> +
>> +static int __init pci_fixup_p1g9_rp05_wakeup(void)
>> +{
>> + struct pci_dev *rp;
>> +
>> + if (!dmi_check_system(p1g9_rp05_wakeup_dmi))
>> + return 0;
>> +
>> + /* Root port of the primary NVMe SSD (05:00.0). */
>> + rp = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0x1c, 4));
>> + if (!rp)
>> + return 0;
>> +
>> + /*
>> + * Disable wakeup only if it is enabled: device_can_wakeup() is set
>> + * for all PME-capable devices, even when wakeup is disabled.
>> + */
>> + if (device_may_wakeup(&rp->dev)) {
>> + device_set_wakeup_enable(&rp->dev, false);
>> + pci_info(rp, "disabled spurious s2idle wake (BIOS %s)\n",
>> + dmi_get_system_info(DMI_BIOS_VERSION));
>> + }
>> + pci_dev_put(rp);
>> +
>> + return 0;
>> +}
>> +late_initcall(pci_fixup_p1g9_rp05_wakeup);
>> --
>> 2.43.0
>>
[-- Attachment #2: Type: text/html, Size: 12868 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
2026-11-16 20:29 ` Bjorn Helgaas
(?)
(?)
@ 2026-11-17 6:37 ` Kean Ren
-1 siblings, 0 replies; 11+ messages in thread
From: Kean Ren @ 2026-11-17 6:37 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linux-pci, linux-kernel, Ryan Brue, Derek J. Clark, Mark Pearson,
dri-devel, nouveau
Hi Bjorn,
Thanks — and thanks for Cc'ing the Legion folks.
I don't think it is the same bug, although the pattern is similar.
Both cases are firmware firing a GPE on the parent PCIe port of a device
that is entering a low-power state, and both workarounds target the parent
port's wake handling. The details differ:
- Legion: the trigger is the NVIDIA dGPU entering D3cold during runtime
suspend; the port (and then the GPU) is immediately woken again, in a
loop. The v4 patch removes the ACPI PM notifier from the parent port's
ACPI device, which turns the GPE handling into a no-op.
- ThinkPad P1 Gen 9 (21UF): the trigger is the primary NVMe SSD entering
D3 during system suspend (s2idle). Firmware leaves RP05's _PRW
enabled; the spurious PME sets GPE 0x6F, and the SCI arrives during the
noirq suspend phase and aborts s2idle after ~150 us. The quirk disables
wakeup on RP05 at late_initcall, so the port is not armed as a wake
source at suspend time. On this machine, masking GPE 0x6F or disabling
RP05 via /proc/acpi/wakeup keeps s2idle asleep; without the quirk every
suspend wakes after ~2.5 s.
So the two quirks are DMI/device specific and target different sleep paths
(runtime PM vs system s2idle). I think they should stay separate; I can add
a Link: to the Legion series in the changelog if you prefer a
cross-reference.
For the Legion folks: does acpi_remove_pm_notifier() also keep the port from
being armed as a wake source for system suspend, or does it only make the
runtime-PM GPE handling a no-op? In my case I don't think a notifier-only
change would have prevented the s2idle abort.
Thanks,
Kean
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-11-17 15:33 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13 1:48 [PATCH] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9 Kean Ren
2026-11-13 2:12 ` sashiko-bot
2026-11-16 1:42 ` [PATCH v2] " Kean Ren
2026-11-16 2:08 ` sashiko-bot
2026-11-16 6:56 ` [PATCH v3] " Kean Ren
2026-11-16 7:06 ` sashiko-bot
2026-11-16 20:29 ` Bjorn Helgaas
2026-11-16 20:29 ` Bjorn Helgaas
2026-11-17 6:01 ` 任海
2026-11-17 6:01 ` 任海
2026-11-17 6:37 ` Kean Ren
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.