Skip to content

Commit 50183ac

Browse files
Ram Prakash Guptamartinkpetersen
authored andcommitted
scsi: ufs: core: Suspend clk scaling on no request
Currently UFS clk scaling is getting suspended only when the clks are scaled down. When high load is generated, a huge amount of latency is added due to scaling up the clk and completing the request post that. Suspending the scaling in its existing state when high load is generated improves the random performance KPI by 28%. So suspending the scaling when there are no requests. And the clk would be put in low scaled state when the actual request load is low. Make this change optional by having the check enabled using vops since for some devices suspending without bringing the clk in low scaled state might have impact on power consumption of the SoC. Signed-off-by: Ram Prakash Gupta <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent de24085 commit 50183ac

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,7 +1563,8 @@ static int ufshcd_devfreq_target(struct device *dev,
15631563
ktime_to_us(ktime_sub(ktime_get(), start)), ret);
15641564

15651565
out:
1566-
if (sched_clk_scaling_suspend_work && !scale_up)
1566+
if (sched_clk_scaling_suspend_work &&
1567+
(!scale_up || hba->clk_scaling.suspend_on_no_request))
15671568
queue_work(hba->clk_scaling.workq,
15681569
&hba->clk_scaling.suspend_work);
15691570

include/ufs/ufshcd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ struct ufs_clk_scaling {
459459
bool is_initialized;
460460
bool is_busy_started;
461461
bool is_suspended;
462+
bool suspend_on_no_request;
462463
};
463464

464465
#define UFS_EVENT_HIST_LENGTH 8

0 commit comments

Comments
 (0)