Skip to content

Commit ed27619

Browse files
ij-intelgregkh
authored andcommitted
tty: serial: 8250: Fix another runtime PM usage counter underflow
The commit f9b1122 ("serial: 8250: Fix PM usage_count for console handover") fixed one runtime PM usage counter balance problem that occurs because .dev is not set during univ8250 setup preventing call to pm_runtime_get_sync(). Later, univ8250_console_exit() will trigger the runtime PM usage counter underflow as .dev is already set at that time. Call pm_runtime_get_sync() to balance the RPM usage counter also in serial8250_register_8250_port() before trying to add the port. Reported-by: Borislav Petkov (AMD) <[email protected]> Fixes: bedb404 ("serial: 8250_port: Don't use power management for kernel console") Cc: stable <[email protected]> Tested-by: Borislav Petkov (AMD) <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 78d4f34 commit ed27619

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/tty/serial/8250/8250_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,9 @@ int serial8250_register_8250_port(const struct uart_8250_port *up)
812812
uart->dl_write = up->dl_write;
813813

814814
if (uart->port.type != PORT_8250_CIR) {
815+
if (uart_console_registered(&uart->port))
816+
pm_runtime_get_sync(uart->port.dev);
817+
815818
if (serial8250_isa_config != NULL)
816819
serial8250_isa_config(0, &uart->port,
817820
&uart->capabilities);

0 commit comments

Comments
 (0)