Module Name:    src
Committed By:   jmcneill
Date:           Sat Jan 12 18:37:10 UTC 2013

Modified Files:
        src/sys/dev/usb: dwc_otg.c

Log Message:
traverse active list with TAILQ_FOREACH_SAFE in dwc_otg_interrupt_poll so the 
process doesnt get restarted whenever a transfer completes


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/usb/dwc_otg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/dwc_otg.c
diff -u src/sys/dev/usb/dwc_otg.c:1.15 src/sys/dev/usb/dwc_otg.c:1.16
--- src/sys/dev/usb/dwc_otg.c:1.15	Sat Jan 12 16:32:16 2013
+++ src/sys/dev/usb/dwc_otg.c	Sat Jan 12 18:37:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc_otg.c,v 1.15 2013/01/12 16:32:16 jmcneill Exp $	*/
+/*	$NetBSD: dwc_otg.c,v 1.16 2013/01/12 18:37:09 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.15 2013/01/12 16:32:16 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_otg.c,v 1.16 2013/01/12 18:37:09 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3255,7 +3255,7 @@ dwc_otg_interrupt_poll(struct dwc_otg_so
 	uint8_t ch;
 	uint32_t temp;
 	uint32_t intrs;
-	struct dwc_otg_xfer *dxfer;
+	struct dwc_otg_xfer *dxfer, *tmp;
 	uint8_t got_rx_status;
 
 // 	DPRINTF("\n");
@@ -3344,11 +3344,8 @@ repeat:
 		got_rx_status = 1;
 	}
 
-	TAILQ_FOREACH(dxfer, &sc->sc_active, xnext) {
-		if (!dwc_otg_xfer_do_fifo(&dxfer->xfer)) {
-			/* queue has been modified */
-			goto repeat;
-		}
+	TAILQ_FOREACH_SAFE(dxfer, &sc->sc_active, xnext, tmp) {
+		dwc_otg_xfer_do_fifo(&dxfer->xfer);
 	}
 
 	if (got_rx_status) {

Reply via email to