Skip to contentSkip to conversation

scsi: ufs: core: Fix clk scaling to be conditional in reset and restore

PATCH In review Anvith Dosapati 2 participants 2 messages Jun 16, 2025 – Jun 18, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scsi: ufs: core: Fix clk scaling to be conditional in reset and restore

From: anvithdosapati <[email protected]>

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.

Fixes a3cd5ec55f6c7 ("scsi: ufs: add load based scaling of UFS gear")

---
v2:
- Update commit message
- Add Fixes and Cc stable

 drivers/ufs/core/ufshcd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd.c +2 -1
index 4410e7d93b7d..fac381ea2b3a 100644
@@ -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);
 
Signature · 1 line
2.50.0.rc1.591.g9c95f17f64-goog
reviewer Reviewed-by on v2 1/1
#1 lore raw
Quoted 22 lines · Anvith Dosapati

From: anvithdosapati <[email protected]>

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.

Fixes a3cd5ec55f6c7 ("scsi: ufs: add load based scaling of UFS gear")

---
v2:
- Update commit message
- Add Fixes and Cc stable

  drivers/ufs/core/ufshcd.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ufs/core/ufshcd.c +0 -0
index 4410e7d93b7d..fac381ea2b3a 100644

drivers/ufs/core/ufshcd.c static int ufshcd_host_reset_and_restore(struct ufs_hba *hba) · line 7809

Quoted 9 lines
drivers/ufs/core/ufshcd.c +2 -1
@@ -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);