From: Avri Altman <Avri.Altman@wdc.com>
To: Can Guo <cang@codeaurora.org>,
"asutoshd@codeaurora.org" <asutoshd@codeaurora.org>,
"nguyenb@codeaurora.org" <nguyenb@codeaurora.org>,
"hongwus@codeaurora.org" <hongwus@codeaurora.org>,
"rnayak@codeaurora.org" <rnayak@codeaurora.org>,
"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>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Bean Huo <beanhuo@micron.com>,
Stanley Chu <stanley.chu@mediatek.com>,
Bart Van Assche <bvanassche@acm.org>,
Venkat Gopalakrishnan <venkatg@codeaurora.org>,
Tomas Winkler <tomas.winkler@intel.com>,
open list <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v1 1/2] scsi: ufs: Use ufshcd_config_pwr_mode() when scale gear
Date: Wed, 12 Feb 2020 12:21:43 +0000 [thread overview]
Message-ID: <MN2PR04MB6991136AD340D28D930F27F3FC1B0@MN2PR04MB6991.namprd04.prod.outlook.com> (raw)
In-Reply-To: <1581485910-8307-2-git-send-email-cang@codeaurora.org>
Hi,
>
> When scale gear, use ufshcd_config_pwr_mode() instead of
> ufshcd_change_power_mode() so that
> vops_pwr_change_notify(PRE_CHANGE)
> can be utilized to allow vendors use customized settings before change
> the power mode.
>
> Signed-off-by: Can Guo <cang@codeaurora.org>
> ---
> drivers/scsi/ufs/ufshcd.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index adcce41..67bd4f2 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -1059,8 +1059,7 @@ static int ufshcd_scale_gear(struct ufs_hba *hba,
> bool scale_up)
> }
>
> /* check if the power mode needs to be changed or not? */
> - ret = ufshcd_change_power_mode(hba, &new_pwr_info);
> -
> + ret = ufshcd_config_pwr_mode(hba, &new_pwr_info);
You might want to inform ufshcd_config_pwr_mode() of the caller,
As now it will be called much more frequently, and you want/don't want
To call your vops on probe but not on scale_gear?
Also, Alim exported ufshcd_config_pwr_mode a while ago,
In commit 0d846e703dc8 "scsi: ufs: make ufshcd_config_pwr_mode of non-static func"),
But nobody uses it outside ufshcd - so maybe revert this commit as part of this series?
> if (ret)
> dev_err(hba->dev, "%s: failed err %d, old gear: (tx %d rx %d), new
> gear: (tx %d rx %d)",
> __func__, ret,
> @@ -4126,8 +4125,6 @@ int ufshcd_config_pwr_mode(struct ufs_hba *hba,
> memcpy(&final_params, desired_pwr_mode, sizeof(final_params));
>
> ret = ufshcd_change_power_mode(hba, &final_params);
> - if (!ret)
> - ufshcd_print_pwr_info(hba);
>
> return ret;
> }
> @@ -7157,6 +7154,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba,
> bool async)
> __func__, ret);
> goto out;
> }
> + ufshcd_print_pwr_info(hba);
> }
>
> /* set the state as operational after switching to desired gear */
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
> Forum,
> a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2020-02-12 12:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1581485910-8307-1-git-send-email-cang@codeaurora.org>
2020-02-12 5:38 ` [PATCH v1 1/2] scsi: ufs: Use ufshcd_config_pwr_mode() when scale gear Can Guo
2020-02-12 12:21 ` Avri Altman [this message]
2020-02-13 2:53 ` Can Guo
2020-02-13 7:20 ` Avri Altman
2020-02-13 7:54 ` Stanley Chu
2020-02-12 5:38 ` [PATCH v1 2/2] scsi: ufs: Select INITIAL ADAPT type for HS Gear4 Can Guo
2020-02-12 12:26 ` Avri Altman
2020-02-12 17:04 ` asutoshd
2020-02-13 0:36 ` Martin K. Petersen
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=MN2PR04MB6991136AD340D28D930F27F3FC1B0@MN2PR04MB6991.namprd04.prod.outlook.com \
--to=avri.altman@wdc.com \
--cc=alim.akhtar@samsung.com \
--cc=asutoshd@codeaurora.org \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=cang@codeaurora.org \
--cc=hongwus@codeaurora.org \
--cc=jejb@linux.ibm.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=nguyenb@codeaurora.org \
--cc=rnayak@codeaurora.org \
--cc=salyzyn@google.com \
--cc=saravanak@google.com \
--cc=stanley.chu@mediatek.com \
--cc=tomas.winkler@intel.com \
--cc=venkatg@codeaurora.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).