Skip to content

Commit 2eb8abb

Browse files
krishnachaitanya-linuxZiyue Zhang
authored andcommitted
FROMLIST: PCI: qcom: Add D3cold support
Add support for transitioning PCIe endpoints under host bridge into D3cold by integrating with the DWC core suspend/resume helpers. Implement PME_TurnOff message generation via ELBI_SYS_CTRL and hook it into the DWC host operations so the controller follows the standard PME_TurnOff-based power-down sequence before entering D3cold. When the device is suspended into D3cold, fully tear down interconnect bandwidth, OPP votes. If D3cold is not entered, retain existing behavior by keeping the required interconnect and OPP votes. Use dw_pcie::skip_pwrctrl_off to avoid powering off devices during suspend to preserve wakeup capability of the devices and also not to power on the devices in the init path. Drop the qcom_pcie::suspended flag and rely on the existing dw_pcie::suspended state, which now drives both the power-management flow and the interconnect/OPP handling. Link: https://lore.kernel.org/all/20260429-d3cold-v5-5-89e9735b9df6@oss.qualcomm.com/ Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com> Signed-off-by: Ziyue Zhang <ziyue.zhang@oss.qualcomm.com>
1 parent 0a3d45f commit 2eb8abb

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

drivers/pci/controller/dwc/pcie-qcom.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,9 +1385,10 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp)
13851385
err_assert_reset:
13861386
qcom_pcie_perst_assert(pcie);
13871387
err_pwrctrl_power_off:
1388-
pci_pwrctrl_power_off_devices(pci->dev);
1388+
if (!pp->skip_pwrctrl_off)
1389+
pci_pwrctrl_power_off_devices(pci->dev);
13891390
err_pwrctrl_destroy:
1390-
if (ret != -EPROBE_DEFER)
1391+
if (ret != -EPROBE_DEFER && !pci->suspended)
13911392
pci_pwrctrl_destroy_devices(pci->dev);
13921393
err_disable_phy:
13931394
qcom_pcie_phy_power_off(pcie);
@@ -2035,11 +2036,6 @@ static int qcom_pcie_suspend_noirq(struct device *dev)
20352036
if (ret)
20362037
return ret;
20372038

2038-
if (pcie->pci->suspended)
2039-
dev_pm_genpd_rpm_always_on(dev, false);
2040-
else
2041-
dev_pm_genpd_rpm_always_on(dev, true);
2042-
20432039
if (pcie->pci->suspended) {
20442040
ret = icc_disable(pcie->icc_mem);
20452041
if (ret)

0 commit comments

Comments
 (0)