Commit a094f7c2 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Lee Jones
Browse files

UPSTREAM: 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.

Bug: 254441685
Link: https://lore.kernel.org/r/20211018132022.2281589-1-arnd@kernel.org


Fixes: 9561f584 ("scsi: ufs: mediatek: Support vops pre suspend to disable auto-hibern8")
Reviewed-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit bb4a8dcb)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I59db02acfe58c008e6bcb52ac24a31d8e1dc2b15
parent 9fe6ac18
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment