mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[PATCH] hrtimers: set correct initial expiry time for relative SIGEV_NONE timers
The expiry time for relative timers with SIGEV_NONE set was never updated to the correct value. Pointed out by George Anzinger. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
66188fae3b
commit
952bbc87f0
1 changed files with 6 additions and 1 deletions
|
@ -724,8 +724,13 @@ common_timer_set(struct k_itimer *timr, int flags,
|
||||||
timr->it.real.interval = timespec_to_ktime(new_setting->it_interval);
|
timr->it.real.interval = timespec_to_ktime(new_setting->it_interval);
|
||||||
|
|
||||||
/* SIGEV_NONE timers are not queued ! See common_timer_get */
|
/* SIGEV_NONE timers are not queued ! See common_timer_get */
|
||||||
if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE))
|
if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) {
|
||||||
|
/* Setup correct expiry time for relative timers */
|
||||||
|
if (mode == HRTIMER_REL)
|
||||||
|
timer->expires = ktime_add(timer->expires,
|
||||||
|
timer->base->get_time());
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
hrtimer_start(timer, timer->expires, mode);
|
hrtimer_start(timer, timer->expires, mode);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue