diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2013-04-17 13:26:06 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2013-04-17 15:30:56 -0400 |
commit | c038c1c44179c80da6201f91ef354e48d5689617 (patch) | |
tree | a1ee34eadd567393cbdb6632ad7b8abb4a2fc4ea | |
parent | b3956a896ea57f25cacd74708b8fab611543a81d (diff) |
clockevents: Switch into oneshot mode even if broadcast registered late
tick_oneshot_notify() is used to notify a particular CPU to try
to switch into oneshot mode after a oneshot capable tick device
is registered and tick_clock_notify() is used to notify all CPUs
to try to switch into oneshot mode after a high res clocksource
is registered. There is one caveat; if the tick devices suffer
from FEAT_C3_STOP we don't try to switch into oneshot mode unless
we have a oneshot capable broadcast device already registered.
If the broadcast device is registered after the tick devices that
have FEAT_C3_STOP we'll never try to switch into oneshot mode
again, causing us to be stuck in periodic mode forever. Avoid
this scenario by calling tick_clock_notify() after we register
the broadcast device so that we try to switch into oneshot mode
on all CPUs one more time.
[ tglx: Adopted to timers/core and added a comment ]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Link: http://lkml.kernel.org/r/1366219566-29783-1-git-send-email-sboyd@codeaurora.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | kernel/time/tick-broadcast.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index d76d816afc5d..f8d2109ef0a2 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c | |||
@@ -75,6 +75,16 @@ int tick_check_broadcast_device(struct clock_event_device *dev) | |||
75 | tick_broadcast_device.evtdev = dev; | 75 | tick_broadcast_device.evtdev = dev; |
76 | if (!cpumask_empty(tick_broadcast_mask)) | 76 | if (!cpumask_empty(tick_broadcast_mask)) |
77 | tick_broadcast_start_periodic(dev); | 77 | tick_broadcast_start_periodic(dev); |
78 | /* | ||
79 | * Inform all cpus about this. We might be in a situation | ||
80 | * where we did not switch to oneshot mode because the per cpu | ||
81 | * devices are affected by CLOCK_EVT_FEAT_C3STOP and the lack | ||
82 | * of a oneshot capable broadcast device. Without that | ||
83 | * notification the systems stays stuck in periodic mode | ||
84 | * forever. | ||
85 | */ | ||
86 | if (dev->features & CLOCK_EVT_FEAT_ONESHOT) | ||
87 | tick_clock_notify(); | ||
78 | return 1; | 88 | return 1; |
79 | } | 89 | } |
80 | 90 | ||