[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <knlhbl3mwo3b7xc4rjp4y7yka2nwythumjacmvn236v72ykddo@r3cp2w4uomol>
Date: Wed, 21 May 2025 14:57:31 +0100
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Nitin Rawat <quic_nitirawa@...cinc.com>
Cc: vkoul@...nel.org, kishon@...nel.org,
James.Bottomley@...senpartnership.com, martin.petersen@...cle.com, bvanassche@....org,
andersson@...nel.org, neil.armstrong@...aro.org, dmitry.baryshkov@....qualcomm.com,
konrad.dybcio@....qualcomm.com, quic_rdwivedi@...cinc.com, quic_cang@...cinc.com,
linux-arm-msm@...r.kernel.org, linux-phy@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org
Subject: Re: [PATCH V5 09/11] scsi: ufs: qcom : Refactor phy_power_on/off
calls
On Thu, May 15, 2025 at 09:57:20PM +0530, Nitin Rawat wrote:
> Commit 3f6d1767b1a0 ("phy: ufs-qcom: Refactor all init steps into
> phy_poweron") removes the phy_power_on/off from ufs_qcom_setup_clocks
s/removes/moved
> to suspend/resume func.
>
> To have a better power saving, remove the phy_power_on/off calls from
> resume/suspend path and put them back to ufs_qcom_setup_clocks, so that
> PHY regulators & clks can be turned on/off along with UFS's clocks.
>
> Since phy phy_power_on is separated out from phy calibrate, make
> separate calls to phy_power_on and phy_calibrate calls from ufs qcom
> driver.
>
This patch is not calling phy_calibrate().
> Co-developed-by: Can Guo <quic_cang@...cinc.com>
> Signed-off-by: Can Guo <quic_cang@...cinc.com>
> Signed-off-by: Nitin Rawat <quic_nitirawa@...cinc.com>
> ---
> drivers/ufs/host/ufs-qcom.c | 61 ++++++++++++++++++-------------------
> 1 file changed, 29 insertions(+), 32 deletions(-)
>
[...]
> static int ufs_qcom_setup_clocks(struct ufs_hba *hba, bool on,
> enum ufs_notify_change_status status)
> {
> struct ufs_qcom_host *host = ufshcd_get_variant(hba);
> + struct phy *phy = host->generic_phy;
> + int err;
>
> /*
> * In case ufs_qcom_init() is not yet done, simply ignore.
> @@ -1157,10 +1141,22 @@ static int ufs_qcom_setup_clocks(struct ufs_hba *hba, bool on,
> /* disable device ref_clk */
> ufs_qcom_dev_ref_clk_ctrl(host, false);
> }
> +
> + err = phy_power_off(phy);
> + if (err) {
> + dev_err(hba->dev, "phy power off failed, ret=%d\n", err);
> + return err;
> + }
> }
> break;
> case POST_CHANGE:
> if (on) {
> + err = phy_power_on(phy);
> + if (err) {
> + dev_err(hba->dev, "phy power on failed, ret = %d\n", err);
> + return err;
> + }
> +
> /* enable the device ref clock for HS mode*/
> if (ufshcd_is_hs_mode(&hba->pwr_info))
> ufs_qcom_dev_ref_clk_ctrl(host, true);
> @@ -1343,9 +1339,10 @@ static int ufs_qcom_init(struct ufs_hba *hba)
> static void ufs_qcom_exit(struct ufs_hba *hba)
> {
> struct ufs_qcom_host *host = ufshcd_get_variant(hba);
> + struct phy *phy = host->generic_phy;
>
> ufs_qcom_disable_lane_clks(host);
> - phy_power_off(host->generic_phy);
> + phy_power_off(phy);
This change is not at all needed.
- Mani
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists