]> Git Repo - linux.git/commitdiff
tty/serial/imx: Enable TXEN bit in imx_poll_init().
authorMingrui Ren <[email protected]>
Wed, 2 Dec 2020 07:25:43 +0000 (15:25 +0800)
committerGreg Kroah-Hartman <[email protected]>
Fri, 4 Dec 2020 15:54:20 +0000 (16:54 +0100)
As described in Documentation, poll_init() is called by kgdb to initialize
hardware which supports both poll_put_char() and poll_get_char().

It's necessary to enable TXEN bit, otherwise, it will cause hardware fault
and kernel panic when calling imx_poll_put_char().

Generally, if use /dev/ttymxc0 as kgdb console as well as system
console, ttymxc0 is initialized early by system console which does enable
TXEN bit.But when use /dev/ttymxc1 as kgbd console, ttymxc1 is only
initialized by imx_poll_init() cannot enable the TXEN bit, which will
cause kernel panic.

Signed-off-by: Mingrui Ren <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/tty/serial/imx.c

index b50f97cb07e9edfc2859e3d15f89010ded402383..cafa88df5a85e04ec7b0632ba9a4d35012593ec4 100644 (file)
@@ -1861,7 +1861,7 @@ static int imx_uart_poll_init(struct uart_port *port)
        ucr1 |= UCR1_UARTEN;
        ucr1 &= ~(UCR1_TRDYEN | UCR1_RTSDEN | UCR1_RRDYEN);
 
-       ucr2 |= UCR2_RXEN;
+       ucr2 |= UCR2_RXEN | UCR2_TXEN;
        ucr2 &= ~UCR2_ATEN;
 
        imx_uart_writel(sport, ucr1, UCR1);
This page took 0.059307 seconds and 4 git commands to generate.