drivers: udc_dwc2: Fix incomplete iso handling race
Incomplete iso IN/OUT is just informative and its occurrence does not
prevent the endpoint from actually transmitting/receiving data. Such
"late" isochronous transfers, which are perfectly fine according to USB
specification, were observed on Windows host with nRF54H20 running
explicit feedback sample operating at High-Speed.
The incorrect handling manifested itself with "ISO RX buffer too small"
error message. The faulty scenario was:
* incompISOIN handler does not find any matching endpoint
* incompISOOUT handler disables endpoint, discards buffer and sets
rearm flag
* next DWC2 interrupt handler iteration after reading GINTSTS
* XferCompl interrupt on iso IN endpoint
* XferCompl interrupt on iso OUT endpoint
- transfer was actually happening to the buffer discarded in
incompISOOUT handler
- XferCompl handler modified the next buffer
* GOUTNakEff interrupt, iso OUT endpoint EPDIS bit is set
* EPDisbld interrupt, rearm flag set
- the buffer modified by XferCompl is used and fails because it is
not large enough
Modify the sequence so it accounts for host actions and the above faulty
scenario no longer causes any problems.
Signed-off-by:
Tomasz Moń <tomasz.mon@nordicsemi.no>
Loading
Please sign in to comment