From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755317AbcKQSw7 (ORCPT ); Thu, 17 Nov 2016 13:52:59 -0500 Received: from terminus.zytor.com ([198.137.202.10]:59762 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754914AbcKQSw5 (ORCPT ); Thu, 17 Nov 2016 13:52:57 -0500 Date: Thu, 17 Nov 2016 10:51:59 -0800 From: tip-bot for Thomas Gleixner Message-ID: Cc: mingo@kernel.org, bigeasy@linutronix.de, hpa@zytor.com, bp@alien8.de, peterz@infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de Reply-To: linux-kernel@vger.kernel.org, tglx@linutronix.de, bp@alien8.de, hpa@zytor.com, bigeasy@linutronix.de, peterz@infradead.org, mingo@kernel.org In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] kernel/printk: Block cpuhotplug callback when tasks are frozen Git-Commit-ID: f97960fbddd98e1b7bfba469b8510b49a62b4bc5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f97960fbddd98e1b7bfba469b8510b49a62b4bc5 Gitweb: http://git.kernel.org/tip/f97960fbddd98e1b7bfba469b8510b49a62b4bc5 Author: Thomas Gleixner AuthorDate: Thu, 17 Nov 2016 17:31:55 +0100 Committer: Thomas Gleixner 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 Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1611171729320.3645@nanos Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior --- 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; }