]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
serial: uartps: Fix suspend functionality
authorNava kishore Manne <nava.manne@xilinx.com>
Mon, 3 Sep 2018 13:10:51 +0000 (15:10 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 26 Nov 2019 12:16:39 +0000 (13:16 +0100)
commit24777eb817976a73fcd96b618942626c16a2823d
tree979c70f244a7c66f9da23e04b45e9a3d3050cd89
parentf8a99ee62238d93a71d56bc0bf047824f14b2757
serial: uartps: Fix suspend functionality

BugLink: https://bugs.launchpad.net/bugs/1853915
[ Upstream commit 4b9d33c6a30688344a3e95179654ea31b07f59b7 ]

The driver's suspend/resume functions were buggy.
If UART node contains any child node in the DT and
the child is established a communication path with
the parent UART. The relevant /dev/ttyPS* node will
be not available for other operations.
If the driver is trying to do any operations like
suspend/resume without checking the tty->dev status
it leads to the kernel crash/hang.

This patch fix this issue by call the device_may_wake()
with the generic parameter of type struct device.
in the uart suspend and resume paths.

It also fixes a race condition in the uart suspend
path(i.e uart_suspend_port() should be called at the
end of cdns_uart_suspend API this path updates the same)

Signed-off-by: Nava kishore Manne <navam@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.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: Khalid Elmously <khalid.elmously@canonical.com>
drivers/tty/serial/xilinx_uartps.c