linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] PCI: dwc: Replace Link up check with device presence in suspend path
@ 2025-11-06  6:13 Manivannan Sadhasivam
  2025-11-06  6:13 ` [PATCH 1/3] PCI: host-common: Add an API to check for any device under the Root Ports Manivannan Sadhasivam
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Manivannan Sadhasivam @ 2025-11-06  6:13 UTC (permalink / raw)
  To: lpieralisi, kwilczynski, mani, bhelgaas
  Cc: will, linux-pci, linux-kernel, robh, linux-arm-msm, zhangsenchuan,
	Manivannan Sadhasivam

Hi,

This series aims to fix the usage of dw_pcie_link_up() API to check for Link up
during system suspend. The motivation for this series comes from recent
discussions [1] [2], where developers wanted to skip PME_Turn_Off broadcast in
dw_pcie_suspend_noirq() API when devices are not attached to the bus. They ended
up using dw_pcie_link_up() to check for the device presence due to the bad
example in the pcie-qcom driver which does the same. The usage of
dw_pcie_link_up() API here would be racy as the link can go down at any time
after the check.

So to properly check for the device presence, this series introduces an API, 
pci_root_ports_have_device(), that accepts the Root bus pointer and checks for
the presence of a device under any of the Root Ports. This API is used to
replace the dw_pcie_link_up() check in suspend path of pcie-qcom driver and also
used to skip the PME_Turn_Off brodcast message in dwc_pcie_suspend_noirq() API.

Testing
=======

This series is tested on Qualcomm Lenovo Thinkpad T14s and observed no
functional change during the system suspend path.

- Mani

[1] https://lore.kernel.org/linux-pci/CAKfTPtCtHquxtK=Zx2WSNm15MmqeUXO8XXi8FkS4EpuP80PP7g@mail.gmail.com/
[2] https://lore.kernel.org/linux-pci/27516921.17f2.1997bb2a498.Coremail.zhangsenchuan@eswincomputing.com/

Manivannan Sadhasivam (3):
  PCI: host-common: Add an API to check for any device under the Root
    Ports
  PCI: qcom: Check for the presence of a device instead of Link up
    during suspend
  PCI: dwc: Skip PME_Turn_Off and L2/L3 transition if no device is
    available

 .../pci/controller/dwc/pcie-designware-host.c |  5 +++++
 drivers/pci/controller/dwc/pcie-qcom.c        |  6 ++++--
 drivers/pci/controller/pci-host-common.c      | 21 +++++++++++++++++++
 drivers/pci/controller/pci-host-common.h      |  2 ++
 4 files changed, 32 insertions(+), 2 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-11-10  9:13 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06  6:13 [PATCH 0/3] PCI: dwc: Replace Link up check with device presence in suspend path Manivannan Sadhasivam
2025-11-06  6:13 ` [PATCH 1/3] PCI: host-common: Add an API to check for any device under the Root Ports Manivannan Sadhasivam
2025-11-06  9:47   ` Konrad Dybcio
2025-11-06 11:52     ` Manivannan Sadhasivam
2025-11-07  0:12   ` kernel test robot
2025-11-06  6:13 ` [PATCH 2/3] PCI: qcom: Check for the presence of a device instead of Link up during suspend Manivannan Sadhasivam
2025-11-06 10:13   ` zhangsenchuan
2025-11-06 11:57     ` Manivannan Sadhasivam
2025-11-07  6:27       ` zhangsenchuan
2025-11-08 10:25         ` Manivannan Sadhasivam
2025-11-10  9:12           ` zhangsenchuan
2025-11-06  6:13 ` [PATCH 3/3] PCI: dwc: Skip PME_Turn_Off and L2/L3 transition if no device is available Manivannan Sadhasivam
2025-11-06 10:02   ` zhangsenchuan
2025-11-06 12:09     ` Manivannan Sadhasivam
2025-11-07  3:28   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).