From: Bjorn Helgaas <helgaas@kernel.org>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: manivannan.sadhasivam@oss.qualcomm.com,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Keith Busch" <kbusch@kernel.org>, "Jens Axboe" <axboe@kernel.dk>,
"Christoph Hellwig" <hch@lst.de>,
"Sagi Grimberg" <sagi@grimberg.me>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH 1/4] PCI: Introduce an API to check if RC/platform can retain device context during suspend
Date: Thu, 7 May 2026 18:02:48 -0500 [thread overview]
Message-ID: <20260507230248.GA51586@bhelgaas> (raw)
In-Reply-To: <xqwvjygt3bgttbipe6hhnpkfwauczxpoiyfbbakdyzesz6ydcd@en54522wjnar>
On Fri, Apr 17, 2026 at 04:41:09PM +0530, Manivannan Sadhasivam wrote:
> On Thu, Apr 16, 2026 at 02:18:55PM -0500, Bjorn Helgaas wrote:
> > On Tue, Apr 14, 2026 at 09:29:39PM +0530, Manivannan Sadhasivam via B4 Relay wrote:
> > > From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
> > >
> > > Currently, the PCI endpoint drivers like NVMe checks whether the device
> > > context will be retained or not during system suspend, with the help of
> > > pm_suspend_via_firmware() API.
> > >
> > > But it is possible that the device context might be lost due to some
> > > platform limitation as well. Having those checks in the endpoint drivers
> > > will not scale and will cause a lot of code duplication.
> ...
> > > + * pci_dev_suspend_retention_supported - Check if the platform can retain the device
> > > + * context during system suspend
> > > + * @pdev: PCI device to check
> > > + *
> > > + * Returns true if the platform can guarantee to retain the device context,
> > > + * false otherwise.
> > > + */
> > > +bool pci_dev_suspend_retention_supported(struct pci_dev *pdev)
> >
> > This doesn't seem like the right name. This isn't a property of the
> > *device*; that's all determined by the PCI spec (devices must retain
> > all internal state in D0, D1, and D2, they retain it in D3hot if
> > No_Soft_Reset, and they never do in D3cold).
> >
> > So this seems like something to do with the *platform* behavior. It
> > sounds like this is basically a way to learn whether the device might
> > be put in D3cold on system suspend.
>
> That's correct. But I wanted to keep it device specific, since apart
> from pm_suspend_via_firmware() there could be other issues causing
> context to be lost. Like the issue with RC, brought up in the
> successive patches. There could be chances that only one hierarchy
> might be affected. So making it device specific would give us the
> granularity.
OK, a device-specific API is fine.
Maybe it could be something like "pci_suspend_preserves_context()"?
Is it the case that suspend never uses D3cold? If suspend ever uses
D3cold, *every* device put in D3cold will lose its context.
How would this work if suspend can use D3cold? Can a driver (or this
API) learn whether D3cold might be used?
next prev parent reply other threads:[~2026-05-07 23:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 15:59 [PATCH 0/4] PCI: Introduce pci_dev_suspend_retention_supported() API Manivannan Sadhasivam via B4 Relay
2026-04-14 15:59 ` [PATCH 1/4] PCI: Introduce an API to check if RC/platform can retain device context during suspend Manivannan Sadhasivam via B4 Relay
2026-04-16 19:18 ` Bjorn Helgaas
2026-04-17 11:11 ` Manivannan Sadhasivam
2026-05-07 23:02 ` Bjorn Helgaas [this message]
2026-04-14 15:59 ` [PATCH 2/4] PCI: Indicate context lost if L1ss exit is broken during resume from system suspend Manivannan Sadhasivam via B4 Relay
2026-04-14 15:59 ` [PATCH 3/4] PCI: qcom: Indicate broken L1ss exit " Manivannan Sadhasivam via B4 Relay
2026-04-16 19:20 ` Bjorn Helgaas
2026-04-17 12:06 ` Manivannan Sadhasivam
2026-04-17 22:26 ` Bjorn Helgaas
2026-04-18 5:39 ` Manivannan Sadhasivam
2026-04-20 20:49 ` Bjorn Helgaas
2026-04-21 17:11 ` Manivannan Sadhasivam
2026-04-22 23:49 ` Bjorn Helgaas
2026-04-23 15:15 ` Manivannan Sadhasivam
2026-04-14 15:59 ` [PATCH 4/4] nvme-pci: Use pci_dev_suspend_retention_supported() API during suspend Manivannan Sadhasivam via B4 Relay
2026-04-22 6:33 ` Christoph Hellwig
2026-04-16 19:11 ` [PATCH 0/4] PCI: Introduce pci_dev_suspend_retention_supported() API Bjorn Helgaas
2026-04-17 11:04 ` Manivannan Sadhasivam
2026-04-17 22:29 ` Bjorn Helgaas
2026-04-18 5:16 ` Manivannan Sadhasivam
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=20260507230248.GA51586@bhelgaas \
--to=helgaas@kernel.org \
--cc=axboe@kernel.dk \
--cc=bhelgaas@google.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=manivannan.sadhasivam@oss.qualcomm.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=sagi@grimberg.me \
/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