diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-08-23 09:29:43 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-09-08 05:10:56 -0400 |
commit | 65516f8a7c2028381f0dae4c16ddb621c96158cc (patch) | |
tree | 1f6192832c77e25499331b074398e165c1220197 /kernel/time | |
parent | d1748302f70be7469809809283fe164156a34231 (diff) |
clockevents: Add direct ktime programming function
There is at least one architecture (s390) with a sane clockevent device
that can be programmed with the equivalent of a ktime. No need to create
a delta against the current time, the ktime can be used directly.
A new clock device function 'set_next_ktime' is introduced that is called
with the unmodified ktime for the timer if the clock event device has the
CLOCK_EVT_FEAT_KTIME bit set.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: john stultz <johnstul@us.ibm.com>
Link: http://lkml.kernel.org/r/20110823133142.815350967@de.ibm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/clockevents.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 713ef94eceef..1ecd6ba36d6c 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
@@ -216,6 +216,10 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires, | |||
216 | if (dev->mode == CLOCK_EVT_MODE_SHUTDOWN) | 216 | if (dev->mode == CLOCK_EVT_MODE_SHUTDOWN) |
217 | return 0; | 217 | return 0; |
218 | 218 | ||
219 | /* Shortcut for clockevent devices that can deal with ktime. */ | ||
220 | if (dev->features & CLOCK_EVT_FEAT_KTIME) | ||
221 | return dev->set_next_ktime(expires, dev); | ||
222 | |||
219 | delta = ktime_to_ns(ktime_sub(expires, ktime_get())); | 223 | delta = ktime_to_ns(ktime_sub(expires, ktime_get())); |
220 | if (delta <= 0) | 224 | if (delta <= 0) |
221 | return force ? clockevents_program_min_delta(dev) : -ETIME; | 225 | return force ? clockevents_program_min_delta(dev) : -ETIME; |