From patchwork Mon Mar 11 09:31:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847235 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 1C280139A for ; Mon, 11 Mar 2019 10:31:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03AD328F17 for ; Mon, 11 Mar 2019 10:31:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3EAD28F40; Mon, 11 Mar 2019 10:31:48 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 6AD8E28F70 for ; Mon, 11 Mar 2019 10:31:48 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: 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=SVoGEN28RN/KwNvxFSXtQ7jHFbMJ41cl/zza4QMUOvI=; b=LIrXrnFhGjJt3n lwXhf8ORaxUtFjI9ZL1xmJ7Ii3C+rIXfs/4tKm2cEnzF+DxEOdVBgpykrUOMl9fJ047JDIOt4YPm6 KR7B0P1dyO1Pu4YyUDi2F/mijexHttX3pLhIGLTy8jQEg9eTf9efcQgqMCqvgE/8Zg1/yWOeuNyU5 1V+qXDiBsz341Cf6/+OD9RFB29DV11zFeZ50n46rggSpgEytwm7Zq2Elk6w9Oq0AoKGsBXFaEd/Pi Djn6sOCTZGFKBs1HLZ0E138CcKkIY2Js8TXzFTHP91e/wrKWkZqbWSZwv54lCIHHVXFL90YCIwp9g vZ/aEs68suUUhC7iJK6g==; 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 1h3IDc-0008JO-Qv; Mon, 11 Mar 2019 10:31:40 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3ID2-0007Mk-1X for linux-arm-kernel@bombadil.infradead.org; Mon, 11 Mar 2019 10:31:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=y/a8qAlxeqJzSchfITzvJwR/7Avj4N4SKqgqIBpuQrE=; b=zDGCtSp/RqaaAOA8nhHzsjZgcN uXQR4X5BCF8lZKd/GGlibZwcP/PTu9yiaqaHz8YVuEzXzP6YBktVDyadDYXKlxiojfyoV/o5fDGSJ 5p4dBQwYmuQNDN5DZSidXtQjco4Y6rw1Wo8mVd3aW4jqBoCGGfT/w1pcsnME4mNm0fY7N6ia0x1Sn adTOCotX+ZfGIke/VzMzOAmqd2RgP75ALBA/xkk0YE9FOCkyHN5liNaSvzyB+P6XHfkM055zcP/Xk V4J7WYvXFAMWAnbj6wctsBZ7M2vSKP6IJU5CGhli362CTwVIYJpGU37ZenUGlKcdKV/dwQPnUwhxH leE/ESJA==; Received: from mail-eopbgr70054.outbound.protection.outlook.com ([40.107.7.54] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HHz-0008Hu-Me for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:32:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y/a8qAlxeqJzSchfITzvJwR/7Avj4N4SKqgqIBpuQrE=; b=xUJHXxRbUcq/WXK5bOsZagJhPY0x9PGmcX6wxx37tHgv4h27ZdAOiNOk/iFNCNFclTF9YVTkrU7bzv1zahaI45juwAkSaJmlxSpYUZqBV8WS8CBSw9TRanjyn/vLGnO7nPoPNEbeyMh2/+3ngCHOXSn/XZnEFcoBVfz7MeG30zw= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:31:31 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:31:31 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 12/28] PCI: mobiveil: move out the link up waiting from mobiveil_host_init Thread-Topic: [PATCHv4 12/28] PCI: mobiveil: move out the link up waiting from mobiveil_host_init Thread-Index: AQHU1+01OAPqrzT7sUuzybX31Yd4fw== Date: Mon, 11 Mar 2019 09:31:31 +0000 Message-ID: <20190311093130.7209-13-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b552853a-3d70-4c14-8f56-08d6a604584c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:60oAHf54hxehkY0pxln2hx8EpStpSmFlGhumKGU?= =?iso-8859-1?q?v8lxQagAbjVraZb?= =?iso-8859-1?q?EMAVe0f3cNvBye64V/4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owoiIpAmkbYE?= =?iso-8859-1?q?LqfzDAw6dID5EF+cGexh6/kvSwvYDaCMDPd3zZDSxw8V8lG+KSQzxT6Hon+k?= =?iso-8859-1?q?nL0t3gi5UqJRB1CPUwpOS4rBLLkVlghUxoeZu8BCqCuRrvv0nclU23GXi261?= =?iso-8859-1?q?75/AF0SSY+5jnvWkvNpXwWveoKGjNXGi6VOw/zqBo5bmA5IO3zrUbxD9M6o1?= =?iso-8859-1?q?6mPuNVDeP21muQBkUJdo14+wF5VRxdMoB2guvQ0FueDbb0v9UQpVBKkNrmxQ?= =?iso-8859-1?q?FnzFVxamNSeyKBgwSWlhczzuBs+JmthSGAHkhvAHsVVs4CdMFu0TATbjzSFK?= =?iso-8859-1?q?0bTSUgW5cOYG07wVFz0rXixsyl3681PXQ7nexofzRE4dLTrEiIMdXacdvT6C?= =?iso-8859-1?q?jr8NxALK1NwFiqY3tDcI0yVFqeMV9mWlxX9PAxKvFAsx4YlhirGrl/0NDHgP?= =?iso-8859-1?q?tptAaXjLeA4kaHfFv9KrTY1BmY2+y0h5oK?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(2501003)(86362001)(256004)(14454004)(316002)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 65107GJjDvV2B7D6cFCLRZo4NlHsdBJ4RWxIoaVDlGzpOIcc30M68pVV9YNTPorHGqQ7mAzJviUZAtrQE7/am+37lCCItczF+oT2sZNCE6cyod82tTUtgZo0oD7x0toIje7LdClRDVMwsB28NvqWfrXnyOTnB8LKOP+RBzEP0n/W0x+URm6uprEx0VZawFaVWP0NykmJlVx8PyKQDDB40wncjHngQhpjZTBQDPr6e+MFDZRYJcIXdPWqiH23UbZoqbweCRR088laDcwlchMzRRwBofErRrN9Qg8C7LTxleWOrnivzCZ09kQJXemV8CpWx3KxhNTQUNw4BPFKvmYWe5PQKOIlCK6VMfaEjdDORCMYB0h66cGnwSOkg6O7SnGM8Ehcp5YbL0mLptbcdQVKk9FELhFk30QNak6E574leJ4= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b552853a-3d70-4c14-8f56-08d6a604584c X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:31:31.3328 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_053207_760971_FB45EDC2 X-CRM114-Status: GOOD ( 13.48 ) 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: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu 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 From: Hou Zhiqiang Host initial sequence does not depend on PCIe link up, so move it to the place just before the enumeration. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index 8eee1ab7ee24..c2848c22b466 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -582,15 +582,8 @@ static void mobiveil_pcie_enable_msi(struct mobiveil_pcie *pcie) static int mobiveil_host_init(struct mobiveil_pcie *pcie) { u32 value, pab_ctrl, type; - int err; struct resource_entry *win; - err = mobiveil_bringup_link(pcie); - if (err) { - dev_info(&pcie->pdev->dev, "link bring-up failed\n"); - return err; - } - /* * program Bus Master Enable Bit in Command Register in PAB Config * Space @@ -662,7 +655,7 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) /* setup MSI hardware registers */ mobiveil_pcie_enable_msi(pcie); - return err; + return 0; } static void mobiveil_mask_intx_irq(struct irq_data *data) @@ -922,6 +915,12 @@ static int mobiveil_pcie_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; + ret = mobiveil_bringup_link(pcie); + if (ret) { + dev_info(dev, "link bring-up failed\n"); + goto error; + } + /* setup the kernel resources for the newly added PCIe root bus */ ret = pci_scan_root_bus_bridge(bridge); if (ret)