From patchwork Fri Oct 10 05:41:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 5063751 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 A30569F295 for ; Fri, 10 Oct 2014 06:11:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B20872018E for ; Fri, 10 Oct 2014 06:11:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFC76200F3 for ; Fri, 10 Oct 2014 06:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751385AbaJJGLq (ORCPT ); Fri, 10 Oct 2014 02:11:46 -0400 Received: from mail-bl2on0129.outbound.protection.outlook.com ([65.55.169.129]:24329 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750990AbaJJGLp (ORCPT ); Fri, 10 Oct 2014 02:11:45 -0400 Received: from BN3PR0301CA0061.namprd03.prod.outlook.com (25.160.152.157) by DM2PR0301MB0861.namprd03.prod.outlook.com (25.160.215.147) with Microsoft SMTP Server (TLS) id 15.0.1044.10; Fri, 10 Oct 2014 06:11:42 +0000 Received: from BY2FFO11FD005.protection.gbl (2a01:111:f400:7c0c::177) by BN3PR0301CA0061.outlook.office365.com (2a01:111:e400:401e::29) with Microsoft SMTP Server (TLS) id 15.0.1049.19 via Frontend Transport; Fri, 10 Oct 2014 06:11:41 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD005.mail.protection.outlook.com (10.1.14.126) with Microsoft SMTP Server (TLS) id 15.0.1039.16 via Frontend Transport; Fri, 10 Oct 2014 06:11:41 +0000 Received: from shlinux1.ap.freescale.net (shlinux1.ap.freescale.net [10.192.225.216]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s9A6BbWa023631; Thu, 9 Oct 2014 23:11:39 -0700 Received: by shlinux1.ap.freescale.net (Postfix, from userid 1003) id 54B9D1AE207; Fri, 10 Oct 2014 13:41:17 +0800 (CST) From: Richard Zhu To: CC: , , , , Richard Zhu , Richard Zhu Subject: [PATCH v5 2/9] PCI: designware: fix one potential assignment error of cfg start Date: Fri, 10 Oct 2014 13:41:09 +0800 Message-ID: <1412919676-25344-3-git-send-email-richard.zhu@freescale.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1412919676-25344-1-git-send-email-richard.zhu@freescale.com> References: <1412919676-25344-1-git-send-email-richard.zhu@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(189002)(199003)(87286001)(88136002)(103686003)(105586002)(120916001)(89996001)(50226001)(52956003)(85852003)(4396001)(87936001)(76482002)(97736003)(84676001)(106466001)(99396003)(85306004)(19580395003)(107046002)(68736004)(229853001)(6806004)(19580405001)(2351001)(44976005)(110136001)(92566001)(104166001)(93916002)(92726001)(20776003)(16796002)(33646002)(31966008)(64706001)(42186005)(47776003)(46386002)(45336002)(80022003)(46102003)(50986999)(101416001)(26826002)(102836001)(76176999)(95666004)(77096002)(62966002)(21056001)(50466002)(48376002)(36756003)(77156001)(90966001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB0861; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:0; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0861; X-Forefront-PRVS: 03607C04F0 Received-SPF: None (protection.outlook.com: shlinux1.ap.freescale.net does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 192.88.168.50) smtp.mailfrom=r65037@shlinux1.ap.freescale.net; 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.9 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 From: Richard Zhu if va_cfg0_base/va_cfg1_base are initialized by designware core, the pp->cfg.start is not initialized properly, when IORESOURCE_MEM "config" is represented as cfg space resource. solution: assign cfg_res->start to pp->cfg.start. Signed-off-by: Richard Zhu --- drivers/pci/host/pcie-designware.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index ae1e6c5..f1f127f 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -444,6 +444,7 @@ int __init dw_pcie_host_init(struct pcie_port *pp) if (cfg_res) { pp->config.cfg0_size = resource_size(cfg_res)/2; pp->config.cfg1_size = resource_size(cfg_res)/2; + pp->cfg.start = cfg_res->start; pp->cfg0_base = cfg_res->start; pp->cfg1_base = cfg_res->start + pp->config.cfg0_size;