Re: imx serial chars lost issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Francesco,

On Mon, Oct 03, 2022 at 01:08:50PM +0200, Francesco Dolcini wrote:
> recently I have been experiencing an issue with the imx uart on i.MX6ULL
> SoC, on the tty console (no flow control, 1152008n1), chars after the 32nd
> are lost when typing "fast" (copy/paste or writing to the uart using
> automated tools).
> 
> This was tested on Linux 6.0, however it does not look like a brand new
> regression, kernel 5.4 was somehow subject to the same issue, although
> it was way more difficult to trigger it.
> 
> While I do understand that without flow control this is something that
> cannot be prevented, it is pretty fishy that is always the chars after
> the 32nd.
> 
> I guess that might be happening is that the FIFO is emptied only by a
> timer or when it is full, instead of emptying it when half-full, and the
> CPU might not be fast enough leading to an overflow and the chars lost.
> 
> Any idea?

It's not unheared that there are bugs in the imx serial driver, but I'm
at least half confident that it's not a driver issue.

I guess commit 7a637784d517 ("serial: imx: reduce RX interrupt
frequency") is relevant, this was added in v5.18-rc1.

If this is really the commit that made the issue easier to reproduce,
then this is a hint that there is no functional problem and we're "just"
talking about irq latency issues. If enabling flow control solves the
issue, this is another hint in the same direction.

So I think this is what happens:

The other side starts sending chars at a high frequency. Once the RX
FIFO fill level reaches 8 an irq is triggered. Now if there are 25 more
characters received before the irq is serviced you get an overflow and
loose chars. Without 7a637784d517 there is a bit more time (i.e. 7
character times).

So either you use a very high baud rate that is hard to handle (compared
to the cpu frequency), or this is a side effect of increased irq
latency (which is likely a problem somewhere else).

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux