]> git.ipfire.org Git - thirdparty/linux.git/commit
PCI: dwc: Use common D3cold eligibility helper in suspend path
authorKrishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Wed, 29 Apr 2026 06:42:26 +0000 (12:12 +0530)
committerManivannan Sadhasivam <mani@kernel.org>
Thu, 21 May 2026 15:02:57 +0000 (20:32 +0530)
commit56378c03c1a80aeeab45f39b303cc92a3bb7716e
treeafb992b740038c3921748bb7a5ca35d7a68061cb
parent8a847d3e9e5f1700beb5a0196e682f71837dfe5c
PCI: dwc: Use common D3cold eligibility helper in suspend path

Previously, the driver skipped putting the link into L2 and device state in
D3cold whenever L1 ASPM was enabled, since some devices (e.g. NVMe) expect
low resume latency and may not tolerate deeper power states. However, such
devices typically remain in D0 and are already covered by the new helper's
requirement that all endpoints be in D3hot before the devices under host
bridge may enter D3cold.

Replace the local L1/L1SS-based check in dw_pcie_suspend_noirq() with the
shared pci_host_common_d3cold_possible() helper to decide whether the
devices under host bridge can safely transition to D3cold.

In addition, propagate PME-from-D3cold capability information from the
helper and record it in skip_pwrctrl_off. Some devices (e.g. M.2 cards
without auxiliary power) cannot send PME when the main power is removed,
even if they advertise PME-from-D3cold support. This allows controller
power-off to be skipped when required to preserve wakeup functionality.

While at it, update the 'dw_pcie::suspended' flag in dw_pcie_resume_noirq()
only after the PCIe link resumes successfully, to avoid marking the
controller as active when link resume fails.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
[mani: commit log and added TODO to query Vaux]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260429-d3cold-v5-4-89e9735b9df6@oss.qualcomm.com
drivers/pci/controller/dwc/pcie-designware-host.c
drivers/pci/controller/dwc/pcie-designware.h