Skip to content

Commit ee16043

Browse files
tpetazzoniLorenzo Pieralisi
authored andcommitted
PCI: mvebu: Only remap I/O space if configured
If there is no PCI I/O aperture configured in the Device Tree, it does not make sense to create the virtual mapping for the PCI I/O space, since we will anyway not create the MBus window that will allow to access it. Therefore, do the pci_ioremap_io() only if necessary. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
1 parent dfd0309 commit ee16043

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/pci/controller/pci-mvebu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,9 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
12201220
pcie->realio.end = min_t(resource_size_t,
12211221
IO_SPACE_LIMIT,
12221222
resource_size(&pcie->io) - 1);
1223+
1224+
for (i = 0; i < (IO_SPACE_LIMIT - SZ_64K); i += SZ_64K)
1225+
pci_ioremap_io(i, pcie->io.start + i);
12231226
} else
12241227
pcie->realio = pcie->io;
12251228

@@ -1278,9 +1281,6 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
12781281

12791282
pcie->nports = i;
12801283

1281-
for (i = 0; i < (IO_SPACE_LIMIT - SZ_64K); i += SZ_64K)
1282-
pci_ioremap_io(i, pcie->io.start + i);
1283-
12841284
mvebu_pcie_enable(pcie);
12851285

12861286
return 0;

0 commit comments

Comments
 (0)