[PATCH v5 1/5] PCI: host-common: Add helper to determine host bridge D3cold eligibility
Bjorn Helgaas
helgaas at kernel.org
Wed May 20 13:27:55 PDT 2026
On Tue, May 19, 2026 at 05:39:01PM -0500, Bjorn Helgaas wrote:
> On Wed, Apr 29, 2026 at 12:12:23PM +0530, Krishna Chaitanya Chundru wrote:
> > Add a common helper, pci_host_common_d3cold_possible(), to determine
> > whether PCIe devices under host bridge can safely transition to D3cold.
> ...
> > +static int __pci_host_common_d3cold_possible(struct pci_dev *pdev, void *userdata)
> > +{
> > + u32 *flags = userdata;
> > + int type;
> > +
> > + /* Ignore conventional PCI devices */
> > + if (!pci_is_pcie(pdev))
> > + return 0;
> > +
> > + type = pci_pcie_type(pdev);
> > + if (type != PCI_EXP_TYPE_ENDPOINT &&
> > + type != PCI_EXP_TYPE_LEG_END &&
> > + type != PCI_EXP_TYPE_RC_END)
> > + return 0;
>
> From https://sashiko.dev/#/patchset/20260429-d3cold-v5-0-89e9735b9df6%40oss.qualcomm.com:
>
> If the topology contains an active conventional PCI device or an
> intermediate PCIe switch in PCI_D0, returning 0 here allows
> pci_walk_bus() to continue without clearing the
> PCI_HOST_D3COLD_ALLOWED flag.
>
> Does this create a situation where the host bridge might
> aggressively power off the link, dropping power to these active
> components?
>
> I guess this is intentional, since you have comment about ignoring
> conventional PCI devices. But this does seem like a potential
> problem. Why should we ignore switches here? And I think it's still
> fairly common to have a PCIe-to-PCI bridge leading to a conventional
> PCI device, and I don't know why we should ignore them.
>
> The commit log consistently refers to "PCIe" devices and endpoints, so
> maybe there's some reason that I'm missing.
>
> There are other sashiko comments on this series that I think should
> also be looked at.
This series is all in pci/next, so you and Mani can decide on whether
any sashiko comments need to be addressed.
Even if there's no code change, I think it'd be nice to have a brief
comment here about why conventional PCI and switches are ignored.
More information about the linux-arm-kernel
mailing list