From 0dc2fa215cbdf196d009c0c9eb66061acef0c642 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 22 Sep 2008 19:04:02 +0200 Subject: [PATCH] --- yaml --- r: 109979 b: refs/heads/master c: 27ce4cb4a0c7cf59b9a9952266883862f2e4c99f h: refs/heads/master i: 109977: 19c7dfccfdca174cc92f2b0d4ccede11b7480953 109975: 20da3b3ea9a87168abcf729b10dda021ab892f60 v: v3 --- [refs] | 2 +- trunk/kernel/time/tick-broadcast.c | 8 ++++++++ trunk/kernel/time/tick-common.c | 3 ++- trunk/kernel/time/tick-internal.h | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index ea18beecf580..c05d093e7946 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 302745699c1b675b5d2a1af87271de10e4d96b6a +refs/heads/master: 27ce4cb4a0c7cf59b9a9952266883862f2e4c99f diff --git a/trunk/kernel/time/tick-broadcast.c b/trunk/kernel/time/tick-broadcast.c index e2b66d1c8ca5..bd7034542399 100644 --- a/trunk/kernel/time/tick-broadcast.c +++ b/trunk/kernel/time/tick-broadcast.c @@ -575,4 +575,12 @@ void tick_shutdown_broadcast_oneshot(unsigned int *cpup) spin_unlock_irqrestore(&tick_broadcast_lock, flags); } +/* + * Check, whether the broadcast device is in one shot mode + */ +int tick_broadcast_oneshot_active(void) +{ + return tick_broadcast_device.mode == TICKDEV_MODE_ONESHOT; +} + #endif diff --git a/trunk/kernel/time/tick-common.c b/trunk/kernel/time/tick-common.c index b523d095decf..df12434b43ca 100644 --- a/trunk/kernel/time/tick-common.c +++ b/trunk/kernel/time/tick-common.c @@ -109,7 +109,8 @@ void tick_setup_periodic(struct clock_event_device *dev, int broadcast) if (!tick_device_is_functional(dev)) return; - if (dev->features & CLOCK_EVT_FEAT_PERIODIC) { + if ((dev->features & CLOCK_EVT_FEAT_PERIODIC) && + !tick_broadcast_oneshot_active()) { clockevents_set_mode(dev, CLOCK_EVT_MODE_PERIODIC); } else { unsigned long seq; diff --git a/trunk/kernel/time/tick-internal.h b/trunk/kernel/time/tick-internal.h index e18014fadf95..55c3f4be6077 100644 --- a/trunk/kernel/time/tick-internal.h +++ b/trunk/kernel/time/tick-internal.h @@ -35,6 +35,7 @@ extern void tick_broadcast_oneshot_control(unsigned long reason); extern void tick_broadcast_switch_to_oneshot(void); extern void tick_shutdown_broadcast_oneshot(unsigned int *cpup); extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc); +extern int tick_broadcast_oneshot_active(void); # else /* BROADCAST */ static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) { @@ -43,6 +44,7 @@ static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) static inline void tick_broadcast_oneshot_control(unsigned long reason) { } static inline void tick_broadcast_switch_to_oneshot(void) { } static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { } +static inline int tick_broadcast_oneshot_active(void) { return 0; } # endif /* !BROADCAST */ #else /* !ONESHOT */