]> git.karo-electronics.de Git - linux-beck.git/commitdiff
kernel/printk: Block cpuhotplug callback when tasks are frozen
authorThomas Gleixner <tglx@linutronix.de>
Thu, 17 Nov 2016 16:31:55 +0000 (17:31 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 17 Nov 2016 18:44:58 +0000 (19:44 +0100)
The recent conversion of the console hotplug notifier to the state machine
missed the fact, that the notifier only operated on the non frozen
transitions. As a consequence the console_lock/unlock() pair is also
invoked during suspend, which results in a lockdep warning.

Restore the previous state by making the lock/unlock conditional on
!tasks_frozen.

Fixes: 90b14889d2f9 ("kernel/printk: Convert to hotplug state machine")
Reported-and-tested-by: Borislav Petkov <bp@alien8.de>
Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1611171729320.3645@nanos
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
kernel/printk/printk.c

index 4487ffcd42d57ae6b47e10a08e140e54f18f1079..37893da9bae897a74dcac0317253f5a7de48b50f 100644 (file)
@@ -2194,8 +2194,10 @@ void resume_console(void)
  */
 static int console_cpu_notify(unsigned int cpu)
 {
-       console_lock();
-       console_unlock();
+       if (!cpuhp_tasks_frozen) {
+               console_lock();
+               console_unlock();
+       }
        return 0;
 }