]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
tty: serial: fsl_lpuart: don't break the on-going transfer when global reset
authorSherry Sun <sherry.sun@nxp.com>
Mon, 24 Oct 2022 08:58:44 +0000 (16:58 +0800)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 12:59:33 +0000 (13:59 +0100)
commit44e7b1795359329a8754246dff6af419fc25fc46
treea6d0776b528ac4480071957cedc3de059feb2a4f
parentf4aaf2a71b1d008aa88290180a41a07ed6abf08c
tty: serial: fsl_lpuart: don't break the on-going transfer when global reset

[ Upstream commit 76bad3f88750f8cc465c489e6846249e0bc3d8f5 ]

lpuart_global_reset() shouldn't break the on-going transmit engine, need
to recover the on-going data transfer after reset.

This can help earlycon here, since commit 60f361722ad2 ("serial:
fsl_lpuart: Reset prior to registration") moved lpuart_global_reset()
before uart_add_one_port(), earlycon is writing during global reset,
as global reset will disable the TX and clear the baud rate register,
which caused the earlycon cannot work any more after reset, needs to
restore the baud rate and re-enable the transmitter to recover the
earlycon write.

Also move the lpuart_global_reset() down, then we can reuse the
lpuart32_tx_empty() without declaration.

Fixes: bd5305dcabbc ("tty: serial: fsl_lpuart: do software reset for imx7ulp and imx8qxp")
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Link: https://lore.kernel.org/r/20221024085844.22786-1-sherry.sun@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit e8915faa9f41dea278dfef3b7bf94d74cdb8436d)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
drivers/tty/serial/fsl_lpuart.c