]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
serial: 8250: Fix oops for port->pm on uart_change_pm()
authorTony Lindgren <tony@atomide.com>
Fri, 4 Aug 2023 13:15:51 +0000 (16:15 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 30 Oct 2023 11:00:20 +0000 (12:00 +0100)
commit65ceb6e9371e71c34f9a604ec8cbbd7f4339ce81
treea6f4fd1891eb95f19f910cfbe1198af1417643e5
parentb263ccfc2352043bbd38df17faedcf25ea6d904e
serial: 8250: Fix oops for port->pm on uart_change_pm()

BugLink: https://bugs.launchpad.net/bugs/2039110
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/tty/serial/8250/8250_port.c