Commit 8f0a5904 authored by Tony Lindgren's avatar Tony Lindgren Committed by sanglipeng
Browse files

serial: 8250: Fix oops for port->pm on uart_change_pm()

stable inclusion
from stable-v5.10.192
commit bd70d0b28010d560a8be96b44fea86fe2ba016ae
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I933RF

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bd70d0b28010d560a8be96b44fea86fe2ba016ae



--------------------------------

[ Upstream commit dfe2aeb2 ]

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 04e82793 ("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: 04e82793 ("serial: 8250: Reinit port->pm on port specific driver unbind")
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20230804131553.52927-1-tony@atomide.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 2c2839ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment