Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@de.bosch.com>
To: Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: serial: sh-sci: rx overrun errors and hrtimer rx_timeout?
Date: Fri, 9 Aug 2024 09:24:15 +0200	[thread overview]
Message-ID: <651189ff-bb02-4c6f-94da-fa2eb4dc0e49@de.bosch.com> (raw)

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

             reply	other threads:[~2024-08-09  7:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09  7:24 Dirk Behme [this message]
2024-08-19 19:26 ` serial: sh-sci: rx overrun errors and hrtimer rx_timeout? Geert Uytterhoeven
     [not found] <CAMuHMdWJT8-hUWrbQEWM4Dj_rJOxvCcUpksL_8EKn19MEstnmA () mail ! gmail ! com>
2024-08-20  5:28 ` Dirk Behme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=651189ff-bb02-4c6f-94da-fa2eb4dc0e49@de.bosch.com \
    --to=dirk.behme@de.bosch.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox