diff options
| author | Tony Lindgren <tony@atomide.com> | 2023-08-04 16:15:51 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-30 16:35:13 +0200 |
| commit | 66f3e55960698c874b0598277913b478ecd29573 (patch) | |
| tree | 0d3201f6482823dfd07c8f269226bcc4db54422f | |
| parent | 8b99b3966459326f134d88661fae9e5f659a1bf2 (diff) | |
| download | linux-66f3e55960698c874b0598277913b478ecd29573.tar.gz linux-66f3e55960698c874b0598277913b478ecd29573.tar.bz2 linux-66f3e55960698c874b0598277913b478ecd29573.zip | |
serial: 8250: Fix oops for port->pm on uart_change_pm()
commit dfe2aeb226fd5e19b0ee795f4f6ed8bc494c1534 upstream.
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>
| -rw-r--r-- | drivers/tty/serial/8250/8250_port.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index d3083f19d213..21a94bb75065 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -3191,6 +3191,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; |
