Regression: serial: imx: overrun errors on debug UART

Sergey Organov sorganov at gmail.com
Mon Mar 27 08:11:12 PDT 2023


Stefan Wahren <stefan.wahren at i2se.com> writes:

> Hi,
>
> Am 25.03.23 um 16:11 schrieb Uwe Kleine-König:

[...]

> today i had time to do some testing. At first i tested with different RXTL_DEFAULT values.
>
> 1 No overrun
> 2 No overrun
> 4 No overrun
> 8 Overruns
>
> After that i look at the # echo 0 > /proc/sys/kernel/printk approach,
> but this didn't change anything. The kernel is usually silent about
> log message after boot and the console works still with echo.
> Enforcing some driver to call printk periodically would make the
> console unusuable.

As you figured that printk() is not the cause, it must be something else
that causes overruns, so there is no need to check printk case further.

>
> Finally i tried to disabled the spin_lock in imx_uart_console_write:
>
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index f07c4f9ff13c..c342559ff1a2 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -2007,14 +2007,12 @@ imx_uart_console_write(struct console *co, const char *s, unsigned int count)
>  	struct imx_port_ucrs old_ucr;
>  	unsigned long flags;
>  	unsigned int ucr1;
> -	int locked = 1;
> +	int locked = 0;
>
>  	if (sport->port.sysrq)
>  		locked = 0;
>  	else if (oops_in_progress)
>  		locked = spin_trylock_irqsave(&sport->port.lock, flags);
> -	else
> -		spin_lock_irqsave(&sport->port.lock, flags);
>
>  	/*
>  	 *	First, save UCR1/2/3 and then disable interrupts
>
> But the overruns still occured. Is this because the serial core
> already helds a lock?

This probably isn't even called when there is no printk() output, as
user-space writes to /dev/console are rather performed through regular
generic code, AFAIK.

Best regards,
-- Sergey Organov



More information about the linux-arm-kernel mailing list