• Nava kishore Manne's avatar
    serial: uartps: Fix suspend functionality · 4b9d33c6
    Nava kishore Manne authored
    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: default avatarNava kishore Manne <navam@xilinx.com>
    Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    4b9d33c6
xilinx_uartps.c 45.9 KB