scsi: ufs: change msleep to usleep_range
authorBean Huo <beanhuo@micron.com>
Mon, 15 Jul 2019 11:21:10 +0000 (11:21 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 22 Jul 2019 20:44:07 +0000 (16:44 -0400)
commit838c1efc6a0adbf44d16e4714f43443db598cdb5
tree4632217a28e364d886926835759c10d9a33a6a4a
parent70a51d8c53176080e82b2aef050f820ccdd4b3f8
scsi: ufs: change msleep to usleep_range

This patch is to change msleep() to usleep_range() based on
Documentation/timers/timers-howto.txt. It suggests using usleep_range()
for small msec(1ms - 20ms) since msleep() will often sleep longer than
desired value.

After changing, booting time will be 5ms-10ms faster than before.  I
tested this change on two different platforms, one has 5ms faster, another
one is about 10ms. I think this is different on different platform.

Actually, from UFS host side, 1ms-5ms delay is already sufficient for its
initialization of the local UIC layer.

Fixes: 7a3e97b0dc4b ([SCSI] ufshcd: UFS Host controller driver)
Signed-off-by: Bean Huo <beanhuo@micron.com>
Acked-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c