Skip to content

Commit

Permalink
clockevents: enforce reprogram in oneshot setup
Browse files Browse the repository at this point in the history
In tick_oneshot_setup we program the device to the given next_event,
but we do not check the return value. We need to make sure that the
device is programmed enforced so the interrupt handler engine starts
working. Split out the reprogramming function from tick_program_event()
and call it with the device, which was handed in to tick_setup_oneshot().
Set the force argument, so the devices is firing an interrupt.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Thomas Gleixner committed Sep 5, 2008
1 parent d4496b3 commit 7205656
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions kernel/time/tick-oneshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#include "tick-internal.h"

/**
* tick_program_event
* tick_program_event internal worker function
*/
int tick_program_event(ktime_t expires, int force)
static int __tick_program_event(struct clock_event_device *dev,
ktime_t expires, int force)
{
struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;
ktime_t now = ktime_get();

while (1) {
Expand All @@ -40,6 +40,16 @@ int tick_program_event(ktime_t expires, int force)
}
}

/**
* tick_program_event
*/
int tick_program_event(ktime_t expires, int force)
{
struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;

return __tick_program_event(dev, expires, force);
}

/**
* tick_resume_onshot - resume oneshot mode
*/
Expand All @@ -61,7 +71,7 @@ void tick_setup_oneshot(struct clock_event_device *newdev,
{
newdev->event_handler = handler;
clockevents_set_mode(newdev, CLOCK_EVT_MODE_ONESHOT);
clockevents_program_event(newdev, next_event, ktime_get());
__tick_program_event(newdev, next_event, 1);
}

/**
Expand Down

0 comments on commit 7205656

Please sign in to comment.