Skip to content

Commit

Permalink
PCI: mvebu: Only remap I/O space if configured
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
  • Loading branch information
tpetazzoni authored and Lorenzo Pieralisi committed Aug 8, 2018
1 parent dfd0309 commit ee16043
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/pci/controller/pci-mvebu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,9 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
pcie->realio.end = min_t(resource_size_t,
IO_SPACE_LIMIT,
resource_size(&pcie->io) - 1);

for (i = 0; i < (IO_SPACE_LIMIT - SZ_64K); i += SZ_64K)
pci_ioremap_io(i, pcie->io.start + i);
} else
pcie->realio = pcie->io;

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

pcie->nports = i;

for (i = 0; i < (IO_SPACE_LIMIT - SZ_64K); i += SZ_64K)
pci_ioremap_io(i, pcie->io.start + i);

mvebu_pcie_enable(pcie);

return 0;
Expand Down

0 comments on commit ee16043

Please sign in to comment.