From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 C1D7AC433DB for ; Fri, 8 Jan 2021 08:24:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7874323435 for ; Fri, 8 Jan 2021 08:24:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727760AbhAHIYG (ORCPT ); Fri, 8 Jan 2021 03:24:06 -0500 Received: from m43-15.mailgun.net ([69.72.43.15]:26808 "EHLO m43-15.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727712AbhAHIYG (ORCPT ); Fri, 8 Jan 2021 03:24:06 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1610094225; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=sreoNIyJ/5cnElQ0k+QsFCG3nuSt8c81dyQkMmfUrmc=; b=kzHWML58ssT8uim+X2Eqnbc4yspZd1R0I5RlWN76BTiiX/K89ogBVtRx+uzboJFnlu5yR0KM 5uAvAYJuepGKPsUEubK/hjMdgoMYF7xf866uViqWWh+mxy2fQRBhF+l+PDeUkyYXokxkjNl1 vYDmLQtNcGapKWC7rr7B5n3ISeA= X-Mailgun-Sending-Ip: 69.72.43.15 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 5ff81674fc3778927e83d17b (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 08 Jan 2021 08:23:16 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 37F8DC4346A; Fri, 8 Jan 2021 08:23:16 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: cang) by smtp.codeaurora.org (Postfix) with ESMTPSA id A6601C433CA; Fri, 8 Jan 2021 08:23:09 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 08 Jan 2021 16:23:09 +0800 From: Can Guo To: Ziqi Chen Cc: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, rnayak@codeaurora.org, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, kwmad.kim@samsung.com, stanley.chu@mediatek.com, Alim Akhtar , Avri Altman , "James E.J. Bottomley" , Bean Huo , linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 1/2] scsi: ufs: Fix ufs clk specs violation In-Reply-To: <1610090885-50099-2-git-send-email-ziqichen@codeaurora.org> References: <1610090885-50099-1-git-send-email-ziqichen@codeaurora.org> <1610090885-50099-2-git-send-email-ziqichen@codeaurora.org> Message-ID: <56a0fd934614ed4feb476360f8b2c461@codeaurora.org> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-01-08 15:28, Ziqi Chen wrote: > As per specs, e.g, JESD220E chapter 7.2, while powering > off/on the ufs device, REF_CLK signal should be between > VSS(Ground) and VCCQ/VCCQ2. > > Signed-off-by: Ziqi Chen Reviewed-by: Can Guo > --- > drivers/scsi/ufs/ufshcd.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index e221add..3f807f7 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -8686,8 +8686,6 @@ static int ufshcd_suspend(struct ufs_hba *hba, > enum ufs_pm_op pm_op) > if (ret) > goto set_dev_active; > > - ufshcd_vreg_set_lpm(hba); > - > disable_clks: > /* > * Call vendor specific suspend callback. As these callbacks may > access > @@ -8711,6 +8709,8 @@ static int ufshcd_suspend(struct ufs_hba *hba, > enum ufs_pm_op pm_op) > hba->clk_gating.state); > } > > + ufshcd_vreg_set_lpm(hba); > + > /* Put the host controller in low power mode if possible */ > ufshcd_hba_vreg_set_lpm(hba); > goto out; > @@ -8778,18 +8778,18 @@ static int ufshcd_resume(struct ufs_hba *hba, > enum ufs_pm_op pm_op) > old_link_state = hba->uic_link_state; > > ufshcd_hba_vreg_set_hpm(hba); > + ret = ufshcd_vreg_set_hpm(hba); > + if (ret) > + goto out; > + > /* Make sure clocks are enabled before accessing controller */ > ret = ufshcd_setup_clocks(hba, true); > if (ret) > - goto out; > + goto disable_vreg; > > /* enable the host irq as host controller would be active soon */ > ufshcd_enable_irq(hba); > > - ret = ufshcd_vreg_set_hpm(hba); > - if (ret) > - goto disable_irq_and_vops_clks; > - > /* > * Call vendor specific resume callback. As these callbacks may > access > * vendor specific host controller register space call them when the > @@ -8797,7 +8797,7 @@ static int ufshcd_resume(struct ufs_hba *hba, > enum ufs_pm_op pm_op) > */ > ret = ufshcd_vops_resume(hba, pm_op); > if (ret) > - goto disable_vreg; > + goto disable_irq_and_vops_clks; > > /* For DeepSleep, the only supported option is to have the link off > */ > WARN_ON(ufshcd_is_ufs_dev_deepsleep(hba) && > !ufshcd_is_link_off(hba)); > @@ -8864,8 +8864,6 @@ static int ufshcd_resume(struct ufs_hba *hba, > enum ufs_pm_op pm_op) > ufshcd_link_state_transition(hba, old_link_state, 0); > vendor_suspend: > ufshcd_vops_suspend(hba, pm_op); > -disable_vreg: > - ufshcd_vreg_set_lpm(hba); > disable_irq_and_vops_clks: > ufshcd_disable_irq(hba); > if (hba->clk_scaling.is_allowed) > @@ -8876,6 +8874,8 @@ static int ufshcd_resume(struct ufs_hba *hba, > enum ufs_pm_op pm_op) > trace_ufshcd_clk_gating(dev_name(hba->dev), > hba->clk_gating.state); > } > +disable_vreg: > + ufshcd_vreg_set_lpm(hba); > out: > hba->pm_op_in_progress = 0; > if (ret)