diff mbox

PM / sleep: console flush during suspend if no_console_suspend enabled

Message ID 1450679500-6185-1-git-send-email-bbasu@nvidia.com (mailing list archive)
State Deferred
Delegated to: Rafael Wysocki
Headers show

Commit Message

Bibek Basu Dec. 21, 2015, 6:31 a.m. UTC
On multicore CPUs, sometimes debug console logs are not flushed
if you have VT consoles also enabled. Reason being console_lock
is taken by secondary/nonboot cpus which are  disabled as part
of suspend.This patch flushes the console before disabling
nonboot cpus

Signed-off-by: Bibek Basu <bbasu@nvidia.com>
---
 kernel/power/suspend.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Pavel Machek Feb. 20, 2016, 5:43 p.m. UTC | #1
On Mon 2015-12-21 12:01:40, Bibek Basu wrote:
> On multicore CPUs, sometimes debug console logs are not flushed
> if you have VT consoles also enabled. Reason being console_lock
> is taken by secondary/nonboot cpus which are  disabled as part
> of suspend.This patch flushes the console before disabling
> nonboot cpus
> 
> Signed-off-by: Bibek Basu <bbasu@nvidia.com>

Acked-by: Pavel Machek <pavel@ucw.cz>
diff mbox

Patch

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index f9fe133..42c5912 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -352,6 +352,16 @@  static int suspend_enter(suspend_state_t state, bool *wakeup)
 		goto Platform_wake;
 	}
 
+	/*
+	 * Flush console buffer if console_suspend_enabled cleared.
+	 * This will enable console flush if console_lock is taken
+	 * by nonboot cpus which will soon be disabled below.
+	 */
+	if (!console_suspend_enabled) {
+		console_lock();
+		console_unlock();
+	}
+
 	error = disable_nonboot_cpus();
 	if (error || suspend_test(TEST_CPUS))
 		goto Enable_cpus;