Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71115
b: refs/heads/master
c: 8f4ce8c
h: refs/heads/master
i:
  71113: 6daf578
  71111: e273976
v: v3
  • Loading branch information
Andres Salomon authored and Linus Torvalds committed Oct 18, 2007
1 parent e12090f commit 53f3368
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 438e2ce68dfd4af4cfcec2f873564fb921db4bb5
refs/heads/master: 8f4ce8c32f2dc2bc2411cafe39976fc5c0adfabf
10 changes: 10 additions & 0 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,16 @@ and is between 256 and 4096 characters. It is defined in the file
UART at the specified I/O port or MMIO address.
The options are the same as for ttyS, above.

no_console_suspend
[HW] Never suspend the console
Disable suspending of consoles during suspend and
hibernate operations. Once disabled, debugging
messages can reach various consoles while the rest
of the system is being put to sleep (ie, while
debugging driver suspend/resume hooks). This may
not work reliably with all consoles, but is known
to work with serial and VGA consoles.

cpcihp_generic= [HW,PCI] Generic port I/O CompactPCI driver
Format:
<first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
Expand Down
4 changes: 2 additions & 2 deletions trunk/Documentation/power/basic-pm-debugging.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ c) Advanced debugging
In case the STD does not work on your system even in the minimal configuration
and compiling more drivers as modules is not practical or some modules cannot
be unloaded, you can use one of the more advanced debugging techniques to find
the problem. First, if there is a serial port in your box, you can set the
CONFIG_DISABLE_CONSOLE_SUSPEND kernel configuration option and try to log kernel
the problem. First, if there is a serial port in your box, you can boot the
kernel with the 'no_console_suspend' parameter and try to log kernel
messages using the serial console. This may provide you with some information
about the reasons of the suspend (resume) failure. Alternatively, it may be
possible to use a FireWire port for debugging with firescope
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/powerpc/configs/pmac32_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ CONFIG_PM=y
# CONFIG_PM_LEGACY is not set
CONFIG_PM_DEBUG=y
# CONFIG_PM_VERBOSE is not set
# CONFIG_DISABLE_CONSOLE_SUSPEND is not set
CONFIG_PM_SLEEP=y
CONFIG_SUSPEND=y
CONFIG_HIBERNATION=y
Expand Down
10 changes: 4 additions & 6 deletions trunk/drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1959,12 +1959,11 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)

mutex_lock(&state->mutex);

#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND
if (uart_console(port)) {
if (!console_suspend_enabled && uart_console(port)) {
/* we're going to avoid suspending serial console */
mutex_unlock(&state->mutex);
return 0;
}
#endif

tty_dev = device_find_child(port->dev, &match, serial_match_port);
if (device_may_wakeup(tty_dev)) {
Expand Down Expand Up @@ -2016,12 +2015,11 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)

mutex_lock(&state->mutex);

#ifdef CONFIG_DISABLE_CONSOLE_SUSPEND
if (uart_console(port)) {
if (!console_suspend_enabled && uart_console(port)) {
/* no need to resume serial console, it wasn't suspended */
mutex_unlock(&state->mutex);
return 0;
}
#endif

if (!port->suspended) {
disable_irq_wake(port->irq);
Expand Down
7 changes: 2 additions & 5 deletions trunk/include/linux/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,11 @@ extern void console_stop(struct console *);
extern void console_start(struct console *);
extern int is_console_locked(void);

#ifndef CONFIG_DISABLE_CONSOLE_SUSPEND
extern int console_suspend_enabled;

/* Suspend and resume console messages over PM events */
extern void suspend_console(void);
extern void resume_console(void);
#else
static inline void suspend_console(void) {}
static inline void resume_console(void) {}
#endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */

int mda_console_init(void);
void prom_con_init(void);
Expand Down
11 changes: 0 additions & 11 deletions trunk/kernel/power/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ config PM_VERBOSE
---help---
This option enables verbose messages from the Power Management code.

config DISABLE_CONSOLE_SUSPEND
bool "Keep console(s) enabled during suspend/resume (DANGEROUS)"
depends on PM_DEBUG && PM_SLEEP
default n
---help---
This option turns off the console suspend mechanism that prevents
debug messages from reaching the console during the suspend/resume
operations. This may be helpful when debugging device drivers'
suspend/resume routines, but may itself lead to problems, for example
if netconsole is used.

config PM_TRACE
bool "Suspend/resume event tracing"
depends on PM_DEBUG && X86 && PM_SLEEP && EXPERIMENTAL
Expand Down
16 changes: 14 additions & 2 deletions trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,25 +862,37 @@ int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, cha
return -1;
}

#ifndef CONFIG_DISABLE_CONSOLE_SUSPEND
int console_suspend_enabled = 1;
EXPORT_SYMBOL(console_suspend_enabled);

static int __init console_suspend_disable(char *str)
{
console_suspend_enabled = 0;
return 1;
}
__setup("no_console_suspend", console_suspend_disable);

/**
* suspend_console - suspend the console subsystem
*
* This disables printk() while we go into suspend states
*/
void suspend_console(void)
{
if (!console_suspend_enabled)
return;
printk("Suspending console(s)\n");
acquire_console_sem();
console_suspended = 1;
}

void resume_console(void)
{
if (!console_suspend_enabled)
return;
console_suspended = 0;
release_console_sem();
}
#endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */

/**
* acquire_console_sem - lock the console system for exclusive use.
Expand Down

0 comments on commit 53f3368

Please sign in to comment.