Commit 96050814 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull printk updates from Petr Mladek:

 - New option "printk.debug_non_panic_cpus" allows to store printk
   messages from non-panic CPUs during panic. It might be useful when
   panic() fails. It is disabled by default because it increases the
   chance to see the messages printed before panic() and on the
   panic-CPU.

 - New build option "CONFIG_NULL_TTY_DEFAULT_CONSOLE" allows to build
   kernel without the virtual terminal support which prefers ttynull
   over serial console.

 - Do not unblank suspended consoles.

 - Some code clean up.

* tag 'printk-for-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
  printk/panic: Add option to allow non-panic CPUs to write to the ring buffer.
  printk: Add an option to allow ttynull to be a default console device
  printk: Check CON_SUSPEND when unblanking a console
  printk: Rename console_start to console_resume
  printk: Rename console_stop to console_suspend
  printk: Rename resume_console to console_resume_all
  printk: Rename suspend_console to console_suspend_all
parents a10c7949 f49040c7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -5020,6 +5020,14 @@
			Format: <bool>
			default: 0 (auto_verbose is enabled)

	printk.debug_non_panic_cpus=
			Allows storing messages from non-panic CPUs into
			the printk log buffer during panic(). They are
			flushed to consoles by the panic-CPU on
			a best-effort basis.
			Format: <bool> (1/Y/y=enable, 0/N/n=disable)
			Default: disabled

	printk.devkmsg={on,off,ratelimit}
			Control writing to /dev/kmsg.
			on - unlimited logging to /dev/kmsg from userspace
+3 −1
Original line number Diff line number Diff line
@@ -78,7 +78,9 @@ If no console device is specified, the first device found capable of
acting as a system console will be used. At this time, the system
first looks for a VGA card and then for a serial port. So if you don't
have a VGA card in your system the first serial port will automatically
become the console.
become the console, unless the kernel is configured with the
CONFIG_NULL_TTY_DEFAULT_CONSOLE option, then it will default to using the
ttynull device.

You will need to create a new device to use ``/dev/console``. The official
``/dev/console`` is now character device 5,1.
+2 −2
Original line number Diff line number Diff line
@@ -323,7 +323,7 @@ static int drm_log_client_suspend(struct drm_client_dev *client, bool _console_l
{
	struct drm_log *dlog = client_to_drm_log(client);

	console_stop(&dlog->con);
	console_suspend(&dlog->con);

	return 0;
}
@@ -332,7 +332,7 @@ static int drm_log_client_resume(struct drm_client_dev *client, bool _console_lo
{
	struct drm_log *dlog = client_to_drm_log(client);

	console_start(&dlog->con);
	console_resume(&dlog->con);

	return 0;
}
+18 −1
Original line number Diff line number Diff line
@@ -383,7 +383,24 @@ config NULL_TTY
	  available or desired.

	  In order to use this driver, you should redirect the console to this
	  TTY, or boot the kernel with console=ttynull.
	  TTY, boot the kernel with console=ttynull, or enable
	  NULL_TTY_DEFAULT_CONSOLE.

	  If unsure, say N.

config NULL_TTY_DEFAULT_CONSOLE
	bool "Support for console on ttynull"
	depends on NULL_TTY=y && !VT_CONSOLE
	help
	  Say Y here if you want the NULL TTY to be used as a /dev/console
	  device by default.

	  For example, it might be useful to prevent a VT-less kernel from
	  writing the system log to a random device connected to the serial
	  port.

	  Another console driver still might get preferred via the command
	  line, SPCR, or the device tree.

	  If unsure, say N.

+3 −3
Original line number Diff line number Diff line
@@ -2426,10 +2426,10 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
	}

	/*
	 * Disable the console device before suspending.
	 * Suspend the console device before suspending the port.
	 */
	if (uart_console(uport))
		console_stop(uport->cons);
		console_suspend(uport->cons);

	uart_change_pm(state, UART_PM_STATE_OFF);

@@ -2484,7 +2484,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
			uart_port_unlock_irq(uport);
		}
		if (console_suspend_enabled)
			console_start(uport->cons);
			console_resume(uport->cons);
	}

	if (tty_port_suspended(port)) {
Loading