Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
* serial: sh-sci: rx overrun errors and hrtimer rx_timeout?
@ 2024-08-09  7:24 Dirk Behme
  2024-08-19 19:26 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Dirk Behme @ 2024-08-09  7:24 UTC (permalink / raw)
  To: Linux-Renesas

Hi,

short: What is the sh-sci rx DMA hrtimer configured to rx_timeout good for?

Long story:

Using drivers/tty/serial/sh-sci.c (on 4.14.x Renesas BSP) what is quite 
similar to [1] we got reports about data loss on rx large files (test 
case rx 1GB file):

$ cat /proc/tty/driver/sci
serinfo:1.0 driver revision:
0: uart:scif mmio:0xE6E88000 irq:88 tx:40991 rx:16 RTS|CTS|DTR|DSR|CD
1: uart:hscif mmio:0xE66B0000 irq:45 tx:908 rx:1410 RTS|CTS|DTR|DSR|CD
2: uart:scif mmio:0xE6C40000 irq:89 tx:0 rx:0 CTS|DSR|CD
3: uart:scif mmio:0xE6E68000 irq:87 tx:0 rx:0 CTS|DSR|CD
4: uart:scif mmio:0xE6E60000 irq:86 tx:3506 rx:179863 oe:141 
RTS|CTS|DTR|DSR|CD

See the oe (overrun error?) at uart #4.

For testing the hrtimer rx_timeout was changed (for example to 1000 by 
adding a sysfs interface for it) and with that the oe are reduced 
(again, uart #4):

$ echo 1000 > /sys/class/tty/ttySC4/device/rx_timeout
$ cat /proc/tty/driver/sci
serinfo:1.0 driver revision:
0: uart:scif mmio:0xE6E88000 irq:88 tx:41621 rx:3 RTS|CTS|DTR|DSR|CD
1: uart:hscif mmio:0xE66B0000 irq:45 tx:908 rx:1395 RTS|CTS|DTR|DSR|CD
2: uart:scif mmio:0xE6C40000 irq:89 tx:0 rx:0 CTS|DSR|CD
3: uart:scif mmio:0xE6E68000 irq:87 tx:0 rx:0 CTS|DSR|CD
4: uart:scif mmio:0xE6E60000 irq:86 tx:514 rx:688401 oe:3 RTS|CTS|DTR|DSR|CD

I'm slightly unclear, but general high system load might be involved in 
these tests.

Now, looking at the code, I'm slightly unclear what this hrtimer and its 
timeout is used for in relation to the rx DMA? It seems it controls if 
the DMA is finished after the rx_timeout and if not it setup a new DMA? 
How might changing the timeout influence the overrun errors?

Best regards

Dirk

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/sh-sci.c

^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <CAMuHMdWJT8-hUWrbQEWM4Dj_rJOxvCcUpksL_8EKn19MEstnmA () mail ! gmail ! com>]

end of thread, other threads:[~2024-08-20  5:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-09  7:24 serial: sh-sci: rx overrun errors and hrtimer rx_timeout? Dirk Behme
2024-08-19 19:26 ` Geert Uytterhoeven
     [not found] <CAMuHMdWJT8-hUWrbQEWM4Dj_rJOxvCcUpksL_8EKn19MEstnmA () mail ! gmail ! com>
2024-08-20  5:28 ` Dirk Behme

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox