Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50956ef6 authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by Greg Kroah-Hartman
Browse files

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



[ Upstream commit dfd0309fd7b30a5baffaf47b2fccb88b46d64d69 ]

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>
parent 301ae591
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1220,7 +1220,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
		pcie->realio.start = PCIBIOS_MIN_IO;
		pcie->realio.end = min_t(resource_size_t,
					 IO_SPACE_LIMIT,
					 resource_size(&pcie->io));
					 resource_size(&pcie->io) - 1);
	} else
		pcie->realio = pcie->io;