aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/serial_8250.h
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-02-17 13:40:15 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-17 15:58:00 +0100
commitbedb404e91bb2908d9921fc736a518a9d89525fc (patch)
treeb15aa0028cbc36f68c8a2461476b56af214dea22 /include/linux/serial_8250.h
parentserial: core: Allow detach and attach serial device for console (diff)
downloadwireguard-linux-bedb404e91bb2908d9921fc736a518a9d89525fc.tar.xz
wireguard-linux-bedb404e91bb2908d9921fc736a518a9d89525fc.zip
serial: 8250_port: Don't use power management for kernel console
Doing any kind of power management for kernel console is really bad idea. First of all, it runs in poll and atomic mode. This fact attaches a limitation on the functions that might be called. For example, pm_runtime_get_sync() might sleep and thus can't be used. This call needs, for example, to bring the device to powered on state on the system, where the power on sequence may require on-atomic operations, such as Intel Cherrytrail with ACPI enumerated UARTs. That said, on ACPI enabled platforms it might even call firmware for a job. On the other hand pm_runtime_get() doesn't guarantee that device will become powered on fast enough. Besides that, imagine the case when console is about to print a kernel Oops and it's powered off. In such an emergency case calling the complex functions is not the best what we can do, taking into consideration that user wants to see at least something of the last kernel word before it passes away. Here we modify the 8250 console code to prevent runtime power management. Note, there is a behaviour change for OMAP boards. It will require to detach kernel console to become idle. Link: https://lists.openwall.net/linux-kernel/2018/09/29/65 Suggested-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200217114016.49856-6-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/serial_8250.h')
-rw-r--r--include/linux/serial_8250.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 0901c2aa366c..6545f8cfc8fa 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -179,6 +179,7 @@ void serial8250_set_defaults(struct uart_8250_port *up);
void serial8250_console_write(struct uart_8250_port *up, const char *s,
unsigned int count);
int serial8250_console_setup(struct uart_port *port, char *options, bool probe);
+int serial8250_console_exit(struct uart_port *port);
extern void serial8250_set_isa_configurator(void (*v)
(int port, struct uart_port *up,