svn commit: r286118 - head/sys/dev/usb/controller

Hans Petter Selasky hselasky at FreeBSD.org
Fri Jul 31 09:12:32 UTC 2015


Author: hselasky
Date: Fri Jul 31 09:12:31 2015
New Revision: 286118
URL: https://svnweb.freebsd.org/changeset/base/286118

Log:
  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 at gmail.com>

Modified:
  head/sys/dev/usb/controller/dwc_otg.c

Modified: head/sys/dev/usb/controller/dwc_otg.c
==============================================================================
--- head/sys/dev/usb/controller/dwc_otg.c	Fri Jul 31 09:10:56 2015	(r286117)
+++ head/sys/dev/usb/controller/dwc_otg.c	Fri Jul 31 09:12:31 2015	(r286118)
@@ -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) {


More information about the svn-src-all mailing list