usb: dw: Add sleep before FIFO flash
Adding sleep before TX FIFO flash fixes splitting networking packets sent over USB endpoints making ECM broken since there is no flow control other then frame sizes. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
parent
b722dc589e
commit
fe9dee0107
1 changed files with 3 additions and 1 deletions
|
@ -400,17 +400,19 @@ static int usb_dw_tx(u8_t ep, const u8_t *const data,
|
|||
unsigned int key;
|
||||
u32_t i;
|
||||
|
||||
key = irq_lock();
|
||||
|
||||
/* Check if FIFO space available */
|
||||
avail_space = usb_dw_tx_fifo_avail(ep_idx);
|
||||
if (avail_space != usb_dw_ctrl.in_ep_ctrl[ep_idx].fifo_size) {
|
||||
SYS_LOG_DBG("USB IN EP%d fifo not empty: %d",
|
||||
ep_idx, avail_space);
|
||||
k_sleep(20);
|
||||
usb_dw_flush_tx_fifo(ep_idx);
|
||||
avail_space = usb_dw_tx_fifo_avail(ep_idx);
|
||||
}
|
||||
|
||||
key = irq_lock();
|
||||
|
||||
avail_space *= 4;
|
||||
if (!avail_space) {
|
||||
SYS_LOG_ERR("USB IN EP%d no space available, DTXFSTS %x",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue