All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM / sleep: console flush during suspend if no_console_suspend enabled
@ 2015-12-21  6:31 Bibek Basu
  2016-02-20 17:43 ` Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: Bibek Basu @ 2015-12-21  6:31 UTC (permalink / raw)
  To: rjw, len.brown, pavel; +Cc: linux-pm, linux-kernel, bbasu

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(+)

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;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PM / sleep: console flush during suspend if no_console_suspend enabled
  2015-12-21  6:31 [PATCH] PM / sleep: console flush during suspend if no_console_suspend enabled Bibek Basu
@ 2016-02-20 17:43 ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2016-02-20 17:43 UTC (permalink / raw)
  To: Bibek Basu; +Cc: rjw, len.brown, linux-pm, linux-kernel

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>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-20 17:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-21  6:31 [PATCH] PM / sleep: console flush during suspend if no_console_suspend enabled Bibek Basu
2016-02-20 17:43 ` Pavel Machek

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.