Limit the number of times we loop inside the DWC OTG poll handler to

avoid starving other fast interrupts. Fix a comment while at it.

MFC after:	1 week
Suggested by:	Svatopluk Kraus <onwahe@gmail.com>
This commit is contained in:
hselasky 2015-07-31 09:12:31 +00:00
parent e9ba3ff9a6
commit 2e11d7935d

View File

@ -2551,12 +2551,18 @@ static void
dwc_otg_interrupt_poll_locked(struct dwc_otg_softc *sc)
{
struct usb_xfer *xfer;
uint32_t count = 0;
uint32_t temp;
uint8_t got_rx_status;
uint8_t x;
repeat:
/* get all channel interrupts */
if (++count == 16) {
/* give other interrupts a chance */
DPRINTF("Yield\n");
return;
}
/* get all host channel interrupts */
for (x = 0; x != sc->sc_host_ch_max; x++) {
temp = DWC_OTG_READ_4(sc, DOTG_HCINT(x));
if (temp != 0) {