Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jul 2015 09:12:32 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286118 - head/sys/dev/usb/controller
Message-ID:  <201507310912.t6V9CW6D027713@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507310912.t6V9CW6D027713>