Skip to content

Commit

Permalink
Fix livelock on IN or OUT transactions
Browse files Browse the repository at this point in the history
- Handles new interrupt flags for IN & OUT endpoints
- Catches interrupts when certain error conditions occured
- Prevents livelocks for some error conditions
  • Loading branch information
RockyZeroFour committed Dec 8, 2024
1 parent 98e95b6 commit 173b3f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/portable/synopsys/dwc2/dcd_dwc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,9 @@ static void handle_epout_irq (uint8_t rhport)
dcd_event_xfer_complete(rhport, n, xfer->total_len, XFER_RESULT_SUCCESS, true);
}
}

// Failsafe, clear all pending interrupts if set
epout[n].doepint = epout[n].doepint;
}
}
}
Expand Down Expand Up @@ -1252,6 +1255,9 @@ static void handle_epin_irq (uint8_t rhport)
dwc2->diepempmsk &= ~(1 << n);
}
}

// Failsafe, clear all pending interrupts if set
epin[n].diepint = epin[n].diepint;
}
}
}
Expand Down Expand Up @@ -1348,7 +1354,7 @@ void dcd_int_handler(uint8_t rhport)
do
{
handle_rxflvl_irq(rhport);
} while(dwc2->gotgint & GINTSTS_RXFLVL);
} while(dwc2->gintsts & GINTSTS_RXFLVL);

// Manage RX FIFO size
if (_out_ep_closed)
Expand Down

0 comments on commit 173b3f8

Please sign in to comment.