aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/controller/dwc/pcie-designware-ep.c
diff options
context:
space:
mode:
authorHou Zhiqiang <[email protected]>2021-04-13 14:22:19 +0000
committerLorenzo Pieralisi <[email protected]>2021-04-29 16:05:59 +0000
commit8bcca26585585ae4b44d25d30f351ad0afa4976b (patch)
tree77d2aa7dbf5d895d319dc93d3f6c1d429c51b2b2 /drivers/pci/controller/dwc/pcie-designware-ep.c
parentPCI: dwc/intel-gw: Remove unused function (diff)
downloadkernel-8bcca26585585ae4b44d25d30f351ad0afa4976b.tar.gz
kernel-8bcca26585585ae4b44d25d30f351ad0afa4976b.zip
PCI: dwc: Move iATU detection earlier
dw_pcie_ep_init() depends on the detected iATU region numbers to allocate the in/outbound window management bitmap. It fails after 281f1f99cf3a ("PCI: dwc: Detect number of iATU windows"). Move the iATU region detection into a new function, move the detection to the very beginning of dw_pcie_host_init() and dw_pcie_ep_init(). Also remove it from the dw_pcie_setup(), since it's more like a software initialization step than hardware setup. Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/linux-pci/[email protected] Link: https://lore.kernel.org/r/[email protected] Fixes: 281f1f99cf3a ("PCI: dwc: Detect number of iATU windows") Tested-by: Kunihiko Hayashi <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Tested-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Hou Zhiqiang <[email protected]> [DB: moved dw_pcie_iatu_detect to happen after host_init callback] Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Rob Herring <[email protected]> Cc: [email protected] # v5.11+ Cc: Marek Szyprowski <[email protected]>
Diffstat (limited to 'drivers/pci/controller/dwc/pcie-designware-ep.c')
-rw-r--r--drivers/pci/controller/dwc/pcie-designware-ep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index 1c25d8337151..8d028a88b375 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -705,6 +705,8 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep)
}
}
+ dw_pcie_iatu_detect(pci);
+
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space");
if (!res)
return -EINVAL;