From: Lukas Wunner <lukas@wunner.de>
To: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Cc: bhelgaas@google.com, alex@shazbot.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] PCI: Add D3cold as general reset method
Date: Wed, 13 May 2026 16:39:24 +0200 [thread overview]
Message-ID: <agSNHLc_Sc_G-7vz@wunner.de> (raw)
In-Reply-To: <20260513122349.268753-1-jtornosm@redhat.com>
On Wed, May 13, 2026 at 02:23:48PM +0200, Jose Ignacio Tornos Martinez wrote:
> Add D3cold power cycle as a general PCI reset method, available for
> single-function devices. This provides a more robust reset mechanism
> than D3hot for devices where a full power cycle is beneficial.
>
> The implementation uses pci_set_power_state(dev, PCI_D3cold), which
> automatically handles platform differences:
> - Platforms WITH _PR3 ACPI power resources: true D3cold (power cycle)
> - Platforms WITHOUT _PR3: automatic fallback to D3hot transition
Why fall back to D3hot, even though the name of the reset method
suggests it uses D3cold? If D3cold isn't supported, I'd just not
expose the new reset method.
> Reset hierarchy with this change:
> 1. device_specific
> 2. acpi
> 3. flr
> 4. af_flr
> 5. pm (D3hot via config space)
> 6. bus (SBR)
> 7. cxl_bus
> 8. d3cold (NEW - power cycle with D3hot fallback)
I'd call it "powercycle" for clarity but that's just my preferred
bikeshed color.
> +static int pci_d3cold_reset(struct pci_dev *dev, bool probe)
> +{
> + int ret;
> +
> + if (dev->multifunction)
> + return -ENOTTY;
> +
> + if (probe) {
> + if (!pci_pr3_present(dev))
> + pci_dbg(dev, "d3cold reset: no _PR3 support, will use D3hot fallback\n");
> + return 0;
> + }
So I'd just return -ENOTTY here in the !pci_pr3_present() case
and I'd do that for probe == 0 as well.
Thanks,
Lukas
prev parent reply other threads:[~2026-05-13 14:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 12:23 [PATCH v3 1/2] PCI: Add D3cold as general reset method Jose Ignacio Tornos Martinez
2026-05-13 12:23 ` [PATCH v3 2/2] PCI: Disable broken bus reset on Qualcomm devices Jose Ignacio Tornos Martinez
2026-05-13 13:31 ` [PATCH v3 1/2] PCI: Add D3cold as general reset method Alex Williamson
2026-05-13 14:39 ` Lukas Wunner [this message]
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=agSNHLc_Sc_G-7vz@wunner.de \
--to=lukas@wunner.de \
--cc=alex@shazbot.org \
--cc=bhelgaas@google.com \
--cc=jtornosm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/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