From: sashiko-bot@kernel.org
To: "Bjorn Helgaas" <helgaas@kernel.org>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v1] PCI: Wait for device readiness after D3hot -> D0uninitialized transition
Date: Thu, 14 May 2026 20:06:25 +0000 [thread overview]
Message-ID: <20260514200625.C6877C2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260514153124.404060-1-bhelgaas@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Ignored return value of `pci_dev_wait()` masks hardware readiness timeouts
--
commit 606c3a6294de4df52ee7dc27a7792cef6c8f72c4
Author: Bjorn Helgaas <helgaas@kernel.org>
PCI: Wait for device readiness after D3hot -> D0uninitialized transition
This commit adds a call to pci_dev_wait() after transitioning a device from
D3hot to D0uninitialized. This ensures the device is ready to accept config
accesses, especially for devices with No_Soft_Reset == 0.
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 8f7cfcc000901..9d0fc9fbb76a0 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
[ ... ]
> @@ -1341,10 +1351,14 @@ int pci_power_up(struct pci_dev *dev)
> pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, 0);
>
> /* Mandatory transition delays; see PCI PM 1.2. */
> - if (state == PCI_D3hot)
> + if (state == PCI_D3hot) {
> pci_dev_d3_sleep(dev);
> - else if (state == PCI_D2)
> + if (!(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET))
> + pci_dev_wait(dev, "power up D3hot->D0uninitialized",
> + PCIE_RESET_READY_POLL_MS);
Is it safe to ignore the return value of pci_dev_wait() here?
If the device times out or disconnects, pci_dev_wait() returns -ENOTTY. By
ignoring this error, pci_power_up() continues, unconditionally sets
dev->current_state = PCI_D0, and can return success (1 for need_restore).
If pci_power_up() returns success, will callers like pci_back_from_sleep()
execute pci_restore_state() against an unresponsive device, which could
potentially trigger PCIe Master Aborts, AER events, or system crashes?
Should pci_power_up() propagate the error from pci_dev_wait() to prevent
this?
> + } else if (state == PCI_D2) {
> udelay(PCI_PM_D2_DELAY);
> + }
>
> end:
> dev->current_state = PCI_D0;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260514153124.404060-1-bhelgaas@google.com?part=1
next prev parent reply other threads:[~2026-05-14 20:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 15:31 [PATCH v1] PCI: Wait for device readiness after D3hot -> D0uninitialized transition Bjorn Helgaas
2026-05-14 18:52 ` Mario Limonciello
2026-05-14 20:06 ` sashiko-bot [this message]
2026-05-14 21:38 ` Bjorn Helgaas
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=20260514200625.C6877C2BCB3@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--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