Bläddra i källkod

PCI: mvebu: Fix I/O space end address calculation

pcie->realio.end should be the address of last byte of the area,
therefore using resource_size() of another resource is not correct, we
must substract 1 to get the address of the last byte.

Fixes: 11be65472a427 ("PCI: mvebu: Adapt to the new device tree layout")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thomas Petazzoni 7 år sedan
förälder
incheckning
dfd0309fd7
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      drivers/pci/controller/pci-mvebu.c

+ 1 - 1
drivers/pci/controller/pci-mvebu.c

@@ -1219,7 +1219,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
 		pcie->realio.start = PCIBIOS_MIN_IO;
 		pcie->realio.start = PCIBIOS_MIN_IO;
 		pcie->realio.end = min_t(resource_size_t,
 		pcie->realio.end = min_t(resource_size_t,
 					 IO_SPACE_LIMIT,
 					 IO_SPACE_LIMIT,
-					 resource_size(&pcie->io));
+					 resource_size(&pcie->io) - 1);
 	} else
 	} else
 		pcie->realio = pcie->io;
 		pcie->realio = pcie->io;