Skip to contentSkip to conversation

PM / sleep: console flush during suspend if no_console_suspend enabled

PATCH In review Bibek Basu 2 participants 2 messages Dec 21, 2015 – Feb 20, 2016

Subsystems (2)
lore
Share & tools
lore

Bibek Basu

author
#0 lore raw

PATCH 1/1 PM / sleep: console flush during suspend if no_console_suspend enabled

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

---
 kernel/power/suspend.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
kernel/power/suspend.c +10 -0
index f9fe133..42c5912 100644
@@ -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;
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Bibek Basu

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

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html