Repository navigation
usb2otg: channel halt, periodic and SMP fixes (2.1) - #2324
Conversation
OpenUnit and the wedge recovery set the AXI burst bit instead of bit 4, as device init and dwc2 on BCM2835 do. Under heavy isochronous IN the DMA then hung and took the whole controller with it.
|
Thanks. I've read the five commits against master; Two things need changing, both in 1. A stuck direct iso channel is re-armed while it may still be enabled
On the next SOF, Fix: check CHENA before dropping the packet. If the channel is still enabled, reset it with 2.
|
No TX FIFO flush while other channels are enabled. A channel whose halt fails is quarantined. No CHDIS on direct iso channels, a stuck one is reset when its packet is dropped. Iso waits for periodic request queue space and HPTXSTS is logged when a periodic channel gets stuck.
The pending disable cancelled the next transfer on the channel, so a pulled USB stick left its bulk channel dead for the next device, and the first SSPLIT of split control transfers halted bare. A bulk give-up now also resets the channel. Version 2.1.
3337dbc to
d627eeb
Compare
|
Thanks, both fixed in the periodic-channels commit.
|
|
channels that fail to halt are now marked out of use in hu_DeadChannels. That marking happens from the IRQ path without hu_Lock, mostly with a plain read-modify-write of the byte. The watchdog clears bits in the same byte under the lock, and it can run on another CPU, so the two updates can collide and one gets lost. Then either:
Fix: use AROS_ATOMIC_OR/AROS_ATOMIC_AND on hu_DeadChannels, as is already done for the SOF gate bits. Taking the lock inside the helper won't work, because the watchdog calls it while already holding the lock. |
A dropped split iso packet called Cause() with hu_Lock held, which takes the lock again. Four IRQ paths changed the transfer queues without the lock other CPUs take for them. The SOF gate's busy bits and hu_DeadChannels are atomic, as the gate softint and the watchdog can run on any CPU.
The mask kept 10 bits, so a 1024-byte endpoint was programmed with 0. High-speed isochronous transfers then ended in babble every time.
d627eeb to
431f2c5
Compare
|
Right, fixed in the SMP locking commit. Every bit update of |
Tested on a Raspberry Pi 3B+ (aarch64, SMP) with keyboard, mouse, hub, mass storage replug, a USB webcam and USB audio.