Skip to content

Commit

Permalink
scsi: ufs: core: Only suspend clock scaling if scaling down
Browse files Browse the repository at this point in the history
If clock scale up and suspend clock scaling, ufs will keep high
performance/power mode but no read/write requests on going.  It is logic
wrong and have power concern.

Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Link: https://lore.kernel.org/r/20230831130826.5592-2-peter.wang@mediatek.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Peter Wang authored and Martin K. Petersen committed Oct 13, 2023
1 parent b6f2e06 commit 1d96973
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ufs/core/ufshcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ static int ufshcd_devfreq_target(struct device *dev,
ktime_to_us(ktime_sub(ktime_get(), start)), ret);

out:
if (sched_clk_scaling_suspend_work)
if (sched_clk_scaling_suspend_work && !scale_up)
queue_work(hba->clk_scaling.workq,
&hba->clk_scaling.suspend_work);

Expand Down

0 comments on commit 1d96973

Please sign in to comment.