From patchwork Fri Aug 3 14:38:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 10555197 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8682E1822 for ; Fri, 3 Aug 2018 14:39:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7317F2C7C0 for ; Fri, 3 Aug 2018 14:39:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64DCB2C7D6; Fri, 3 Aug 2018 14:39:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 225672C7C0 for ; Fri, 3 Aug 2018 14:39:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=1y5BjTrYo9NsEthTODj2T1uwNbv9MNH74esOCUdEY6k=; b=Y+AbzRHCaHyVZbOCq3ptocigCp mOf0vOR79q0QmmtIv8bkRHPGJlw/OJ7FzktD1+hqhO7uOPGItoQZYK6jFwlxAaijoT2+/oRq8pBtW fQGiwX5tCoy5MlG5xbCIGwweTG4R7hSOXuhUgvrMcWpUk9ALpDcI/93mX0wuH1EQ2nX2uUzYay/q2 NQfgj4WgbTbDFZoKPMc9lGdUgYvEjB7iiheNUyCgpAjI2PE6+B55/d3IWhjeyVoeFkgHAtAVVYdZF llFnfswXHqnlPCIXdDzDoqMIFzORm6MieluDgx/P7EsizNq5R7317zZedX9MOT0s3hwFB/BM3o+Ba 4Jl2wjVA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1flbEk-0001tf-Ky; Fri, 03 Aug 2018 14:39:26 +0000 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1flbEP-0001Qd-De for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 14:39:08 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id 4D96F207BD; Fri, 3 Aug 2018 16:38:51 +0200 (CEST) Received: from localhost (AAubervilliers-681-1-99-143.w90-88.abo.wanadoo.fr [90.88.4.143]) by mail.bootlin.com (Postfix) with ESMTPSA id 25E6D20712; Fri, 3 Aug 2018 16:38:51 +0200 (CEST) From: Thomas Petazzoni To: Bjorn Helgaas , Lorenzo Pieralisi , linux-pci@vger.kernel.org Subject: [PATCH v2 2/6] PCI: mvebu: fix I/O space end address calculation Date: Fri, 3 Aug 2018 16:38:44 +0200 Message-Id: <20180803143848.21551-3-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180803143848.21551-1-thomas.petazzoni@bootlin.com> References: <20180803143848.21551-1-thomas.petazzoni@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180803_073905_611258_DFFDF01F X-CRM114-Status: GOOD ( 13.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Antoine Tenart , Gregory Clement , Maxime Chevallier , Nadav Haklai , Thomas Petazzoni , =?utf-8?q?Miqu=C3=A8l_Rayn?= =?utf-8?q?al?= , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- This bug never had any visible impact, so there is no need to push to stable. --- drivers/pci/controller/pci-mvebu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index 38fa2d08527d..a195592723c2 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/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.end = min_t(resource_size_t, IO_SPACE_LIMIT, - resource_size(&pcie->io)); + resource_size(&pcie->io) - 1); } else pcie->realio = pcie->io;