Commit e5e57bd6 authored by Ingo Molnar's avatar Ingo Molnar Committed by Thomas Gleixner

timers: fix timer hotplug on -rt

Here we are in the CPU_DEAD notifier, and we must not sleep nor
enable interrupts.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent c90fc5b4
...@@ -1610,6 +1610,7 @@ static void __cpuinit migrate_timers(int cpu) ...@@ -1610,6 +1610,7 @@ static void __cpuinit migrate_timers(int cpu)
{ {
struct tvec_base *old_base; struct tvec_base *old_base;
struct tvec_base *new_base; struct tvec_base *new_base;
unsigned long flags;
int i; int i;
BUG_ON(cpu_online(cpu)); BUG_ON(cpu_online(cpu));
...@@ -1619,8 +1620,11 @@ static void __cpuinit migrate_timers(int cpu) ...@@ -1619,8 +1620,11 @@ static void __cpuinit migrate_timers(int cpu)
* The caller is globally serialized and nobody else * The caller is globally serialized and nobody else
* takes two locks at once, deadlock is not possible. * takes two locks at once, deadlock is not possible.
*/ */
spin_lock_irq(&new_base->lock); local_irq_save(flags);
spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING); while (!spin_trylock(&new_base->lock))
cpu_relax();
while (!spin_trylock(&old_base->lock))
cpu_relax();
BUG_ON(old_base->running_timer); BUG_ON(old_base->running_timer);
...@@ -1634,7 +1638,9 @@ static void __cpuinit migrate_timers(int cpu) ...@@ -1634,7 +1638,9 @@ static void __cpuinit migrate_timers(int cpu)
} }
spin_unlock(&old_base->lock); spin_unlock(&old_base->lock);
spin_unlock_irq(&new_base->lock); spin_unlock(&new_base->lock);
local_irq_restore(flags);
put_cpu_var(tvec_bases); put_cpu_var(tvec_bases);
} }
#endif /* CONFIG_HOTPLUG_CPU */ #endif /* CONFIG_HOTPLUG_CPU */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment