portable: migrate remaining drivers to the stack critical section (#4054)

Open
#4,189 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
c
Domain
embedded-iot

Research direction

Start with the “Critical sections” section of docs/porting.rst, then inspect the listed MUSB, CI-FS, MM32, LPC17_40, PIC, FT9xx, and RP2040 drivers for raw interrupt locking. Check the LPC17_40 SIE handshake and NVIC behavior against UM10360 before changing its lock. Revisit dcd_nrf5x.c after #4066, #4164, and #4068 land; done means the remaining drivers use the appropriate critical-section APIs and the deprecated aliases are addressed.

Written by the indexing model from the issue text.

Description

followup Prio 📌

Follow-up of #4054 (branch fix-issue-215). Drivers whose raw dcd_int_disable/enable (or private) locking was not migrated to usbd/usbh_critical_enter / *_int_mask_enter in #4054; revalidate each against docs/porting.rst "Critical sections" before converting:

  • musb hcd
  • ci_fs hcd
  • mm32 dcd (IRQ mask leak)
  • lpc17_40 dcd: private usb_irq_lock() save/restore NVIC lock; SIE CmdCode/CCEMPTY/CDFULL handshake order vs ISR, and NVIC_DisableIRQ's implicit DSB/ISB, need a UM10360 check before replacing it
  • pic (pic32mz/pic24) dcd
  • ft9xx dcd
  • rp2040 hcd

Also dcd_nrf5x.c still calls the deprecated usbd_spin_lock/unlock aliases (8 sites); rename after #4066, #4164 and #4068 land, then decide whether the aliases can go.

Dominant language
C
Stars
7.3k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
99

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hathach/tinyusb

All issues in hathach/tinyusb

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.