aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/tick-broadcast-hrtimer.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-04-11 22:27:19 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-11 22:27:19 -0400
commit39c853ebfe169f187a760b34f9cbf54751bfce00 (patch)
tree2a5a741d0cff7d4f90998b31b32ff80cfccd0369 /kernel/time/tick-broadcast-hrtimer.c
parentsg_start_req(): use import_iovec() (diff)
parentnew helper: msg_data_left() (diff)
downloadlinux-dev-39c853ebfe169f187a760b34f9cbf54751bfce00.tar.xz
linux-dev-39c853ebfe169f187a760b34f9cbf54751bfce00.zip
Merge branch 'for-davem' into for-next
Diffstat (limited to 'kernel/time/tick-broadcast-hrtimer.c')
-rw-r--r--kernel/time/tick-broadcast-hrtimer.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c
index eb682d5c697c..6aac4beedbbe 100644
--- a/kernel/time/tick-broadcast-hrtimer.c
+++ b/kernel/time/tick-broadcast-hrtimer.c
@@ -49,6 +49,7 @@ static void bc_set_mode(enum clock_event_mode mode,
*/
static int bc_set_next(ktime_t expires, struct clock_event_device *bc)
{
+ int bc_moved;
/*
* We try to cancel the timer first. If the callback is on
* flight on some other cpu then we let it handle it. If we
@@ -60,9 +61,15 @@ static int bc_set_next(ktime_t expires, struct clock_event_device *bc)
* restart the timer because we are in the callback, but we
* can set the expiry time and let the callback return
* HRTIMER_RESTART.
+ *
+ * Since we are in the idle loop at this point and because
+ * hrtimer_{start/cancel} functions call into tracing,
+ * calls to these functions must be bound within RCU_NONIDLE.
*/
- if (hrtimer_try_to_cancel(&bctimer) >= 0) {
- hrtimer_start(&bctimer, expires, HRTIMER_MODE_ABS_PINNED);
+ RCU_NONIDLE(bc_moved = (hrtimer_try_to_cancel(&bctimer) >= 0) ?
+ !hrtimer_start(&bctimer, expires, HRTIMER_MODE_ABS_PINNED) :
+ 0);
+ if (bc_moved) {
/* Bind the "device" to the cpu */
bc->bound_on = smp_processor_id();
} else if (bc->bound_on == smp_processor_id()) {