From: Sasha Levin Date: Mon, 21 Aug 2023 01:53:18 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v6.4.12~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=073f9f18bbea90e6f5fa00242ac05f43158d9fc7;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch b/queue-4.19/serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch new file mode 100644 index 00000000000..d8093036bef --- /dev/null +++ b/queue-4.19/serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch @@ -0,0 +1,44 @@ +From 8bee52b36650d22a4373bc4744dde680db553799 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 66de3a59f5779..d3161be35b1b2 100644 +--- a/drivers/tty/serial/8250/8250_port.c ++++ b/drivers/tty/serial/8250/8250_port.c +@@ -3224,6 +3224,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; + + up->cur_iotype = 0xFF; +-- +2.40.1 + diff --git a/queue-4.19/series b/queue-4.19/series index f3acedea29a..cbc1291f46e 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -72,3 +72,4 @@ sock-fix-misuse-of-sk_under_memory_pressure.patch net-do-not-allow-gso_size-to-be-set-to-gso_by_frags.patch asoc-rt5665-add-missed-regulator_bulk_disable.patch asoc-meson-axg-tdm-formatter-fix-channel-slot-alloca.patch +serial-8250-fix-oops-for-port-pm-on-uart_change_pm.patch