Data transfer over USB becomes unreliable after upgrading to v5.4.83-v71+
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- linux, raspberry-pi
- Domain
- embedded-iot, networking, operating-systems
Research direction
Start with the USBdataTest.zip reproduction, including lanTestPi2.py and lanClientTest.py, after configuring dwc2 and g_ether in /boot/config.txt and /boot/cmdline.txt. Compare repeated transfers on Linux v4.19-v71+ and v5.4.83-v71+ using the supplied /etc/network/interfaces file. Done means the regression is isolated and a confirmed fix or workaround is documented.
Written by the indexing model from the issue text.
Description
I think there is a bug in the latest pi4 Linux release, because data transfer over USB becomes unreliable after upgrading from Linux v4.19-v71+ to v5.4.83-v71+ on raspberry pi4.
We are using the USB C port as a RNDIS gadget to get TCP data to a PC. I found the minimum python code required to reproduce the problem, it sets up a socketserver on the pi4, and the client on the PC repeatedly asks for 10MBs data. In Linux v4.19-v71+ it is robust, and I can do the transfer > 5000 times (expected behaviour). In v5.4.83-v71+ exactly the same code works 50 to 500 times then the link starts to break down, I get time out errors (even with time out set to 10 seconds), and frequently after that the link freezes entirely and requires the USB to be disconnected and reconnected for it to return. It even takes down an SSH connection to the pi which is separate software (but connecting over the same USB cable).
I'm unable to use v4.19-v71+ from now because it is not compatible with the latest pi4 hardware, so I hope someone can help - either with a bug fix or workaround suggestions.
To reproduce:
Test code I am using is here:
USBdataTest.zip
Set up the pi4 as a usb gadget:
To /boot/config.txt add:
dtoverlay=dwc2
To /boot/cmdline.txt add:
modules-load=dwc2,g_ether
and use the /etc/network/interfaces file provided.
On the pi4 run:
python3 lanTestPi2.py
On a windows PC run:
python3 lanClientTest.py
It can be reproduced with or without an external PSU for the pi.
Other information:
PC OS: Windows 10
Pi4 boot loader: Sep 3 2020
Python version: 3.7
- Which model of Raspberry Pi? Pi4
- Which OS and version? 175dfb027ffabd4b8d5080097af0e51ed9a4a56c, stage2
- Which firmware version?Jan 8 2021 14:32:15 version 194a85abd768c7334bbadc3f1911c10a7d18ed14 (clean) (release) (start_x)
- Which kernel version? Linux TupelPi1 5.4.83-v7l+ #1379 SMP Mon Dec 14 13:11:54 GMT 2020 armv7l GNU/Linux
I upgraded by using:
sudo apt update
sudo apt full-upgrade
Logs:
Time out error (from PC recv command).
No error from pi4, but PC can no longer connect to it.
Please let me know if there is any other information I can provide, or if I can do any tests for you to narrow down the problem.
- Dominant language
- C
- Stars
- 13.2k
- Forks
- 5.5k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 21
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/linux
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7415 · 2 comments · 1 reaction ·
-
rp1-cfe doesn't forward V4L2_EVENT_SOURCE_CHANGE event from csi-2 sensor driver to userspace app Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/linux#7399 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
raspberrypi/linux#7357 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/linux#7054 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
raspberrypi/linux#7634 · 8 comments · 1 reaction ·
All issues in raspberrypi/linux
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·