audit 0.21.0: rusb2 DCD/HCD follow-ups
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 5/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- c
- Domain
- embedded-iot
Research direction
Start in src/portable/renesas/rusb2/dcd_rusb2.c around the cited lines (941, 952, 956, 967, 1135, 1179) and rusb2_common.h, treating the four numbered defects as separate workstreams. The first pass is source reading plus the H1-H7 manual/errata lookups; hardware verification on the listed RA boards is required before completion. Done means each ownership or bookkeeping mismatch is resolved or explicitly deferred, with tests or board evidence for MTP reset, vendor alt changes, MSC reset, and video SET_INTERFACE.
Written by the indexing model from the issue text.
Description
Deferred defects found in the repository audit of 0.21.0..ad7c83db8 (batch port-rusb2). Each was validated against the source at ad7c83db8 and judged real but too large, or too hardware-dependent, for the audit PR's contained fixes.
1. OUT stall retains queued and its buffer; clear-stall re-arms them. usbd_edpt_abort() therefore releases USBD ownership while reception remains armed. MTP reset provides a concrete caller with replacement reception delayed until ACK. Vendor cancellation also uses stall/clear directly.
- Where:
dcd_rusb2.c:1135,:1179 - Verdict: valid; source ownership violation. MSC immediately replaces the receive in some paths, so its async-buffer corruption example is not established universally.; introduced: Yes for bulk OUT re-arm; failure to retire stall bookkeeping is older.; severity: medium
- Hardware/spec dependence: Proof needs no hardware assumption; safe cancellation implementation needs H2.
- Overlap: #3962 partial: abort API migration, not a complete repair of direct stall/clear callers. #346 concerns already-queued events, a different defect.
- Remaining work and verification: Distinguish cancellation from non-stalled toggle reset, covering direct stall/clear callers as well as the optional abort hook. Verify MTP reset before ACK, vendor alt changes, MSC reset, and ordinary clear-halt reception on
ra4m1_ek/ra6m5_ek.
2. Re-open resets hardware but preserves transfer bookkeeping and BEMP enable/state. usbd_edpt_open() does not release BUSY; ISO_ALLOC close is a no-op. Video bulk re-open at video_device.c:898 is a concrete caller.
- Where:
dcd_rusb2.c:941,:952,:956 - Verdict: valid lifecycle mismatch; exact subsequent interrupt outcome unverified. Clearing only
_dcd.pipe[]would not fix the USBD ownership problem.; introduced: Yes: pipe reuse/ISO_ALLOC introduced here; generic video re-open ownership problems also exist elsewhere.; severity: medium - Hardware/spec dependence: Software-state mismatch established; reset/BEMP consequences need H2/H4.
- Overlap: #4428 partial: same video/USBD problem demonstrated on RP2040, not RUSB2 bookkeeping.
- Remaining work and verification: Coordinate re-open cancellation, DCD state and USBD claim release. Exercise SET_INTERFACE during bulk video and notification transfers, then confirm subsequent submissions work.
3. Re-open bypasses type-based pipe allocation when an endpoint address changes transfer type.
- Where:
dcd_rusb2.c:941,:967 - Verdict: valid allocation inconsistency: it can select a pipe outside the driver’s own
find_pipe(new_type)set. The hardware failure and an in-tree bulk↔interrupt caller remain unverified.; introduced: Yes,7b1eb4f86.; severity: medium - Hardware/spec dependence: Capability/consequence needs H6; no covering claim.
- Overlap: None found.
- Remaining work and verification: Validate a custom alternate-setting descriptor that reuses an address across types; then reject unsupported changes or safely reallocate. Include ownership cleanup from C-F2.
4. On mini-module aliases, non-control transfers overwrite CFIFOSEL, but status completion uses its ISEL bit as the EP0 event direction. An IN status arm followed by data-pipe access can therefore be reported as EP0 OUT. usbd_control_xfer_cb() then treats it as data rather than ACK.
- Where:
dcd_rusb2.c:467,:541;rusb2_common.h:18 - Verdict: valid source-state defect; physical interleaving unverified. Unlike C-F3’s default trigger, it does not require multi-packet DCD submissions.; introduced: Older on M23; newly exposed on additional mini-module parts by
839fa380a.; severity: medium - Hardware/spec dependence: Register/interleaving confirmation needs H5.
- Overlap: PR #3824 does not fully cover it; no matching issue found.
- Remaining work and verification: Preserve the armed EP0 status direction independently of shared FIFO selection. Test control-OUT/no-data requests concurrent with bulk/interrupt traffic on
ra2a1_ekor another mini-module board; none is listed in the checked farm roster.
Adjudication notes: port-rusb2
Claims still needing read-doc:
- H1 — FIFO readiness: For RA USBFS/USBHS and RX63X/65X/72N, does BSTS reliably mean an IN buffer plane is CPU-writable, including double buffering and ISO? What selection/deselection settling and BRDY retry guarantees apply?
- H2 — reset, halt and receive ownership: Check base manuals and errata for ACLRM/SQCLR, PID, PBUSY, CURPIPE and hold-time requirements in endpoint open, bus reset, cancellation and host toggle reset. Does ACLRM preserve BRDYSTS? What must non-halted CLEAR_FEATURE preserve? This covers S-F05/F06/F10 and C-F1/F2/F4/F8.
- H3 — register-access reductions: Are PIPESEL/PIPECFG/PIPEMAXP and repeated PIPEnCTR reads side-effect-free in every affected variant? Which ordering requirements must configuration or arming extraction preserve?
- H4 — completion flags: Verify BEMPSTS latching independent of BEMPENB, safe duplicate/conditional clears, and INBUFM/BSTS versus BRDY/BEMP completion for bulk, interrupt and ISO.
- H5 — CFIFO and EP0: For RA2A1, RA4E2, RA6E2 and RA6T3, verify CFIFOSEL sharing, ISEL/MBW changes during an EP0 transfer and status completion. For all supported variants, establish DTLN validity after selection and how an accepted zero-length packet is distinguished from an empty buffer.
- H6 — pipe capabilities: Verify permissible transfer types and buffer configurations per pipe, including mini-module differences, and descriptor/type changes across alternate settings.
- H7 — PHY clocks: Verify supported PHY reference sources and CLKSEL encodings, including the alleged 48 MHz option, for RA6M3/RA6M5 and supported RA8 variants. Separately confirm feature-based controller availability; a USBFS-only build fix must not weaken USBHS clock validation.
Not verified: firmware builds, unit tests, hardware execution, timing measurements, or complete manual/errata coverage. The only executable reproduction was preprocessing the exact clock-selection block, not compiling a board. read-doc metadata lookup 44edc5fbe5b1 found RA6M5 manual book 5584 and errata entries; no page-level claim verification was completed. Existing issue citations were treated as tracking evidence, not substituted for claim records. No files were edited and nothing was published.
- 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