Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3174407ybi; Fri, 5 Jul 2019 03:10:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlyJ4Shc6iG+6jk+ynutylP4+ssZCzOgj0p1d0RvY+/SrTtn99DuMQ3poyz/9OPUiBX3Hy X-Received: by 2002:a17:902:8489:: with SMTP id c9mr4475920plo.327.1562321403590; Fri, 05 Jul 2019 03:10:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562321403; cv=none; d=google.com; s=arc-20160816; b=E4+/hSXZeHH5VLXO3G5xBIDI+JT3gJKX6T6df2PdGaWXQ0RpLofamjqQIiEkrAZ4Hq 9at9p9TxTy5e3zGW32vz4ImDHzndCERwVT6EKTlQCMPdKpcXEqz0GcumYtoizwjMFJ87 VnnwgOYVZhO7z3sgzYO7Gz5kkWrAOqIQISD1DL7RZ3dGtb8nDGL28OL1iSQW+cIu6N2M Ld5GbvDxsjxlSRNKaoERTBMsU6XTaAdcgo7wHeyEZUlH5FK//KkuMkUtByQacHApDAr8 hsi0F/O0N67ivyc+LAr1LWI2G6kD0shX6IS3wtoEhmQkBB/X/ozww7aH80grbYBfEIpo cwIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=iVCDtlwyL1YFzJHfrd2nzV2if98bnpUEYiaNp1RYU48=; b=XHGDccooUomjpYmnD64scRXzd57yPZoNPyTlLov741ZKBqqP9IGZlgVpK6LyCe4wFl nczJ/pLSqM86gQ27usPAm5rrI+lEBOoeiXy4cQrqt9FvaGyTSplmkjWkRLIwi9NiMo2v HXgwnQZRPeehpNSt7rsugzi+z5rerJ/lJmD0Tnk1+9sobJ06pNrzsgaJ6ScSsGsASoLl QKGgShSqYNRas6l1Tkt7rdRvKaVzu/05+SgXpuahT/HQ43eIMSeW1IMTkRGn5x+ZSAPv Qg4X4oOKmAby/wTmZM7VyivNB8ovgYFf6vEfkDmHNHQYN+279KJadMF8+zGzFgCrjNH/ fOBg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 g1si8502433plg.353.2019.07.05.03.09.48; Fri, 05 Jul 2019 03:10:03 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728186AbfGEKHX (ORCPT + 99 others); Fri, 5 Jul 2019 06:07:23 -0400 Received: from inva020.nxp.com ([92.121.34.13]:60926 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728097AbfGEKHT (ORCPT ); Fri, 5 Jul 2019 06:07:19 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3D2511A0EAC; Fri, 5 Jul 2019 12:07:17 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B194B1A077B; Fri, 5 Jul 2019 12:07:08 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id BE66E40327; Fri, 5 Jul 2019 18:06:56 +0800 (SGT) From: Hou Zhiqiang 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, leoyang.li@nxp.com, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, will.deacon@arm.com Cc: Mingkai.Hu@nxp.com, Minghuan.Lian@nxp.com, Xiaowei.Bao@nxp.com, Hou Zhiqiang Subject: [PATCHv6 08/28] PCI: mobiveil: Move the link up waiting out of mobiveil_host_init() Date: Fri, 5 Jul 2019 17:56:36 +0800 Message-Id: <20190705095656.19191-9-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190705095656.19191-1-Zhiqiang.Hou@nxp.com> References: <20190705095656.19191-1-Zhiqiang.Hou@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The host initializing sequence does not depend on PCIe link up, so move it to the plac just before the enumeration. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V6: - Rebased the patch, no functional change. drivers/pci/controller/pcie-mobiveil.c | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index 9e08061..8f92f05 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -561,15 +561,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 = 0; - 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 @@ -635,7 +628,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) @@ -892,6 +885,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) -- 1.7.1