linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] PCI: qcom: Add support for system suspend and resume
@ 2023-01-03  7:49 Manivannan Sadhasivam
  2023-01-03  7:49 ` [PATCH 1/1] " Manivannan Sadhasivam
  0 siblings, 1 reply; 9+ messages in thread
From: Manivannan Sadhasivam @ 2023-01-03  7:49 UTC (permalink / raw)
  To: lpieralisi, robh
  Cc: andersson, konrad.dybcio, kw, bhelgaas, linux-pci, linux-arm-msm,
	linux-kernel, quic_krichai, johan+linaro, steev,
	Manivannan Sadhasivam

Hello,

This series (a single patch) adds the system suspend and resume support
to the Qualcomm PCIe RC controller.

Background
==========

There were previous attempts [1][2] to add system suspend and resume
support to this driver.

In previous versions, the controller was put into low power mode by turning
OFF the resources even if there were active PCIe devices connected. Thanks
to Qualcomm's internal power topology, the link did not enter L2/L3 state
and the devices were still powered ON. But during very late end of suspend
cycle, kernel tried to disable MSIs of the PCIe devices. This caused access
violations as the resources needed to access the PCIe devices config space
were turned OFF. Series [1] worked around this issue by not accessing the
PCIe config space if the link was down in dw_msi_{un}mask_irq() functions.
But that approach was not accepted.

Then, series [2] implemented the suspend and resume operations using the
syscore framework that disabled the resources at the end of the suspend
cycle. But that approach also did not get much acceptance.

Proposal
========

So the proposal here is to just vote for minimal interconnect bandwidth and
not turn OFF the resources if there are active PCIe devices connected to
the controllers. This avoids the access violation issue during suspend and
also saves some power due to the lower interconnect bandwidth used.

Then if there are no active PCIe devices connected to the controller,
the resources are turned OFF completely and brought back during resume.
This also saves power if there are controllers in a system without any
devices connected.

Testing
=======

This series has been tested on Lenovo Thinkpad X13s.

Dependency
==========

This series depends on the host_deinit() callback patch [3] submitted by
Johan.

Thanks,
Mani

[1] https://lore.kernel.org/linux-pci/1656055682-18817-1-git-send-email-quic_krichai@quicinc.com/
[2] https://lore.kernel.org/linux-pci/1663669347-29308-1-git-send-email-quic_krichai@quicinc.com/
[3] https://lore.kernel.org/linux-pci/20230102174313.GC16638@thinkpad/

Manivannan Sadhasivam (1):
  PCI: qcom: Add support for system suspend and resume

 drivers/pci/controller/dwc/pcie-qcom.c | 52 ++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

-- 
2.25.1


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

end of thread, other threads:[~2023-01-09 22:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-03  7:49 [PATCH 0/1] PCI: qcom: Add support for system suspend and resume Manivannan Sadhasivam
2023-01-03  7:49 ` [PATCH 1/1] " Manivannan Sadhasivam
2023-01-03 11:16   ` Dhruva Gole
2023-01-05 13:36     ` Manivannan Sadhasivam
2023-01-06 18:17       ` Matthias Kaehlcke
2023-01-06 19:02         ` Manivannan Sadhasivam
2023-01-09 22:41           ` Matthias Kaehlcke
2023-01-03 13:16   ` Johan Hovold
2023-01-05 13:33     ` Manivannan Sadhasivam

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).