diff --git a/common/clock.c b/common/clock.c index 8adbeaf..9c7c1ba 100644 --- a/common/clock.c +++ b/common/clock.c @@ -135,15 +135,21 @@ return (uint32_t)tmp; } +int is_timeout_non_interruptible(uint64_t start_ns, uint64_t time_offset_ns) +{ + if ((int64_t)(start_ns + time_offset_ns - get_time_ns()) < 0) + return 1; + else + return 0; +} +EXPORT_SYMBOL(is_timeout_non_interruptible); + int is_timeout(uint64_t start_ns, uint64_t time_offset_ns) { if (time_offset_ns >= 100 * USECOND) poller_call(); - if ((int64_t)(start_ns + time_offset_ns - get_time_ns()) < 0) - return 1; - else - return 0; + return is_timeout_non_interruptible(start_ns, time_offset_ns); } EXPORT_SYMBOL(is_timeout); @@ -151,7 +157,7 @@ { uint64_t start = get_time_ns(); - while(!is_timeout(start, nsecs)); + while(!is_timeout_non_interruptible(start, nsecs)); } EXPORT_SYMBOL(ndelay); diff --git a/include/clock.h b/include/clock.h index c01a8d0..a169790 100644 --- a/include/clock.h +++ b/include/clock.h @@ -32,6 +32,7 @@ uint32_t clocksource_hz2mult(uint32_t hz, uint32_t shift_constant); int is_timeout(uint64_t start_ns, uint64_t time_offset_ns); +int is_timeout_non_interruptible(uint64_t start_ns, uint64_t time_offset_ns); // void udelay(unsigned long usecs);