printk: Fix scheduling-while-atomic problem in console_cpu_notify()
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 16 Oct 2012 04:35:59 +0000 (21:35 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 17 Oct 2012 01:17:44 +0000 (18:17 -0700)
The console_cpu_notify() function runs with interrupts disabled in the
CPU_DYING case.  It therefore cannot block, for example, as will happen
when it calls console_lock().  Therefore, remove the CPU_DYING leg of
the switch statement to avoid this problem.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/printk.c

index 66a2ea37b5763b450929a5f955e3bc81ad130a1c..2d607f4d1797cb02e0e4fb60453312a8d3491975 100644 (file)
@@ -1890,7 +1890,6 @@ static int __cpuinit console_cpu_notify(struct notifier_block *self,
        switch (action) {
        case CPU_ONLINE:
        case CPU_DEAD:
-       case CPU_DYING:
        case CPU_DOWN_FAILED:
        case CPU_UP_CANCELED:
                console_lock();