Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kean Ren" <rh_king@163.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v2] PCI: Disable spurious s2idle wake from the NVMe root port on ThinkPad P1 Gen 9
Date: Mon, 16 Nov 2026 02:08:44 +0000	[thread overview]
Message-ID: <sashiko-outbox-216065@kernel.org> (raw)
In-Reply-To: <20261116014214.102524-1-rh_king@163.com>

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

  reply	other threads:[~2026-11-16  2:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-11-16  6:56   ` [PATCH v3] " Kean Ren
2026-11-16  7:06     ` sashiko-bot

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=sashiko-outbox-216065@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rh_king@163.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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