high-res timers: next_event calculation fix
PATCH 1/1 high-res timers: next_event calculation fix
Subject: [patch] high-res timers: next_event calculation fix
From: Ingo Molnar <[email protected]>
do not set expires_next to KTIME_MAX if a too short timeout is being set - this can result in the clock events device being shut down completely.
found via a stresstest on a C3-lapic-plagued laptop that did very short sleeps.
This bug could explain the 'Synaptics hang' that was reported.
Signed-off-by Ingo Molnar <[email protected]>
Signed-off-by Thomas Gleixner <[email protected]>
--- kernel/time/clockevents.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/time/clockevents.c +1 -3
@@ -510,10 +510,8 @@ int clockevents_set_next_event(ktime_t estruct clock_event_device *nextevt = devices->nextevt;int64_t delta =ktime_to_ns (ktime_sub (expires,ktime_get ())); -if (delta <=0 && !force) { - devices->expires_next.tv64 =KTIME_MAX ; +if (delta <=0 && !force)return -ETIME ; - } devices->expires_next = expires;