scsi: ufs: core: Reduce the clock scaling latency
authorBart Van Assche <bvanassche@acm.org>
Thu, 8 Dec 2022 23:43:56 +0000 (15:43 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 30 Dec 2022 21:17:33 +0000 (21:17 +0000)
Wait at most 20 ms before rechecking the doorbells instead of waiting for a
potentially long time between doorbell checks.

Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c

index 2dbe249..b5d9088 100644 (file)
@@ -1154,7 +1154,7 @@ static int ufshcd_wait_for_doorbell_clr(struct ufs_hba *hba,
                }
 
                spin_unlock_irqrestore(hba->host->host_lock, flags);
-               schedule();
+               io_schedule_timeout(msecs_to_jiffies(20));
                if (ktime_to_us(ktime_sub(ktime_get(), start)) >
                    wait_timeout_us) {
                        timeout = true;