diff mbox series

scsi: ufs: core: Do clk scaling conditionally in reset and restore

Message ID 20250613103140.1121621-1-anvithdosapati@google.com
State Superseded
Headers show
Series scsi: ufs: core: Do clk scaling conditionally in reset and restore | expand

Commit Message

Anvith Dosapati June 13, 2025, 10:31 a.m. UTC
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>
---
 drivers/ufs/core/ufshcd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Bart Van Assche June 13, 2025, 4:20 p.m. UTC | #1
On 6/13/25 3:31 AM, Anvith Dosapati wrote:
> 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.
Since this patch is a bug fix, please add "Cc: stable@vger.kernel.org"
and "Fixes:" tags. See also Documentation/process/stable-kernel-rules.rst
in the kernel tree.

Thanks,

Bart.
diff mbox series

Patch

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);