Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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>
Link: https://lore.kernel.org/r/20250616085734.2133581-1-anvithdosapati@google.com
Fixes: a3cd5ec55f6c ("scsi: ufs: add load based scaling of UFS gear")
Cc: stable@vger.kernel.org
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

anvithdosapati and committed by
Martin K. Petersen
2e083cd8 752eb816

+2 -1
+2 -1
drivers/ufs/core/ufshcd.c
··· 7807 7807 hba->silence_err_logs = false; 7808 7808 7809 7809 /* scale up clocks to max frequency before full reinitialization */ 7810 - ufshcd_scale_clks(hba, ULONG_MAX, true); 7810 + if (ufshcd_is_clkscaling_supported(hba)) 7811 + ufshcd_scale_clks(hba, ULONG_MAX, true); 7811 7812 7812 7813 err = ufshcd_hba_enable(hba); 7813 7814