aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harvey <[email protected]>2021-11-01 11:02:43 -0700
committerLorenzo Pieralisi <[email protected]>2021-12-02 09:41:43 +0000
commit6e5ebc96ec651b67131f816d7e3bf286c635e749 (patch)
treef4a92f905961b944e597cae545d18a18c9c83dd1
parentfa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf (diff)
PCI: dwc: Do not remap invalid res
On imx6 and perhaps others when pcie probes you get a: imx6q-pcie 33800000.pcie: invalid resource This occurs because the atu is not specified in the DT and as such it should not be remapped. Link: https://lore.kernel.org/r/[email protected] Fixes: 281f1f99cf3a ("PCI: dwc: Detect number of iATU windows") Signed-off-by: Tim Harvey <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Rob Herring <[email protected]> Acked-by: Richard Zhu <[email protected]> Cc: Richard Zhu <[email protected]>
-rw-r--r--drivers/pci/controller/dwc/pcie-designware.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index 850b4533f4ef..d92c8a25094f 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -672,10 +672,11 @@ void dw_pcie_iatu_detect(struct dw_pcie *pci)
if (!pci->atu_base) {
struct resource *res =
platform_get_resource_byname(pdev, IORESOURCE_MEM, "atu");
- if (res)
+ if (res) {
pci->atu_size = resource_size(res);
- pci->atu_base = devm_ioremap_resource(dev, res);
- if (IS_ERR(pci->atu_base))
+ pci->atu_base = devm_ioremap_resource(dev, res);
+ }
+ if (!pci->atu_base || IS_ERR(pci->atu_base))
pci->atu_base = pci->dbi_base + DEFAULT_DBI_ATU_OFFSET;
}