[lkml]   [2018]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[RESEND PATCH] PCI: qcom: add runtime pm support to pcie_port
From: Srinivas Kandagatla <>

This patch is required when the pcie controller sits on a bus with
its own power domain and clocks which are controlled via a bus driver
like simple pm bus. As these bus driver have runtime pm enabled, it makes
sense to update the usage counter so that the runtime pm does not suspend
the clks or power domain associated with the bus driver.

Signed-off-by: Srinivas Kandagatla <>
Signed-off-by: Bjorn Andersson <>

This patch was posted 18 months ago but was somehow lost. linux-next recently
enabled PCIe on MSM8996 and DB820c, but the system stalls as the agnoc gdsc
isn't enabled. This patch still fixes this problem for me.

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

diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
index 5897af7d3355..3f35098b71b1 100644
--- a/drivers/pci/dwc/pcie-qcom.c
+++ b/drivers/pci/dwc/pcie-qcom.c
@@ -1088,6 +1088,8 @@ static int qcom_pcie_host_init(struct pcie_port *pp)
struct qcom_pcie *pcie = to_qcom_pcie(pci);
int ret;

+ pm_runtime_get_sync(pci->dev);

ret = pcie->ops->init(pcie);
@@ -1124,6 +1126,7 @@ static int qcom_pcie_host_init(struct pcie_port *pp)
+ pm_runtime_put_sync(pci->dev);

return ret;
@@ -1204,6 +1207,7 @@ static int qcom_pcie_probe(struct platform_device *pdev)
struct qcom_pcie *pcie;
int ret;

pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
if (!pcie)
return -ENOMEM;
@@ -1212,6 +1216,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)
if (!pci)
return -ENOMEM;

+ pm_runtime_enable(dev);
pci->dev = dev;
pci->ops = &dw_pcie_ops;
pp = &pci->pp;
 \ /
  Last update: 2018-05-18 09:08    [W:0.055 / U:2.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site