From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: linux-arm-msm@vger.kernel.org,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
linux-pci@vger.kernel.org, Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Subject: [PATCH] PCI: dwc: move dw_pcie_iatu_detect() after host_init callback
Date: Wed, 7 Apr 2021 16:12:55 +0300 [thread overview]
Message-ID: <20210407131255.702054-1-dmitry.baryshkov@linaro.org> (raw)
The commit 9ea483375ded ("PCI: dwc: Move forward the iATU detection
process") broke PCIe support on Qualcomm SM8250 (and maybe other
platforms) since it moves the call to dw_pcie_iatu_detect() at the
beginning of the dw_pcie_host_init(), before ops->host_init() callback.
Accessing PCIe registers at this point causes the board to reboot since
not all clocks are enabled, making PCIe registers unavailable.
Move dw_pcie_iatu_detect() call after calling ops->host_init() callback,
so that all register are accessible.
Cc: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Fixes: 9ea483375ded ("PCI: dwc: Move forward the iATU detection process")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/pci/controller/dwc/pcie-designware-host.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 52f6887179cd..24192b40e3a2 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -319,8 +319,6 @@ int dw_pcie_host_init(struct pcie_port *pp)
return PTR_ERR(pci->dbi_base);
}
- dw_pcie_iatu_detect(pci);
-
bridge = devm_pci_alloc_host_bridge(dev, 0);
if (!bridge)
return -ENOMEM;
@@ -400,6 +398,7 @@ int dw_pcie_host_init(struct pcie_port *pp)
if (ret)
goto err_free_msi;
}
+ dw_pcie_iatu_detect(pci);
dw_pcie_setup_rc(pp);
dw_pcie_msi_init(pp);
--
2.30.2
next reply other threads:[~2021-04-07 13:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-07 13:12 Dmitry Baryshkov [this message]
2021-04-07 13:37 ` [PATCH] PCI: dwc: move dw_pcie_iatu_detect() after host_init callback Dmitry Baryshkov
2021-04-13 10:21 ` Lorenzo Pieralisi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210407131255.702054-1-dmitry.baryshkov@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=Zhiqiang.Hou@nxp.com \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).