From: "Asutosh Das (asd)" <asutoshd@codeaurora.org>
To: Pedro Sousa <PedroM.Sousa@synopsys.com>,
"cang@codeaurora.org" <cang@codeaurora.org>,
"rnayak@codeaurora.org" <rnayak@codeaurora.org>,
"vinholikatti@gmail.com" <vinholikatti@gmail.com>,
"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"kernel-team@android.com" <kernel-team@android.com>,
"saravanak@google.com" <saravanak@google.com>,
"salyzyn@google.com" <salyzyn@google.com>,
Andy Gross <agross@kernel.org>,
Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"open list:ARM/QUALCOMM SUPPORT" <linux-arm-msm@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] scsi: ufs-qcom: enter and exit hibern8 during clock scaling
Date: Wed, 20 May 2020 09:55:43 -0700 [thread overview]
Message-ID: <06fbd425-3815-690a-22bc-a362c5deca6d@codeaurora.org> (raw)
In-Reply-To: <MN2PR12MB31675521623C9AFEA87B6076CC740@MN2PR12MB3167.namprd12.prod.outlook.com>
Hi Pedro,
On 11/11/2019 7:54 AM, Pedro Sousa wrote:
> Hi Asutosh,
>
> Please check comments.
Sorry for missing out on this and thanks for your review.
>
> -----Original Message-----
> From: Asutosh Das <asutoshd@codeaurora.org>
> Sent: Wednesday, October 23, 2019 5:49 PM
> To: cang@codeaurora.org; rnayak@codeaurora.org; vinholikatti@gmail.com; jejb@linux.vnet.ibm.com; martin.petersen@oracle.com
> Cc: linux-scsi@vger.kernel.org; kernel-team@android.com; saravanak@google.com; salyzyn@google.com; Asutosh Das <asutoshd@codeaurora.org>; Andy Gross <agross@kernel.org>; Alim Akhtar <alim.akhtar@samsung.com>; Avri Altman <avri.altman@wdc.com>; Pedro Sousa <pedrom.sousa@synopsys.com>; James E.J. Bottomley <jejb@linux.ibm.com>; open list:ARM/QUALCOMM SUPPORT <linux-arm-msm@vger.kernel.org>; open list <linux-kernel@vger.kernel.org>
> Subject: [PATCH v3 2/2] scsi: ufs-qcom: enter and exit hibern8 during clock scaling
>
> Qualcomm controller needs to be in hibern8 before scaling clocks.
> This change puts the controller in hibern8 state before scaling
> and brings it out after scaling of clocks.
>
> Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
> ---
> drivers/scsi/ufs/ufs-qcom.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index a5b7148..55b1de5 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -1305,18 +1305,27 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba,
> int err = 0;
>
> if (status == PRE_CHANGE) {
> + err = ufshcd_uic_hibern8_enter(hba);
> + if (err)
> + return err;
> if (scale_up)
> err = ufs_qcom_clk_scale_up_pre_change(hba);
> else
> err = ufs_qcom_clk_scale_down_pre_change(hba);
> + if (err)
> + ufshcd_uic_hibern8_exit(hba);
> +
> } else {
> if (scale_up)
> err = ufs_qcom_clk_scale_up_post_change(hba);
> else
> err = ufs_qcom_clk_scale_down_post_change(hba);
>
> - if (err || !dev_req_params)
> +
> + if (err || !dev_req_params) {
> + ufshcd_uic_hibern8_exit(hba);
> goto out;
> + }
>
> ufs_qcom_cfg_timers(hba,
> dev_req_params->gear_rx,
> @@ -1324,6 +1333,7 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba,
> dev_req_params->hs_rate,
> false);
> ufs_qcom_update_bus_bw_vote(host);
> + ufshcd_uic_hibern8_exit(hba);
>
> Here you are creating the possibility of returning a success even if hibern8 exit fails.
> If hibern8 exit fails the ufs recovery will be triggered and "err" variable will not get updated
> in this function, how is this handled? Did you tested this possibility?
>
> }
>
> out:
>
Yes - I agree with your comment. The error should be propagated from
this function correctly to the caller. I'll push another version.
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project
next prev parent reply other threads:[~2020-05-20 16:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-23 16:49 [PATCH v3 1/2] scsi: ufs: export hibern8 entry and exit Asutosh Das
2019-10-23 16:49 ` [PATCH v3 2/2] scsi: ufs-qcom: enter and exit hibern8 during clock scaling Asutosh Das
2019-11-11 15:54 ` Pedro Sousa
2020-05-20 16:55 ` Asutosh Das (asd) [this message]
2019-11-11 15:27 ` [PATCH v3 1/2] scsi: ufs: export hibern8 entry and exit Pedro Sousa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=06fbd425-3815-690a-22bc-a362c5deca6d@codeaurora.org \
--to=asutoshd@codeaurora.org \
--cc=PedroM.Sousa@synopsys.com \
--cc=agross@kernel.org \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=cang@codeaurora.org \
--cc=jejb@linux.ibm.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=kernel-team@android.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=rnayak@codeaurora.org \
--cc=salyzyn@google.com \
--cc=saravanak@google.com \
--cc=vinholikatti@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.