aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/tick-broadcast.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-09-03 17:37:14 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-09-05 05:11:53 -0400
commit1fb9b7d29d8e85ba3196eaa7ab871bf76fc98d36 (patch)
tree1fbefa54e16e76f76616202d8abf9607725afeff /kernel/time/tick-broadcast.c
parent9c17bcda991000351cb2373f78be7e4b1c44caa3 (diff)
clockevents: prevent endless loop lockup
The C1E/HPET bug reports on AMDX2/RS690 systems where tracked down to a too small value of the HPET minumum delta for programming an event. The clockevents code needs to enforce an interrupt event on the clock event device in some cases. The enforcement code was stupid and naive, as it just added the minimum delta to the current time and tried to reprogram the device. When the minimum delta is too small, then this loops forever. Add a sanity check. Allow reprogramming to fail 3 times, then print a warning and double the minimum delta value to make sure, that this does not happen again. Use the same function for both tick-oneshot and tick-broadcast code. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/time/tick-broadcast.c')
-rw-r--r--kernel/time/tick-broadcast.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 5744f40b2697..2bc1f046151c 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -372,16 +372,8 @@ cpumask_t *tick_get_broadcast_oneshot_mask(void)
372static int tick_broadcast_set_event(ktime_t expires, int force) 372static int tick_broadcast_set_event(ktime_t expires, int force)
373{ 373{
374 struct clock_event_device *bc = tick_broadcast_device.evtdev; 374 struct clock_event_device *bc = tick_broadcast_device.evtdev;
375 ktime_t now = ktime_get(); 375
376 int res; 376 return tick_dev_program_event(bc, expires, force);
377
378 for(;;) {
379 res = clockevents_program_event(bc, expires, now);
380 if (!res || !force)
381 return res;
382 now = ktime_get();
383 expires = ktime_add(now, ktime_set(0, bc->min_delta_ns));
384 }
385} 377}
386 378
387int tick_resume_broadcast_oneshot(struct clock_event_device *bc) 379int tick_resume_broadcast_oneshot(struct clock_event_device *bc)