Commit 2c7d3662 authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by Kleber Sacilotto de Souza

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

BugLink: https://bugs.launchpad.net/bugs/1797563

[ Upstream commit dfd0309f ]

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: 11be6547 ("PCI: mvebu: Adapt to the new device tree layout")
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent fecee54b
...@@ -1235,7 +1235,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev) ...@@ -1235,7 +1235,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment