Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3648434ybt; Sun, 5 Jul 2020 02:20:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzhmRa611ySk293/yUtN6wIOQpYlnPkYYuo8q/zAPrT0M4svz0iGRZMF/sIf3GOqFeuG5X X-Received: by 2002:a17:907:2170:: with SMTP id rl16mr41168971ejb.422.1593940841289; Sun, 05 Jul 2020 02:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593940841; cv=none; d=google.com; s=arc-20160816; b=ueFBaRUD9q+a8Y1+V046aKpPx37vS1UtryhOs0vhIFncG4UDZeK0m6j5PH/smZ6a2o e1uejOLc2KeQ117ppUXum2ROBdHH4MLR3nMPzUmdn9MSAAV8ii1TbLD8tTFNaTRnavIH LGNtB+2sXH/RahFXZpz1B7gNJoHSP4o1FW5hanM3+F1ic7emq6XVPyOPNn6tJEmosasM 69yTWnjWsT9BfYoG33ewOvFz/NSypiuktNlxHOHHZoFo5UQbdUln5/dP6ZRl+W3txNPL YYshejjlX/KFcpEg8w4rz4HDLNM3uQ2al24mYou0axsSkwRSrYaZ79eqqYgKQFXqYqLP daxg== 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=D+vSJPHPRBcmejes28mvHsaHTe8kZVhmPPmP5lIUftg=; b=nu5G5jm7ioytx5uRFKZOrth6wQjFC6HXsA/0pYwnjknrPzbvjfO2xUOWucT1fQ9Xm6 7/mppkenQuhFZ3f4RboLKuo0s2uDQsZr+FvdAQvHE7XOUHyTDexCHwsptQ+8WG2U4068 8n1I/qjjc4KG8meHzD1rxFGkbWbcAAI6qtcagfDWQDfVStJgS72maoUNS9p20LmGaPzV WL0WwUwsQIq4SIh7g1soNjVGAs8zU4pTYH/QjTi/VUdUf8gqiUWxWkeapcm5bXYBJWlO /zGAFWgG3xhw6o155qMyEmrHLC/HnadDB//4Tuv5bu1yFxukA72xPYGnAJSu6OooToC+ jGzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx7si11052783edb.150.2020.07.05.02.20.18; Sun, 05 Jul 2020 02:20:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726795AbgGEJS0 (ORCPT + 99 others); Sun, 5 Jul 2020 05:18:26 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:47006 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbgGEJSY (ORCPT ); Sun, 5 Jul 2020 05:18:24 -0400 Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-01.qualcomm.com with ESMTP; 05 Jul 2020 02:18:23 -0700 Received: from sivaprak-linux.qualcomm.com ([10.201.3.202]) by ironmsg03-sd.qualcomm.com with ESMTP; 05 Jul 2020 02:18:17 -0700 Received: by sivaprak-linux.qualcomm.com (Postfix, from userid 459349) id F0F51213CC; Sun, 5 Jul 2020 14:48:09 +0530 (IST) From: Sivaprakash Murugesan To: agross@kernel.org, bjorn.andersson@linaro.org, bhelgaas@google.com, robh+dt@kernel.org, kishon@ti.com, vkoul@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, svarbanov@mm-sol.com, lorenzo.pieralisi@arm.com, p.zabel@pengutronix.de, sivaprak@codeaurora.org, mgautam@codeaurora.org, smuthayy@codeaurora.org, varada@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Cc: Selvam Sathappan Periakaruppan Subject: [PATCH 7/9] pci: dwc: qcom: do phy power on before pcie init Date: Sun, 5 Jul 2020 14:47:58 +0530 Message-Id: <1593940680-2363-8-git-send-email-sivaprak@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593940680-2363-1-git-send-email-sivaprak@codeaurora.org> References: <1593940680-2363-1-git-send-email-sivaprak@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit cc1e06f033af ("phy: qcom: qmp: Use power_on/off ops for PCIe") changed phy ops from init/deinit to power on/off, due to this phy enable is getting called after pcie init. On some platforms like ipq8074 phy should be inited before accessing the pcie register space, otherwise the system would hang. So move phy_power_on API before pcie init API. Fixes: commit cc1e06f033af ("phy: qcom: qmp: Use power_on/off ops for PCIe") Co-developed-by: Selvam Sathappan Periakaruppan Signed-off-by: Selvam Sathappan Periakaruppan Signed-off-by: Sivaprakash Murugesan --- drivers/pci/controller/dwc/pcie-qcom.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 138e1a2d21cc..aa52a2124760 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -1222,18 +1222,18 @@ static int qcom_pcie_host_init(struct pcie_port *pp) qcom_ep_reset_assert(pcie); - ret = pcie->ops->init(pcie); + ret = phy_power_on(pcie->phy); if (ret) return ret; - ret = phy_power_on(pcie->phy); + ret = pcie->ops->init(pcie); if (ret) - goto err_deinit; + goto err_disable_phy; if (pcie->ops->post_init) { ret = pcie->ops->post_init(pcie); if (ret) - goto err_disable_phy; + goto err_deinit; } dw_pcie_setup_rc(pp); @@ -1252,10 +1252,10 @@ static int qcom_pcie_host_init(struct pcie_port *pp) qcom_ep_reset_assert(pcie); if (pcie->ops->post_deinit) pcie->ops->post_deinit(pcie); -err_disable_phy: - phy_power_off(pcie->phy); err_deinit: pcie->ops->deinit(pcie); +err_disable_phy: + phy_power_off(pcie->phy); return ret; } -- 2.7.4