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:
Loic Poulain 2019-06-11 10:27:04 +02:00 committed by Anas Nashif
commit 7428f9c070

View file

@ -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;