From: sashiko-bot@kernel.org
To: "Jose Ignacio Tornos Martinez" <jtornosm@redhat.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v4 1/3] PCI: Add d3cold as general reset method
Date: Mon, 18 May 2026 13:27:41 +0000 [thread overview]
Message-ID: <20260518132742.107D1C2BCB7@smtp.kernel.org> (raw)
In-Reply-To: <20260518124836.460805-2-jtornosm@redhat.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Critical] Missing IOMMU preparation and completion calls in the `pci_d3cold_reset` flow.
- [High] Missing wait for device readiness (CRS polling) after transitioning from D3cold back to D0.
- [High] Bypassing device quirks and user constraints (`dev->no_d3cold` and `dev->d3cold_allowed`) for D3cold transitions.
--
commit 6ccb7429bcb1b8c8a16f329c1b8caf009c316653
Author: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Subject: PCI: Add d3cold as general reset method
This commit adds a new PCI reset method using D3cold power cycling for
single-function devices. It utilizes ACPI _PR3 power resources to physically
cut power to the device.
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 8f7cfcc000901..839903b596982 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
[ ... ]
> +static int pci_d3cold_reset(struct pci_dev *dev, bool probe)
> +{
> + int ret;
> +
> + if (dev->multifunction)
> + return -ENOTTY;
> +
> + if (!pci_pr3_present(dev))
> + return -ENOTTY;
> +
> + if (probe)
> + return 0;
Could this transition devices into D3cold even if they have the state
explicitly disabled via quirks or user constraints?
Should this check dev->no_d3cold and dev->d3cold_allowed before proceeding
with the transition?
> +
> + if (dev->current_state != PCI_D0)
> + return -EINVAL;
> +
> + ret = pci_set_power_state(dev, PCI_D3cold);
Does this reset method need to pause IOMMU fault handling and wait for
pending DMA transactions before dropping physical power?
Other reset methods like pci_pm_reset() call pci_dev_reset_iommu_prepare()
before performing the hardware reset. Is similar synchronization required
here to prevent IOMMU faults?
> + if (ret)
> + return ret;
> +
> + return pci_set_power_state(dev, PCI_D0);
> +}
Does the device require time to reinitialize its link and internal state
after returning to PCI_D0?
The generic reset handler will immediately invoke pci_dev_restore() after
this returns. Should this function call pci_dev_wait() to check for
Configuration Request Retry Status (CRS) clearance, similar to how
pci_pm_reset() waits?
Also, if pci_dev_reset_iommu_prepare() is needed earlier in this function,
should pci_dev_reset_iommu_done() be called here before returning?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260518124836.460805-1-jtornosm@redhat.com?part=1
next prev parent reply other threads:[~2026-05-18 13:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 12:48 [PATCH v4 0/3] PCI: Add d3cold/soft reset methods for devices with limited reset capability Jose Ignacio Tornos Martinez
2026-05-18 12:48 ` [PATCH v4 1/3] PCI: Add d3cold as general reset method Jose Ignacio Tornos Martinez
2026-05-18 13:27 ` sashiko-bot [this message]
2026-05-18 12:48 ` [PATCH v4 2/3] PCI: Add soft reset method as last resort Jose Ignacio Tornos Martinez
2026-05-18 13:48 ` sashiko-bot
2026-05-18 17:15 ` Alex Williamson
2026-05-19 5:35 ` Jose Ignacio Tornos Martinez
2026-05-20 16:13 ` Alex Williamson
2026-05-21 6:32 ` Jose Ignacio Tornos Martinez
2026-05-18 12:48 ` [PATCH v4 3/3] PCI: Disable broken bus reset on Qualcomm devices Jose Ignacio Tornos Martinez
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=20260518132742.107D1C2BCB7@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=jtornosm@redhat.com \
--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