Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp926475imc; Mon, 11 Mar 2019 02:34:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlRxxw/srJmrxgYJ10BHbI1h1xFF9iys8s72iG12EuhjEe92leh1Pg7LdZteMbWlDU3bPW X-Received: by 2002:a62:ea0f:: with SMTP id t15mr32521839pfh.124.1552296872404; Mon, 11 Mar 2019 02:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552296872; cv=none; d=google.com; s=arc-20160816; b=ZrCdx20yix/zno+jL7vTEedZ5Lmr/O7XuL28q52XZiIGNrRnprcX5VIes7q2FSW5mX zaSibLea/Zgm/w3YSw+gmNWCr65YN+RH0o1L/TCUH3GKoMjUFJYkFPW90mx+psz8ARe5 7gahYwaF0bNjfHdCIBqFCZT/u1low4SBPw9Y8KY6LgOU92YUDx8TJyuh2+6FsA1xko3I z4hyniqpfZpCTu08FwY8GX3jMWkejqOkgU3ibjpzUkt0qJS3Gu8AjvbVYhk9LT+lYLw0 y1vyTpZJ7G+tonKRlPiyi7wxSqVN/Y/dbTP7lZp7sS2s4n6BdrLfNa60BgRsuUSb9ElR mgiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=y/a8qAlxeqJzSchfITzvJwR/7Avj4N4SKqgqIBpuQrE=; b=E0ZnVn9xF0aAF7bzp94Nl+Dg6XgFwuXSbOJvp8x4cluaJDr+IyJPALdXnhu3/paGZ6 mfdB4KXEP8JR/nEXGPzMt5TBDUaCBS+1jEZo06G3Yt9QruI8bIfcteydn50E2wPyvG+0 sQAUwhrjwHx4n6m2ZCJbxlVZaDRFqrE8FCTqMdc+DqmvToREWCTp7BJKi5xgTgEJKZfv qkY40zQfQk04G6u23PkJYkJDhgZYepAPH5NRbUDYyb5nxQ2jSPx2y3tkFkm4AACSv9xx Y9IP/xR3yMqHl5DeSKZ3uVrvyJcgo55lDs29S6Ut+fwr4jqjTqKHzgqwvnNg/VFL9GqL qHJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=xUJHXxRb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si4552821pgc.576.2019.03.11.02.34.16; Mon, 11 Mar 2019 02:34:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=xUJHXxRb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727239AbfCKJcP (ORCPT + 99 others); Mon, 11 Mar 2019 05:32:15 -0400 Received: from mail-eopbgr80085.outbound.protection.outlook.com ([40.107.8.85]:48938 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727124AbfCKJcP (ORCPT ); Mon, 11 Mar 2019 05:32:15 -0400 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" CC: Mingkai Hu , "M.h. Lian" , Xiaowei Bao , "Z.q. Hou" 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?v8lxQagAbjVraZbEMAVe0f3cNvBye64V/4L1MGEPO2Z9bgosAapFOsVl74?= =?iso-8859-1?Q?S0WLzNtE/R3n8mZZgnvRWyWRu+Y7wxVqrC0VCQ1h9FpKz1bPFpYHW6yGrJ?= =?iso-8859-1?Q?tiS4rRp9LqYn1pGp653mznB83dlN6LnesKm+5CeIGsRnyFHYV7Dis86Vrf?= =?iso-8859-1?Q?OIJZSeCk+8QhKewWePjEaCY9ThTXGIkl2GMzY6Ihk4d4n+ZLBMN4awVNkE?= =?iso-8859-1?Q?gr4/rrHMiPbUO0MRWl515n1FNXxYjggHNpDrMhelDHzm+Z/2LX5e73fmGY?= =?iso-8859-1?Q?YQahoRAn8tEupEqKeXXzig8db2jThAN+bnDI41eQ7igUc0IU2V2ffwAuyu?= =?iso-8859-1?Q?Q7Go6dDiJGZ8cGj4lvSOGRjV6BuwTUp1nsoCX3dqoXf4sLBEtu/td36Go8?= =?iso-8859-1?Q?XfFCtHoAZm8JF5plqM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Q?r8NxALK1NwFiqY3tDcI0yVFqeMV9mWlxX9PAxKvFAsx4YlhirGrl/0NDHg?= =?iso-8859-1?Q?PtptAaXjLeA4kaHfFv9KrTY1BmY2+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= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/controlle= r/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_p= cie *pcie) static int mobiveil_host_init(struct mobiveil_pcie *pcie) { u32 value, pab_ctrl, type; - int err; struct resource_entry *win; =20 - err =3D 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 *pci= e) /* setup MSI hardware registers */ mobiveil_pcie_enable_msi(pcie); =20 - return err; + return 0; } =20 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 =3D of_irq_parse_and_map_pci; bridge->swizzle_irq =3D pci_common_swizzle; =20 + ret =3D 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 =3D pci_scan_root_bus_bridge(bridge); if (ret) --=20 2.17.1