]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: ufs: mediatek: Avoid sched_clock() misuse
authorArnd Bergmann <arnd@arndb.de>
Mon, 18 Oct 2021 13:20:01 +0000 (15:20 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 21 Oct 2021 03:09:58 +0000 (23:09 -0400)
commit61081b94540a08f769dd74a3ce9ed46d66b1636f
treea7bd7a828350d7d4e9570c52172e728dc78db6d7
parent1eeb36d446cd13a991b405e3ae629ae1cc9ecd05
scsi: ufs: mediatek: Avoid sched_clock() misuse

sched_clock() is not meant to be used in portable driver code, and assuming
a particular clock frequency is not how this is meant to be used. It also
causes a build failure because of a missing header inclusion:

drivers/scsi/ufs/ufs-mediatek.c:321:12: error: implicit declaration of function 'sched_clock' [-Werror,-Wimplicit-function-declaration]
        timeout = sched_clock() + retry_ms * 1000000UL;

A better interface to use here ktime_get_mono_fast_ns(), which works mostly
like ktime_get() but is safe to use inside of a suspend callback.

Link: https://lore.kernel.org/r/20211018132022.2281589-1-arnd@kernel.org
Fixes: 951ee1a0d863 ("scsi: ufs: mediatek: Support vops pre suspend to disable auto-hibern8")
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufs-mediatek.c