scsi: ufs: core: Fix clk scaling to be conditional in reset and restore
authoranvithdosapati <anvithdosapati@google.com>
Mon, 16 Jun 2025 08:57:34 +0000 (08:57 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 20 Jun 2025 02:51:51 +0000 (22:51 -0400)
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>
drivers/ufs/core/ufshcd.c

index f62d89c8e58044db0a9cc5db6416fdfdcc0d2350..50adfb8b335bf48dee040e28d39099c6bbdcc508 100644 (file)
@@ -7807,7 +7807,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);