FROMGIT: tick/broadcast: Allow late registered device to enter oneshot mode
The broadcast device is switched to oneshot mode when the system switches
to oneshot mode. If a broadcast clock event device is registered after the
system switched to oneshot mode, it will stay in periodic mode forever.
Ensure that a late registered device which is selected as broadcast device
is initialized in oneshot mode when the system already uses oneshot mode.
[ tglx: Massage changelog ]
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210331083318.21794-1-jindong.yue@nxp.com
(cherry picked from commit 9c336c9935
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core)
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: If570b8d396f84add2266150bc85d5c82c45bcb0f
Bug: 185092876
This commit is contained in:
parent
5a1b7a90e9
commit
1e5b2db654
1 changed files with 14 additions and 2 deletions
|
|
@ -107,6 +107,19 @@ void tick_install_broadcast_device(struct clock_event_device *dev)
|
|||
tick_broadcast_device.evtdev = dev;
|
||||
if (!cpumask_empty(tick_broadcast_mask))
|
||||
tick_broadcast_start_periodic(dev);
|
||||
|
||||
if (!(dev->features & CLOCK_EVT_FEAT_ONESHOT))
|
||||
return;
|
||||
|
||||
/*
|
||||
* If the system already runs in oneshot mode, switch the newly
|
||||
* registered broadcast device to oneshot mode explicitly.
|
||||
*/
|
||||
if (tick_broadcast_oneshot_active()) {
|
||||
tick_broadcast_switch_to_oneshot();
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Inform all cpus about this. We might be in a situation
|
||||
* where we did not switch to oneshot mode because the per cpu
|
||||
|
|
@ -115,8 +128,7 @@ void tick_install_broadcast_device(struct clock_event_device *dev)
|
|||
* notification the systems stays stuck in periodic mode
|
||||
* forever.
|
||||
*/
|
||||
if (dev->features & CLOCK_EVT_FEAT_ONESHOT)
|
||||
tick_clock_notify();
|
||||
tick_clock_notify();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue