drivers: usb: nxp: Fix board freeze with various USB classes
Prevent to reschedule a transfer if one is already ongoing (occupied). This happens with USB class drivers scheduling transfer once interface is enabled (netusb, ACM...) and cause freeze due to infinite loop in low level driver. Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
This commit is contained in:
parent
d47df7f73f
commit
7428f9c070
1 changed files with 5 additions and 0 deletions
|
@ -377,6 +377,11 @@ int usb_dc_ep_read_continue(u8_t ep)
|
|||
/* select the index of the next endpoint buffer */
|
||||
u8_t ep_abs_idx = EP_ABS_IDX(ep);
|
||||
|
||||
if (s_Device.eps[ep_abs_idx].ep_occupied) {
|
||||
LOG_WRN("endpoint 0x%x already occupied", ep);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (EP_ADDR2IDX(ep) == USB_ENDPOINT_CONTROL) {
|
||||
if (s_Device.setupDataStage == SETUP_DATA_STAGE_DONE) {
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue