Skip to content

Commit c600102

Browse files
Asutosh Dasmartinkpetersen
authored andcommitted
scsi: ufs: mcq: Use active_reqs to check busy in clock scaling
Multi Circular Queue doesn't use outstanding_reqs. However, the UFS clock scaling functions use outstanding_reqs to determine if there are requests pending. When MCQ is enabled, this check always returns false. Hence use active_reqs to check if there are pending requests. Fixes: eacb139 ("scsi: ufs: core: mcq: Enable multi-circular queue") Signed-off-by: Asutosh Das <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/a24e0d646aac70eae0fc5e05fac0c58bb7e6e680.1678317160.git.quic_asutoshd@quicinc.com Signed-off-by: Martin K. Petersen <[email protected]>
1 parent be03df3 commit c600102

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ static int ufshcd_devfreq_get_dev_status(struct device *dev,
15001500
scaling->window_start_t = curr_t;
15011501
scaling->tot_busy_t = 0;
15021502

1503-
if (hba->outstanding_reqs) {
1503+
if (scaling->active_reqs) {
15041504
scaling->busy_start_t = curr_t;
15051505
scaling->is_busy_started = true;
15061506
} else {
@@ -2118,7 +2118,7 @@ static void ufshcd_clk_scaling_update_busy(struct ufs_hba *hba)
21182118

21192119
spin_lock_irqsave(hba->host->host_lock, flags);
21202120
hba->clk_scaling.active_reqs--;
2121-
if (!hba->outstanding_reqs && scaling->is_busy_started) {
2121+
if (!scaling->active_reqs && scaling->is_busy_started) {
21222122
scaling->tot_busy_t += ktime_to_us(ktime_sub(ktime_get(),
21232123
scaling->busy_start_t));
21242124
scaling->busy_start_t = 0;

0 commit comments

Comments
 (0)