dwc2 host (esp32-s3): MSC read intermittently hangs mid-transfer in msc_file_explorer_freertos
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 8/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- c
- Domain
- embedded-iot
Research direction
Start in the dwc2 host driver around handle_channel_irq()'s abort-retire path and the invalid-CSW branch in msc_host.c, then reproduce with host/msc_file_explorer_freertos on the espressif_s3_devkitm HIL cell while running dd 1024. Under a debugger, dump HCCHAR/HCINT/HCTSIZ/HAINT/HAINTMSK and the endpoint xfer state at the stall, and cross-check the DWC2 Programming Guide on write-1-to-clear HCINT.ChHltd racing a new halt. Done means naming whether ChHltd or XferCompl is lost or the channel was never re-armed, with the hang no longer reproducing on the farm.
Written by the indexing model from the issue text.
Description
host/msc_file_explorer_freertos on the farm's espressif_s3_devkitm hangs partway through dd 1024. The console stops right after dd: reading 1024 sectors (524288 bytes), 8 sectors/xfer ..., with no CSW error and no further output, and the cell fails with "MSC read produced no speed report". The disk is a UDisk 5.00 stick (30720000 blocks).
Evidence
Rates are per cell, slave-mode / DMA variant:
| Build | Failed |
|---|---|
master 93aa62bce |
3 of 16 (slave 3/8, DMA 0/8) |
master 17301f1a6 |
0 of 4 |
audit branch (#4542) with an extra channel->hcint = HCINT_HALTED write in handle_channel_irq()'s abort-retire path |
about 9 of 16 (slave and DMA) |
| the same branch without that write | 1 of 16 |
- A debug print in
msc_host.c's invalid-CSW branch never fired, so the stall is below the class: no completion arrives for an armed transfer. - Removing the extra HCINT write (now dropped from #4542) brings the rate back to about master's. The higher rate with it suggests a timing-sensitive lost or stale channel interrupt in the dwc2 host. It is not proven which.
Remaining work
- Catch a hang under a debugger and record the channel's HCCHAR/HCINT/HCTSIZ/HAINT/HAINTMSK and the endpoint's
xferstate, to see whether a ChHltd or XferCompl is lost or the channel was never re-armed. - Check against the DWC2 Programming Guide whether a host write-1-to-clear of HCINT.ChHltd on a channel can race a new halt for the same channel.
Found while validating #4542 on the HIL farm. Not reproduced on any other dwc2 host board.
- Dominant language
- C
- Stars
- 7.3k
- Forks
- 1.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 67
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 hathach/tinyusb
-
follow-up Port WCH USBFS Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
follow-up Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
hil-contract: a background hil_remote.py launch is killed at the Bash default 10 min timeoutPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
ch32v30x: debug UART loses queued bytes when its TX ring fillsPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
followup Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
-
Missing slice offset check in jvp_equal fast path corrupts slice comparison and aborts delpathsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
area9innovation/flow9#1805 ·
Maintainers usually reply within 3 days
-
AI:Robustness triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open5gs/open5gs#5246 · 1 comment ·
Maintainers usually reply within 1 day