Unverified Commit a23985f5 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5872 [sync] PR-4794: serial: imx: fix tx statemachine deadlock

parents 8d06bcc8 6a23b30a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -463,13 +463,13 @@ static void imx_uart_stop_tx(struct uart_port *port)
	ucr1 = imx_uart_readl(sport, UCR1);
	imx_uart_writel(sport, ucr1 & ~UCR1_TRDYEN, UCR1);

	ucr4 = imx_uart_readl(sport, UCR4);
	usr2 = imx_uart_readl(sport, USR2);
	if (!(usr2 & USR2_TXDC)) {
	if ((!(usr2 & USR2_TXDC)) && (ucr4 & UCR4_TCEN)) {
		/* The shifter is still busy, so retry once TC triggers */
		return;
	}

	ucr4 = imx_uart_readl(sport, UCR4);
	ucr4 &= ~UCR4_TCEN;
	imx_uart_writel(sport, ucr4, UCR4);