Return-Path: Received: from mail-bl2nam02on0125.outbound.protection.outlook.com ([104.47.38.125]:12860 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727810AbeH3WOx (ORCPT ); Thu, 30 Aug 2018 18:14:53 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: Thomas Petazzoni , Lorenzo Pieralisi , Sasha Levin Subject: [PATCH AUTOSEL 4.14 47/67] PCI: mvebu: Fix I/O space end address calculation Date: Thu, 30 Aug 2018 18:11:28 +0000 Message-ID: <20180830180918.36327-47-alexander.levin@microsoft.com> References: <20180830180918.36327-1-alexander.levin@microsoft.com> In-Reply-To: <20180830180918.36327-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Thomas Petazzoni [ 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: 11be65472a427 ("PCI: mvebu: Adapt to the new device tree layout") Signed-off-by: Thomas Petazzoni Signed-off-by: Lorenzo Pieralisi Signed-off-by: Sasha Levin --- drivers/pci/host/pci-mvebu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index 8d88f19dc171..12c1c1851ee6 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c @@ -1220,7 +1220,7 @@ static int mvebu_pcie_probe(struct platform_device *p= dev) pcie->realio.start =3D PCIBIOS_MIN_IO; pcie->realio.end =3D min_t(resource_size_t, IO_SPACE_LIMIT, - resource_size(&pcie->io)); + resource_size(&pcie->io) - 1); } else pcie->realio =3D pcie->io; =20 --=20 2.17.1