From patchwork Tue Jun 2 11:53:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 199657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 774C9C433E1 for ; Tue, 2 Jun 2020 11:54:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C13B207D8 for ; Tue, 2 Jun 2020 11:54:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IF8EoKhE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727790AbgFBLyb (ORCPT ); Tue, 2 Jun 2020 07:54:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbgFBLy3 (ORCPT ); Tue, 2 Jun 2020 07:54:29 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0220C061A0E; Tue, 2 Jun 2020 04:54:29 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id g10so2627251wmh.4; Tue, 02 Jun 2020 04:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s9klwDUAQHUdrbunE/kS0tb+TnD6OrjCFpNB//xZIAs=; b=IF8EoKhEoV6G2tqq6uLVNzyik+LsxddjgENfK5q27xfR6rvBQ0AWqO0R51+rqquoh5 6UTt1ketVQz1Dy+lQdPNeyVdAxWo6kHAJdnfr43IP+93VwysWqQSmCsMqOjg/eC15j1y XDOh8aqzswhdiNHEB6/JXb7sBl9QUot8Lf8OpJMk5+PJF4tv8f6uDBAAfiJOyZxiY8T5 fXweBCzhyKpNVXp1zc/uddB3Mmhp9JyGP9P2MNdrfGR7CoXe25s/7dF/w3GqFnWGcYMc PFuZDy/qVlQEIdFOqTOzCjieEpge2RLlRMKDuNCZGIUxFVjQ8RHcR/jLGEJ12NSDSR2U Kozw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s9klwDUAQHUdrbunE/kS0tb+TnD6OrjCFpNB//xZIAs=; b=hnzwkDwa6AyW65W8tw5kAj5TwniC/uATLYRERHmBTX5R5C9AaaweyTMjHRs1mEudJv BncuR5D15F3J8TLojol9GBIih2CucilruXhz7+JEfIACFl6tqgr7MQBBNxy8K1QKiNem Yz6e7GuWvyZ1NtXa+/L8ndg7g3C9gJaXFANqzOfrFyHtiwGNq0wzq1R8kZLcXzGyoi+D vp59O7ATGMUkSpxgptVL++Uwiocey91O14afp9Z9Q7amf2rkHt0f5gTwm1uvctJ7nHC2 LRcVX9i1oYt+tljV0Xou0SD7s2eeUJ7tE8QqARpKDqV+GJ/ddB08VIrBNrsY0dAKYc2N T2xw== X-Gm-Message-State: AOAM531rTtBCY2G7CeyzXDS2T4m2POg33SeXyM+b3O+8H7UfAQoiq22J TdB9LP8J3SkK9IzVjUsahLs= X-Google-Smtp-Source: ABdhPJznN0h7KwcJtw/jowMO0Vfn2BJVS4GYS2C93zi1okD4NPM2j9RfwMPJWBRUshgfb1Yo9mNZYA== X-Received: by 2002:a7b:c0d9:: with SMTP id s25mr4037720wmh.175.1591098868301; Tue, 02 Jun 2020 04:54:28 -0700 (PDT) Received: from Ansuel-XPS.localdomain (host9-254-dynamic.3-87-r.retail.telecomitalia.it. [87.3.254.9]) by smtp.googlemail.com with ESMTPSA id b18sm3273777wrn.88.2020.06.02.04.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 04:54:27 -0700 (PDT) From: Ansuel Smith To: Rob Herring Cc: Abhishek Sahu , Ansuel Smith , Rob Herring , Andy Gross , Bjorn Andersson , Bjorn Helgaas , Mark Rutland , Stanimir Varbanov , Lorenzo Pieralisi , Andrew Murray , Philipp Zabel , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 03/11] PCI: qcom: Change duplicate PCI reset to phy reset Date: Tue, 2 Jun 2020 13:53:44 +0200 Message-Id: <20200602115353.20143-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200602115353.20143-1-ansuelsmth@gmail.com> References: <20200602115353.20143-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Abhishek Sahu The deinit issues reset_control_assert for PCI twice and does not contain phy reset. Signed-off-by: Abhishek Sahu Signed-off-by: Ansuel Smith Reviewed-by: Rob Herring --- drivers/pci/controller/dwc/pcie-qcom.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 4bf93ab8c7a7..4512c2c5f61c 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -280,14 +280,14 @@ static void qcom_pcie_deinit_2_1_0(struct qcom_pcie *pcie) { struct qcom_pcie_resources_2_1_0 *res = &pcie->res.v2_1_0; + clk_disable_unprepare(res->phy_clk); reset_control_assert(res->pci_reset); reset_control_assert(res->axi_reset); reset_control_assert(res->ahb_reset); reset_control_assert(res->por_reset); - reset_control_assert(res->pci_reset); + reset_control_assert(res->phy_reset); clk_disable_unprepare(res->iface_clk); clk_disable_unprepare(res->core_clk); - clk_disable_unprepare(res->phy_clk); clk_disable_unprepare(res->aux_clk); clk_disable_unprepare(res->ref_clk); regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); @@ -325,12 +325,6 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie) goto err_clk_core; } - ret = clk_prepare_enable(res->phy_clk); - if (ret) { - dev_err(dev, "cannot prepare/enable phy clock\n"); - goto err_clk_phy; - } - ret = clk_prepare_enable(res->aux_clk); if (ret) { dev_err(dev, "cannot prepare/enable aux clock\n"); @@ -383,6 +377,12 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie) return ret; } + ret = clk_prepare_enable(res->phy_clk); + if (ret) { + dev_err(dev, "cannot prepare/enable phy clock\n"); + goto err_deassert_ahb; + } + /* wait for clock acquisition */ usleep_range(1000, 1500); @@ -400,8 +400,6 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie) err_clk_ref: clk_disable_unprepare(res->aux_clk); err_clk_aux: - clk_disable_unprepare(res->phy_clk); -err_clk_phy: clk_disable_unprepare(res->core_clk); err_clk_core: clk_disable_unprepare(res->iface_clk);