• Johan Hovold's avatar
    serial: qcom-geni: fix soft lockup on sw flow control and suspend · 947cc4ec
    Johan Hovold authored
    The stop_tx() callback is used to implement software flow control and
    must not discard data as the Qualcomm GENI driver is currently doing
    when there is an active TX command.
    
    Cancelling an active command can also leave data in the hardware FIFO,
    which prevents the watermark interrupt from being enabled when TX is
    later restarted. This results in a soft lockup and is easily triggered
    by stopping TX using software flow control in a serial console but this
    can also happen after suspend.
    
    Fix this by only stopping any active command, and effectively clearing
    the hardware fifo, when shutting down the port. When TX is later
    restarted, a transfer command may need to be issued to discard any stale
    data that could prevent the watermark interrupt from firing.
    
    Fixes: c4f52879 ("tty: serial: msm_geni_serial: Add serial driver support for GENI based QUP")
    Cc: stable@vger.kernel.org	# 4.17
    Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
    Link: https://lore.kernel.org/r/20240704101805.30612-2-johan+linaro@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    947cc4ec
qcom_geni_serial.c 49.5 KB