* [PATCH v2] scsi: ufs: core: Fix clk scaling to be conditional in reset and restore
@ 2025-06-16 8:57 Anvith Dosapati
2025-06-18 15:41 ` Bart Van Assche
0 siblings, 1 reply; 2+ messages in thread
From: Anvith Dosapati @ 2025-06-16 8:57 UTC (permalink / raw)
To: Alim Akhtar, Avri Altman, Bart Van Assche
Cc: Manivannan Sadhasivam, Subhash Jadavani, linux-scsi,
linux-kernel, manugautam, vamshigajjela, anvithdosapati, stable
From: anvithdosapati <anvithdosapati@google.com>
In ufshcd_host_reset_and_restore, scale up clocks only when clock
scaling is supported. Without this change cpu latency is voted for 0
(ufshcd_pm_qos_update) during resume unconditionally.
Signed-off-by: anvithdosapati <anvithdosapati@google.com>
Fixes: a3cd5ec55f6c7 ("scsi: ufs: add load based scaling of UFS gear")
Cc: stable@vger.kernel.org
---
v2:
- Update commit message
- Add Fixes and Cc stable
drivers/ufs/core/ufshcd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 4410e7d93b7d..fac381ea2b3a 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -7802,7 +7802,8 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)
hba->silence_err_logs = false;
/* scale up clocks to max frequency before full reinitialization */
- ufshcd_scale_clks(hba, ULONG_MAX, true);
+ if (ufshcd_is_clkscaling_supported(hba))
+ ufshcd_scale_clks(hba, ULONG_MAX, true);
err = ufshcd_hba_enable(hba);
--
2.50.0.rc1.591.g9c95f17f64-goog
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v2] scsi: ufs: core: Fix clk scaling to be conditional in reset and restore
2025-06-16 8:57 [PATCH v2] scsi: ufs: core: Fix clk scaling to be conditional in reset and restore Anvith Dosapati
@ 2025-06-18 15:41 ` Bart Van Assche
0 siblings, 0 replies; 2+ messages in thread
From: Bart Van Assche @ 2025-06-18 15:41 UTC (permalink / raw)
To: Anvith Dosapati, Alim Akhtar, Avri Altman
Cc: Manivannan Sadhasivam, Subhash Jadavani, linux-scsi,
linux-kernel, manugautam, vamshigajjela, stable
On 6/16/25 1:57 AM, Anvith Dosapati wrote:
> From: anvithdosapati <anvithdosapati@google.com>
>
> In ufshcd_host_reset_and_restore, scale up clocks only when clock
> scaling is supported. Without this change cpu latency is voted for 0
> (ufshcd_pm_qos_update) during resume unconditionally.
>
> Signed-off-by: anvithdosapati <anvithdosapati@google.com>
> Fixes: a3cd5ec55f6c7 ("scsi: ufs: add load based scaling of UFS gear")
> Cc: stable@vger.kernel.org
> ---
> v2:
> - Update commit message
> - Add Fixes and Cc stable
>
> drivers/ufs/core/ufshcd.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 4410e7d93b7d..fac381ea2b3a 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -7802,7 +7802,8 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)
> hba->silence_err_logs = false;
>
> /* scale up clocks to max frequency before full reinitialization */
> - ufshcd_scale_clks(hba, ULONG_MAX, true);
> + if (ufshcd_is_clkscaling_supported(hba))
> + ufshcd_scale_clks(hba, ULONG_MAX, true);
>
> err = ufshcd_hba_enable(hba);
>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-18 15:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-16 8:57 [PATCH v2] scsi: ufs: core: Fix clk scaling to be conditional in reset and restore Anvith Dosapati
2025-06-18 15:41 ` Bart Van Assche
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®