[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230805050427.tj4ya7w3a3nzc2dp@dhruva>
Date: Sat, 5 Aug 2023 10:34:27 +0530
From: Dhruva Gole <d-gole@...com>
To: Tony Lindgren <tony@...mide.com>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...el.com>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
John Ogness <john.ogness@...utronix.de>,
Johan Hovold <johan@...nel.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Vignesh Raghavendra <vigneshr@...com>,
<linux-kernel@...r.kernel.org>, <linux-serial@...r.kernel.org>
Subject: Re: [PATCH] serial: 8250: Fix oops for port->pm on uart_change_pm()
On Aug 04, 2023 at 16:15:51 +0300, Tony Lindgren wrote:
> 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().
Thanks for catching and fixing this!
>
> Fixes: 04e82793f068 ("serial: 8250: Reinit port->pm on port specific driver unbind")
> Signed-off-by: Tony Lindgren <tony@...mide.com>
> ---
> 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
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -3278,6 +3278,7 @@ void serial8250_init_port(struct uart_8250_port *up)
>
> spin_lock_init(&port->lock);
> port->ctrl_id = 0;
> + port->pm = NULL;
Reviewed-by: Dhruva Gole <d-gole@...com>
> port->ops = &serial8250_pops;
> port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE);
>
> --
> 2.41.0
--
Best regards,
Dhruva Gole <d-gole@...com>
Powered by blists - more mailing lists