From 0b300f369c9b13e964f25d633a554d1457a36807 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 20 Aug 2023 21:53:16 -0400 Subject: [PATCH] Fixes for 5.10 Signed-off-by: Sasha Levin --- ...x-oops-for-port-pm-on-uart_change_pm.patch | 44 +++++++++++++++++++ queue-5.10/series | 1 + 2 files changed, 45 insertions(+) create mode 100644 queue-5.10/serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch diff --git a/queue-5.10/serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch b/queue-5.10/serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch new file mode 100644 index 00000000000..761be85df6a --- /dev/null +++ b/queue-5.10/serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch @@ -0,0 +1,44 @@ +From 7b70618616cd83f14d91f7e4c28fa224c3ac97b3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 4 Aug 2023 16:15:51 +0300 +Subject: serial: 8250: Fix oops for port->pm on uart_change_pm() + +From: Tony Lindgren + +[ Upstream commit dfe2aeb226fd5e19b0ee795f4f6ed8bc494c1534 ] + +Unloading a hardware specific 8250 driver can produce error "Unable to +handle kernel paging request at virtual address" about ten seconds after +unloading the driver. This happens on uart_hangup() calling +uart_change_pm(). + +Turns out commit 04e82793f068 ("serial: 8250: Reinit port->pm on port +specific driver unbind") was only a partial fix. If the hardware specific +driver has initialized port->pm function, we need to clear port->pm too. +Just reinitializing port->ops does not do this. Otherwise serial8250_pm() +will call port->pm() instead of serial8250_do_pm(). + +Fixes: 04e82793f068 ("serial: 8250: Reinit port->pm on port specific driver unbind") +Signed-off-by: Tony Lindgren +Link: https://lore.kernel.org/r/20230804131553.52927-1-tony@atomide.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/tty/serial/8250/8250_port.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c +index 432a438929e64..7499954c9aa76 100644 +--- a/drivers/tty/serial/8250/8250_port.c ++++ b/drivers/tty/serial/8250/8250_port.c +@@ -3231,6 +3231,7 @@ void serial8250_init_port(struct uart_8250_port *up) + struct uart_port *port = &up->port; + + spin_lock_init(&port->lock); ++ port->pm = NULL; + port->ops = &serial8250_pops; + port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE); + +-- +2.40.1 + diff --git a/queue-5.10/series b/queue-5.10/series index e62204bd5be..305ddb40e85 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -113,3 +113,4 @@ riscv-lib-uaccess-fix-csr_status-sr_sum-bit.patch riscv-uaccess-return-the-number-of-bytes-effectively.patch x86-static_call-fix-__static_call_fixup.patch x86-srso-correct-the-mitigation-status-when-smt-is-d.patch +serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch -- 2.47.3