[PATCH] PCI: dwc: move dw_pcie_iatu_detect() after host_init callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
Fixes: 9ea483375ded ("PCI: dwc: Move forward the iATU detection process")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
---
 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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux