diff options
| author | renjie <[email protected]> | 2026-06-21 14:06:23 +0800 |
|---|---|---|
| committer | renjie <[email protected]> | 2026-06-21 17:46:26 +0800 |
| commit | f7617168e2ce2e7ea2e49cba5962b69aed04900e (patch) | |
| tree | 49de16c1b816c244e93ac0c58f75da004f680bd8 /docs | |
| parent | c1bf19ed6cf1eaa791f221c1bc5ce4b3d069f76d (diff) | |
fix(host): release spinlock in tuh_deinit to fix multi-rebuild panic
tuh_rhport_init() calls osal_spin_init(&_usbh_spin), which under OPT_OS_PICO
claims a hardware spinlock via critical_section_init(). There was no
osal_spin_deinit(), so tuh_deinit() never released it: every host init/deinit
cycle leaked one spinlock. RP2350 has a small spinlock pool, so a few usb_host
rebuilds exhaust it and hw_claim_unused_from_range() panics (the long-standing
"crashes on the 4th rebuild" bug).
Add osal_spin_deinit() to all OSAL backends (critical_section_deinit for pico;
no-op for none/freertos) and call it in tuh_deinit(). Verified 20/20
deinit+rebuild cycles on RP2350-Zero and Waveshare RP2350-USB-A (previously
panicked on the 4th).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions
