public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: "Filip Žaludek" <filip.zaludek@oracle.com>
To: linux-usb@vger.kernel.org
Cc: Konrad Wilk <konrad.wilk@oracle.com>
Subject: data throttling under load when serial to usb adapter is used
Date: Mon, 20 Dec 2021 09:11:06 +0100	[thread overview]
Message-ID: <738e20c6-c709-d149-fe48-ee89540fe38a@oracle.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3156 bytes --]




Hi,
  under load I am experiencing data throttling when serial to usb adapter is used,
but only in direction from wires to usb. Opposite direction seems to be robust.
  To reproduce plug both ends of usb to serial adapter into same hardware and run
attached script. You should see data flowing in both directions, then saturate cpu
`stress --cpu #cpus_plus_two`.
  Data will be corrupted only in serial to usb direction, usually from beginning,
often within first urb. Not seems to be due to flow control.
  Even though chopped bytes are received, rx/tx counters are correctly incremented.
Script implements data sending in two ways, first utilizing socat and second standard
cat command. It is adjusted for RPi4 with miniUART ttyS0, for multiport hardware
and/or ttyAMA0 you will need to tailor accordingly.

Rough failure rates observed (former trials with ~32k dmesg):
ttyAMA0: 'cat' 20% vs. 'socat'  2%
ttyS0  : 'cat' 90% vs. 'socat' 40%

Why to plug both adapter ends into same hardware?
- I believe this is sub-issue of two connected devices, but it is hard to reproduce
- serial port programming




Regards,
Filip Zaludek




Tested chipsets:

ftdi_sio [TTL], Bus 004 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
pl2303 [TTL], Bus 001 Device 005: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P
ch341-uart [RS232], Bus 001 Device 006: ID 1a86:7523 QinHeng Electronics CH340 serial converter



Tested chipset|platform|OS|kernel:

ftdi_sio|Raspberry Pi 4 Model B Rev 1.4|Oracle Linux Server 8.5|kernel-5.16.0-rc5
* errors only in s->u direction, often corrupted without load

ftdi_sio|Raspberry Pi 4 Model B Rev 1.4|Oracle Linux Server 8.5|kernel-uek-5.15-2148.0.1.el8uek
* errors only in s->u direction

ftdi_sio|BananaPi-M64|openSUSE Tumbleweed 20210829|5.13.12-2-default
ftdi_sio|BananaPi-M64|openSUSE Tumbleweed 20211202|5.15.5-1-default
* errors only in s->u direction, often corrupted without load

ftdi_sio|Raspberry Pi 4 Model B Rev 1.4|Raspbian GNU/Linux 10 (buster)|5.10.63-v7l+
* errors only in s->u direction

ftdi_sio|Raspberry Pi 4 Model B Rev 1.4|Ubuntu 21.10|5.13.0-1011-raspi
* errors only in s->u direction

ftdi_sio|Raspberry Pi 4 Model B Rev 1.4|openSUSE Tumbleweed 20211202|5.15.5-1-default
* errors only in s->u direction

pl2303|Raspberry Pi 4 Model B Rev 1.4|Oracle Linux Server 8.5|kernel-uek-5.4.17-2136.300.7.el8uek
pl2303|Raspberry Pi 4 Model B Rev 1.4|Oracle Linux Server 8.5|kernel-uek-5.15-2148.0.1.el8uek
* errors only in s->u direction

pl2303|Raspberry Pi 4 Model B Rev 1.4|openSUSE Tumbleweed 20211202|5.15.5-1-default
* errors only in s->u direction, often corrupted without load

pl2303|Raspberry Pi 4 Model B Rev 1.4|Ubuntu 21.10|5.13.0-1011-raspi
* errors only in s->u direction, for miniUART & socat errors seems to be really rare under load

pl2303|Raspberry Pi 4 Model B Rev 1.4|Raspbian GNU/Linux 10 (buster)|5.10.63-v7l+
* errors only in s->u direction

ch341-uart|x86_64|Ubuntu 18.04.5 LTS|4.15.0-154-generic
* I was able only once to run this setup, kernel seemed to be resistant under load. Chipset is unreliable.



[-- Attachment #2: usb_uart.sh --]
[-- Type: application/x-shellscript, Size: 1697 bytes --]

             reply	other threads:[~2021-12-20  8:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20  8:11 Filip Žaludek [this message]
2021-12-20  8:28 ` data throttling under load when serial to usb adapter is used Greg KH
2021-12-20 10:19   ` [External] : " Filip Žaludek
2021-12-20 10:45     ` Greg KH
2021-12-20 14:04     ` Johan Hovold

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=738e20c6-c709-d149-fe48-ee89540fe38a@oracle.com \
    --to=filip.zaludek@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-usb@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