linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] PCI: Notify PCI drivers about powerdown during suspend
@ 2022-05-18 13:19 Manivannan Sadhasivam
  2022-05-18 13:19 ` [PATCH v2 1/3] PCI: Add a flag to notify " Manivannan Sadhasivam
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Manivannan Sadhasivam @ 2022-05-18 13:19 UTC (permalink / raw)
  To: bhelgaas, lorenzo.pieralisi, kbusch, hch
  Cc: linux-nvme, linux-pci, linux-arm-msm, linux-kernel, svarbanov,
	bjorn.andersson, axboe, quic_vbadigan, quic_krichai,
	quic_nitirawa, vidyas, sagi, linux-pm, rafael,
	Manivannan Sadhasivam

Hi,

This series adds support for notifying the PCI drivers like NVMe about the
transition of PCI devices into powerdown mode during system suspend.

Background
----------

On Qcom SC7280 based Chrome platforms, the RPMh will turn off the power to all
PCIe devices during system suspend for aggressive powersaving. Currently, there
is no way for the PCI device drivers to learn about this situation. Some of the
drivers assume that the power will be retained and some others assume that the
power may be taken down.

We faced the issue with NVMe PCI driver, where the driver expects the NVMe
device to be in APST (Autonomous Power State Transition) state for power saving
during system suspend. So when the power goes down, the NVMe driver fails to
bringup the device during resume.

Previous work
-------------

We tried to fix this issue in a couple of ways:

1. The NVMe PCI driver checks for the existence of "StorageD3Enable" ACPI
property in the suspend path. If the property is found, the driver assumes that
the device may go to poweroff state and shutdowns the device accordingly.

As like the ACPI based systems, we also tried to get the support in place for
DT based systems. But that didn't get accepted:
https://lore.kernel.org/all/Yl+6V3pWuyRYuVV8@infradead.org/T/

2. Keith Busch proposed a module params based approach. The parameter when set,
will allow the driver to support APST during suspend. Absence of that parameter
will let the driver shutdown the device.

This also did not get accepted:
https://lore.kernel.org/linux-nvme/20220201165006.3074615-1-kbusch@kernel.org/

Proposal
--------

Christoph suggested to add a notification in the PCI/PM core to let the NVMe
driver know that the device will go into powerdown state during suspend.
https://lore.kernel.org/all/Yg0wklcJ3ed76Jbk@infradead.org/

Hence in this series, a "suspend_poweroff" flag is introduced in the host bridge
struct. When this flag is set by the PCI RC drivers, the PCI device driver like
NVMe can shutdown the device during suspend.

In the coming days, the usage of this flag could be extended to other PCI
drivers as well.

In this series, the system suspend/resume support is also added to the Qcom
PCIe RC driver for SC7280. During the suspend time, the RC driver will put the
device into D3cold and recover it during resume. So even though RPMh is cutting
off the power to PCIe domain, it is necessary to put the device in D3cold by
the PCIe RC driver for proper working.

Testing
-------

This series has been tested on SC7280 IDP board connected to a NVMe PCI device.

Thanks,
Mani

Manivannan Sadhasivam (2):
  PCI: Add a flag to notify PCI drivers about powerdown during suspend
  nvme-pci: Make use of "suspend_poweroff" flag during system suspend

Prasad Malisetty (1):
  PCI: qcom: Add system PM support

 drivers/nvme/host/pci.c                |   3 +-
 drivers/pci/controller/dwc/pcie-qcom.c | 108 +++++++++++++++++++++++++
 include/linux/pci.h                    |   2 +
 3 files changed, 112 insertions(+), 1 deletion(-)

-- 
2.25.1


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

end of thread, other threads:[~2022-05-18 13:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-18 13:19 [PATCH v2 0/3] PCI: Notify PCI drivers about powerdown during suspend Manivannan Sadhasivam
2022-05-18 13:19 ` [PATCH v2 1/3] PCI: Add a flag to notify " Manivannan Sadhasivam
2022-05-18 13:19 ` [PATCH v2 2/3] nvme-pci: Make use of "suspend_poweroff" flag during system suspend Manivannan Sadhasivam
2022-05-18 13:19 ` [PATCH v2 3/3] PCI: qcom: Add system PM support Manivannan Sadhasivam
2022-05-18 13:23   ` Christoph Hellwig
2022-05-18 13:27     ` Manivannan Sadhasivam
2022-05-18 13:27 ` [PATCH v2 0/3] PCI: Notify PCI drivers about powerdown during suspend Rafael J. Wysocki

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