From patchwork Tue Sep 23 14:28:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minghuan Lian X-Patchwork-Id: 4956811 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 760949F4DC for ; Tue, 23 Sep 2014 14:29:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 831072015E for ; Tue, 23 Sep 2014 14:29:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D584520221 for ; Tue, 23 Sep 2014 14:29:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756064AbaIWO3G (ORCPT ); Tue, 23 Sep 2014 10:29:06 -0400 Received: from mail-bn1bon0141.outbound.protection.outlook.com ([157.56.111.141]:41189 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755932AbaIWO3F (ORCPT ); Tue, 23 Sep 2014 10:29:05 -0400 Received: from BN3PR0301CA0049.namprd03.prod.outlook.com (25.160.152.145) by CY1PR0301MB0633.namprd03.prod.outlook.com (25.160.158.139) with Microsoft SMTP Server (TLS) id 15.0.1034.13; Tue, 23 Sep 2014 14:28:56 +0000 Received: from BN1BFFO11FD052.protection.gbl (2a01:111:f400:7c10::1:111) by BN3PR0301CA0049.outlook.office365.com (2a01:111:e400:401e::17) with Microsoft SMTP Server (TLS) id 15.0.1034.13 via Frontend Transport; Tue, 23 Sep 2014 14:28:56 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD052.mail.protection.outlook.com (10.58.145.7) with Microsoft SMTP Server (TLS) id 15.0.1029.15 via Frontend Transport; Tue, 23 Sep 2014 14:28:56 +0000 Received: from lmh.ap.freescale.net (lmh.ap.freescale.net [10.193.20.46]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s8NESkfx024223; Tue, 23 Sep 2014 07:28:52 -0700 From: Minghuan Lian To: CC: , Zang Roy-R61911 , Hu Mingkai-B21284 , Scott Wood , Yoder Stuart-B08248 , Arnd Bergmann , Bjorn Helgaas , "Minghuan Lian" Subject: [PATCH] PCI: designware: Fix IO resource end address calculation Date: Tue, 23 Sep 2014 22:28:57 +0800 Message-ID: <1411482540-31297-2-git-send-email-Minghuan.Lian@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411482540-31297-1-git-send-email-Minghuan.Lian@freescale.com> References: <1411482540-31297-1-git-send-email-Minghuan.Lian@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(92566001)(97736003)(36756003)(21056001)(2351001)(76482002)(105606002)(92726001)(90102001)(229853001)(107046002)(106466001)(76176999)(95666004)(104166001)(120916001)(10300001)(50226001)(88136002)(74502003)(50466002)(20776003)(62966002)(79102003)(80022003)(93916002)(50986999)(85852003)(81342003)(81542003)(74662003)(46102003)(86362001)(110136001)(77982003)(77156001)(87286001)(31966008)(104016003)(6806004)(99396002)(19580405001)(87936001)(83072002)(48376002)(68736004)(85306004)(47776003)(64706001)(89996001)(19580395003)(44976005)(84676001)(4396001)(83322001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB0633; H:tx30smr01.am.freescale.net; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0633; X-Forefront-PRVS: 0343AC1D30 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Minghuan.Lian@freescale.com; X-OriginatorOrg: freescale.com 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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 End address should be equal to start_addr + size - 1. The patch fixes PCI IO resource end address calculation. Signed-off-by: Minghuan Lian --- drivers/pci/host/pcie-designware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 0f3cb2a..c19184f7 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -459,7 +459,7 @@ int __init dw_pcie_host_init(struct pcie_port *pp) pp->io.end = min_t(resource_size_t, IO_SPACE_LIMIT, range.pci_addr + range.size - + global_io_offset); + + global_io_offset - 1); pp->io_size = resource_size(&pp->io); pp->io_bus_addr = range.pci_addr; pp->io_base = range.cpu_addr;