From patchwork Wed Feb 12 22:57:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 3641481 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7EC1EBF13A for ; Wed, 12 Feb 2014 22:57:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 87AB620165 for ; Wed, 12 Feb 2014 22:57:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B37C920158 for ; Wed, 12 Feb 2014 22:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753837AbaBLW5P (ORCPT ); Wed, 12 Feb 2014 17:57:15 -0500 Received: from quartz.orcorp.ca ([184.70.90.242]:56597 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753284AbaBLW5P (ORCPT ); Wed, 12 Feb 2014 17:57:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=obsidianresearch.com; s=rsa1; h=Message-Id:Date:Subject:Cc:To:From; bh=WswDTX2yZP22+s7Mrm7cFIlF9SFwQmKxWKwjiT0XF54=; b=s20YnX3vVFjaAi4BwL0oNKQ6s7iPUl8Pw/Y/1UP9njz4mkA2yPuZJ0adi8lWsICBN+HuWheWnXqdvOiu99mPgk57YqestWYX659wt7e7AEDxdDn47OEigNA/OS6pL4c0V+XWBbTFPdxwDQ7Ke1Bssw1YJq1AptmW3MDtAYG++Xc=; Received: from [10.0.0.161] (helo=jggl.edm.orcorp.ca) by quartz.orcorp.ca with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1WDiju-0007kC-5k; Wed, 12 Feb 2014 15:57:10 -0700 From: Jason Gunthorpe To: Thomas Petazzoni Cc: Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org Subject: [PATCH 1/2] bus: mvebu-mbus: Fix incorrect size for PCI aperture resources Date: Wed, 12 Feb 2014 15:57:07 -0700 Message-Id: <1392245828-23244-1-git-send-email-jgunthorpe@obsidianresearch.com> X-Mailer: git-send-email 1.8.1.2 X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.161 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP reg[0] is the DT base, reg[1] is the DT length in bytes, struct resource.end is the inclusive end address, so a -1 is required. Tested on kirkwood. Signed-off-by: Jason Gunthorpe Acked-by: Arnd Bergmann Acked-by: Jason Cooper --- drivers/bus/mvebu-mbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c index 2394e97..7fd54e9 100644 --- a/drivers/bus/mvebu-mbus.c +++ b/drivers/bus/mvebu-mbus.c @@ -876,14 +876,14 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np, ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg)); if (!ret) { mem->start = reg[0]; - mem->end = mem->start + reg[1]; + mem->end = mem->start + reg[1] - 1; mem->flags = IORESOURCE_MEM; } ret = of_property_read_u32_array(np, "pcie-io-aperture", reg, ARRAY_SIZE(reg)); if (!ret) { io->start = reg[0]; - io->end = io->start + reg[1]; + io->end = io->start + reg[1] - 1; io->flags = IORESOURCE_IO; } }