linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH -mm] Make it possible to disable serial console suspend
@ 2006-08-29 19:52 Rafael J. Wysocki
  2006-08-29 21:03 ` Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2006-08-29 19:52 UTC (permalink / raw)
  To: LKML; +Cc: linux-serial, Andrew Morton, Pavel Machek

Hack uart_suspend_port() and uart_resume_port() so that serial console ports
are not suspended if CONFIG_DISABLE_CONSOLE_SUSPEND is set.

This makes it possible to debug the suspend and resume routines of all device
drivers as well as the lowest-level swsusp code with the help of the serial
console.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/serial/serial_core.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+)

Index: linux-2.6.18-rc4-mm3/drivers/serial/serial_core.c
===================================================================
--- linux-2.6.18-rc4-mm3.orig/drivers/serial/serial_core.c
+++ linux-2.6.18-rc4-mm3/drivers/serial/serial_core.c
@@ -1930,6 +1930,13 @@ int uart_suspend_port(struct uart_driver
 
 	mutex_lock(&state->mutex);
 
+#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND
+	if (uart_console(port)) {
+		mutex_unlock(&state->mutex);
+		return 0;
+	}
+#endif
+
 	if (state->info && state->info->flags & UIF_INITIALIZED) {
 		const struct uart_ops *ops = port->ops;
 
@@ -1968,6 +1975,13 @@ int uart_resume_port(struct uart_driver 
 
 	mutex_lock(&state->mutex);
 
+#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND
+	if (uart_console(port)) {
+		mutex_unlock(&state->mutex);
+		return 0;
+	}
+#endif
+
 	uart_change_pm(state, 0);
 
 	/*

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

* Re: [RFC][PATCH -mm] Make it possible to disable serial console suspend
  2006-08-29 19:52 [RFC][PATCH -mm] Make it possible to disable serial console suspend Rafael J. Wysocki
@ 2006-08-29 21:03 ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2006-08-29 21:03 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: LKML, linux-serial, Andrew Morton

On Tue 2006-08-29 21:52:43, Rafael J. Wysocki wrote:
> Hack uart_suspend_port() and uart_resume_port() so that serial console ports
> are not suspended if CONFIG_DISABLE_CONSOLE_SUSPEND is set.
> 
> This makes it possible to debug the suspend and resume routines of all device
> drivers as well as the lowest-level swsusp code with the help of the serial
> console.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Looks good to me, ACK.

-- 
(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:[~2006-08-29 21:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-29 19:52 [RFC][PATCH -mm] Make it possible to disable serial console suspend Rafael J. Wysocki
2006-08-29 21:03 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).