Skip to content

Commit 6e5ebc9

Browse files
GateworksLorenzo Pieralisi
authored andcommitted
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/20211101180243.23761-1-tharvey@gateworks.com Fixes: 281f1f9 ("PCI: dwc: Detect number of iATU windows") Signed-off-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Richard Zhu <hongxing.zhu@nxp.com> Cc: Richard Zhu <hongxing.zhu@nxp.com>
1 parent fa55b7d commit 6e5ebc9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/pci/controller/dwc/pcie-designware.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,11 @@ void dw_pcie_iatu_detect(struct dw_pcie *pci)
672672
if (!pci->atu_base) {
673673
struct resource *res =
674674
platform_get_resource_byname(pdev, IORESOURCE_MEM, "atu");
675-
if (res)
675+
if (res) {
676676
pci->atu_size = resource_size(res);
677-
pci->atu_base = devm_ioremap_resource(dev, res);
678-
if (IS_ERR(pci->atu_base))
677+
pci->atu_base = devm_ioremap_resource(dev, res);
678+
}
679+
if (!pci->atu_base || IS_ERR(pci->atu_base))
679680
pci->atu_base = pci->dbi_base + DEFAULT_DBI_ATU_OFFSET;
680681
}
681682

0 commit comments

Comments
 (0)