All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Thomas Gleixner <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, bigeasy@linutronix.de, hpa@zytor.com,
	bp@alien8.de, peterz@infradead.org, linux-kernel@vger.kernel.org,
	tglx@linutronix.de
Subject: [tip:smp/hotplug] kernel/printk: Block cpuhotplug callback when tasks are frozen
Date: Thu, 17 Nov 2016 10:51:59 -0800	[thread overview]
Message-ID: <tip-f97960fbddd98e1b7bfba469b8510b49a62b4bc5@git.kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.20.1611171729320.3645@nanos>

Commit-ID:  f97960fbddd98e1b7bfba469b8510b49a62b4bc5
Gitweb:     http://git.kernel.org/tip/f97960fbddd98e1b7bfba469b8510b49a62b4bc5
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Thu, 17 Nov 2016 17:31:55 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 17 Nov 2016 19:44:58 +0100

kernel/printk: Block cpuhotplug callback when tasks are frozen

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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 4487ffc..37893da 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -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;
 }
 

      parent reply	other threads:[~2016-11-17 18:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 12:43 lockdep splat during suspend Borislav Petkov
2016-11-17 16:29 ` Sebastian Andrzej Siewior
2016-11-17 16:31   ` Thomas Gleixner
2016-11-17 17:04     ` Borislav Petkov
2016-11-17 18:51     ` tip-bot for Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-f97960fbddd98e1b7bfba469b8510b49a62b4bc5@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bigeasy@linutronix.de \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.