]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 6.4
authorSasha Levin <sashal@kernel.org>
Mon, 21 Aug 2023 01:53:13 +0000 (21:53 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 21 Aug 2023 01:53:13 +0000 (21:53 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-6.4/serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch [new file with mode: 0644]
queue-6.4/series

diff --git a/queue-6.4/serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch b/queue-6.4/serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch
new file mode 100644 (file)
index 0000000..be927f1
--- /dev/null
@@ -0,0 +1,44 @@
+From 868c1b8d246d3938efd429d4ab14434ae5424e6c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 4 Aug 2023 16:15:51 +0300
+Subject: serial: 8250: Fix oops for port->pm on uart_change_pm()
+
+From: Tony Lindgren <tony@atomide.com>
+
+[ 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 <tony@atomide.com>
+Link: https://lore.kernel.org/r/20230804131553.52927-1-tony@atomide.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 053d44412e42f..0a67dff575f78 100644
+--- a/drivers/tty/serial/8250/8250_port.c
++++ b/drivers/tty/serial/8250/8250_port.c
+@@ -3288,6 +3288,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
+
index 3b8546c1db1997ff6049d453c9f2714208730e32..6ee20b5bde94f93688f43e4c98b3aea1dcd4719c 100644 (file)
@@ -202,3 +202,4 @@ alsa-hda-realtek-remodified-3k-pull-low-procedure.patch
 riscv-entry-set-a0-enosys-only-when-syscall-1.patch
 riscv-correct-riscv_insn_is_c_jr-and-riscv_insn_is_c.patch
 riscv-uaccess-return-the-number-of-bytes-effectively.patch
+serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch