Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb traverse active list with TAILQ_FOREACH_SAFE in ...



details:   https://anonhg.NetBSD.org/src/rev/27e97ff667b8
branches:  trunk
changeset: 783920:27e97ff667b8
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jan 12 18:37:09 2013 +0000

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

diffstat:

 sys/dev/usb/dwc_otg.c |  13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diffs (41 lines):

diff -r bd2a662abf63 -r 27e97ff667b8 sys/dev/usb/dwc_otg.c
--- a/sys/dev/usb/dwc_otg.c     Sat Jan 12 18:32:12 2013 +0000
+++ b/sys/dev/usb/dwc_otg.c     Sat Jan 12 18:37:09 2013 +0000
@@ -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 @@
        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 @@
                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) {



Home | Main Index | Thread Index | Old Index