Source-Changes-HG archive

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

[src/trunk]: src/sys pull down from usbmp branch:



details:   https://anonhg.NetBSD.org/src/rev/d7b50ab097ef
branches:  trunk
changeset: 777957:d7b50ab097ef
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Mar 11 00:34:45 2012 +0000

description:
pull down from usbmp branch:
- remove usbd_bus{} intr_context member, and replace the checks against
  it with cpu_intr_p() and cpu_softintr_p().

diffstat:

 sys/arch/mips/adm5120/dev/ahci.c |   8 ++------
 sys/dev/ic/sl811hs.c             |   9 +++------
 sys/dev/usb/ehci.c               |  17 +++++------------
 sys/dev/usb/ohci.c               |  15 +++++----------
 sys/dev/usb/uhci.c               |  16 +++++-----------
 sys/dev/usb/usbdi.c              |   8 ++++----
 sys/dev/usb/usbdivar.h           |   3 +--
 7 files changed, 25 insertions(+), 51 deletions(-)

diffs (truncated from 347 to 300 lines):

diff -r f1febcf76056 -r d7b50ab097ef sys/arch/mips/adm5120/dev/ahci.c
--- a/sys/arch/mips/adm5120/dev/ahci.c  Sun Mar 11 00:32:21 2012 +0000
+++ b/sys/arch/mips/adm5120/dev/ahci.c  Sun Mar 11 00:34:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahci.c,v 1.7 2011/07/01 18:38:49 dyoung Exp $  */
+/*     $NetBSD: ahci.c,v 1.8 2012/03/11 00:34:46 mrg Exp $     */
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.7 2011/07/01 18:38:49 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.8 2012/03/11 00:34:46 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -460,9 +460,7 @@
        xfer->actlen = 1;
        xfer->status = USBD_NORMAL_COMPLETION;
        s = splusb();
-       xfer->device->bus->intr_context++;
        usb_transfer_complete(xfer);
-       xfer->device->bus->intr_context--;
        splx(s);
 }
 
@@ -1289,9 +1287,7 @@
 
        xfer->status = USBD_NORMAL_COMPLETION;
        s = splusb();
-       xfer->device->bus->intr_context++;
        usb_transfer_complete(xfer);
-       xfer->device->bus->intr_context--;
        splx(s);
 }
 
diff -r f1febcf76056 -r d7b50ab097ef sys/dev/ic/sl811hs.c
--- a/sys/dev/ic/sl811hs.c      Sun Mar 11 00:32:21 2012 +0000
+++ b/sys/dev/ic/sl811hs.c      Sun Mar 11 00:34:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sl811hs.c,v 1.31 2011/11/27 14:36:20 rmind Exp $       */
+/*     $NetBSD: sl811hs.c,v 1.32 2012/03/11 00:34:46 mrg Exp $ */
 
 /*
  * Not (c) 2007 Matthew Orgass
@@ -84,7 +84,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.31 2011/11/27 14:36:20 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.32 2012/03/11 00:34:46 mrg Exp $");
 
 #include "opt_slhci.h"
 
@@ -1470,7 +1470,6 @@
 
        int repeat;
 
-       sc->sc_bus.intr_context++;
        start_cc_time(&t_callback, (u_int)xfer);
        simple_unlock(&sc->sc_lock);
        splx(*s);
@@ -1482,7 +1481,6 @@
        *s = splhardusb();
        simple_lock(&sc->sc_lock);
        stop_cc_time(&t_callback);
-       sc->sc_bus.intr_context--;
 
        if (repeat && !sc->sc_bus.use_polling)
                slhci_do_repeat(sc, xfer);
@@ -3660,8 +3658,7 @@
 
        DDOLOG("frame=%d rootintr=%p", t->frame, t->rootintr, 0,0);
 
-       DDOLOG("use_polling=%d intr_context=%d", ssc->sc_bus.use_polling,
-           ssc->sc_bus.intr_context, 0,0);
+       DDOLOG("use_polling=%d", ssc->sc_bus.use_polling, 0, 0, 0);
 }
 
 void
diff -r f1febcf76056 -r d7b50ab097ef sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Sun Mar 11 00:32:21 2012 +0000
+++ b/sys/dev/usb/ehci.c        Sun Mar 11 00:34:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.186 2012/03/06 03:35:29 mrg Exp $ */
+/*     $NetBSD: ehci.c,v 1.187 2012/03/11 00:34:45 mrg Exp $ */
 
 /*
  * Copyright (c) 2004-2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.186 2012/03/06 03:35:29 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.187 2012/03/11 00:34:45 mrg Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -68,6 +68,7 @@
 #include <sys/queue.h>
 #include <sys/mutex.h>
 #include <sys/bus.h>
+#include <sys/cpu.h>
 
 #include <machine/endian.h>
 
@@ -613,7 +614,6 @@
                return (0);
 
        EOWRITE4(sc, EHCI_USBSTS, intrs); /* Acknowledge */
-       sc->sc_bus.intr_context++;
        sc->sc_bus.no_intrs++;
        if (eintrs & EHCI_STS_IAA) {
                DPRINTF(("ehci_intr1: door bell\n"));
@@ -637,8 +637,6 @@
                eintrs &= ~EHCI_STS_PCD;
        }
 
-       sc->sc_bus.intr_context--;
-
        if (eintrs != 0) {
                /* Block unprocessed interrupts. */
                sc->sc_eintrs &= ~eintrs;
@@ -687,10 +685,7 @@
        ehci_softc_t *sc = bus->hci_private;
        struct ehci_xfer *ex, *nextex;
 
-       DPRINTFN(10,("%s: ehci_softintr (%d)\n", device_xname(sc->sc_dev),
-                    sc->sc_bus.intr_context));
-
-       sc->sc_bus.intr_context++;
+       DPRINTFN(10,("%s: ehci_softintr\n", device_xname(sc->sc_dev)));
 
        /*
         * The only explanation I can think of for why EHCI is as brain dead
@@ -713,8 +708,6 @@
                sc->sc_softwake = 0;
                wakeup(&sc->sc_softwake);
        }
-
-       sc->sc_bus.intr_context--;
 }
 
 /* Check for an interrupt. */
@@ -2916,7 +2909,7 @@
                return;
        }
 
-       if (xfer->device->bus->intr_context)
+       if (cpu_intr_p() || cpu_softintr_p())
                panic("ehci_abort_xfer: not in process context");
 
        /*
diff -r f1febcf76056 -r d7b50ab097ef sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Sun Mar 11 00:32:21 2012 +0000
+++ b/sys/dev/usb/ohci.c        Sun Mar 11 00:34:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.222 2012/03/10 23:01:07 mrg Exp $   */
+/*     $NetBSD: ohci.c,v 1.223 2012/03/11 00:34:46 mrg Exp $   */
 /*     $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $       */
 
 /*
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.222 2012/03/10 23:01:07 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.223 2012/03/11 00:34:46 mrg Exp $");
 
 #include "opt_usb.h"
 
@@ -53,8 +53,9 @@
 #include <sys/select.h>
 #include <sys/proc.h>
 #include <sys/queue.h>
-
 #include <sys/bus.h>
+#include <sys/cpu.h>
+
 #include <machine/endian.h>
 
 #include <dev/usb/usb.h>
@@ -1155,7 +1156,6 @@
                return (0);
        }
 
-       sc->sc_bus.intr_context++;
        sc->sc_bus.no_intrs++;
        if (eintrs & OHCI_SO) {
                sc->sc_overrun_cnt++;
@@ -1194,8 +1194,6 @@
                callout_reset(&sc->sc_tmo_rhsc, hz, ohci_rhsc_enable, sc);
        }
 
-       sc->sc_bus.intr_context--;
-
        if (eintrs != 0) {
                /* Block unprocessed interrupts. */
                OWRITE4(sc, OHCI_INTERRUPT_DISABLE, eintrs);
@@ -1255,8 +1253,6 @@
 
        DPRINTFN(10,("ohci_softintr: enter\n"));
 
-       sc->sc_bus.intr_context++;
-
        s = splhardusb();
        usb_syncmem(&sc->sc_hccadma, offsetof(struct ohci_hcca, hcca_done_head),
            sizeof(sc->sc_hcca->hcca_done_head),
@@ -1462,7 +1458,6 @@
                wakeup(&sc->sc_softwake);
        }
 
-       sc->sc_bus.intr_context--;
        DPRINTFN(10,("ohci_softintr: done:\n"));
 }
 
@@ -2240,7 +2235,7 @@
                return;
        }
 
-       if (xfer->device->bus->intr_context)
+       if (cpu_intr_p() || cpu_softintr_p())
                panic("ohci_abort_xfer: not in process context");
 
        /*
diff -r f1febcf76056 -r d7b50ab097ef sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Sun Mar 11 00:32:21 2012 +0000
+++ b/sys/dev/usb/uhci.c        Sun Mar 11 00:34:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.246 2012/03/10 23:01:07 mrg Exp $   */
+/*     $NetBSD: uhci.c,v 1.247 2012/03/11 00:34:46 mrg Exp $   */
 /*     $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $       */
 
 /*
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.246 2012/03/10 23:01:07 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.247 2012/03/11 00:34:46 mrg Exp $");
 
 #include "opt_usb.h"
 
@@ -56,6 +56,7 @@
 #include <sys/proc.h>
 #include <sys/queue.h>
 #include <sys/bus.h>
+#include <sys/cpu.h>
 
 #include <machine/endian.h>
 
@@ -1014,9 +1015,7 @@
        xfer->actlen = 1;
        xfer->status = USBD_NORMAL_COMPLETION;
        s = splusb();
-       xfer->device->bus->intr_context++;
        usb_transfer_complete(xfer);
-       xfer->device->bus->intr_context--;
        splx(s);
 }
 
@@ -1349,10 +1348,7 @@
        uhci_softc_t *sc = bus->hci_private;
        uhci_intr_info_t *ii, *nextii;
 
-       DPRINTFN(10,("%s: uhci_softintr (%d)\n", device_xname(sc->sc_dev),
-                    sc->sc_bus.intr_context));
-
-       sc->sc_bus.intr_context++;
+       DPRINTFN(10,("%s: uhci_softintr\n", device_xname(sc->sc_dev)));
 
        /*
         * Interrupts on UHCI really suck.  When the host controller
@@ -1374,8 +1370,6 @@
                sc->sc_softwake = 0;
                wakeup(&sc->sc_softwake);
        }
-
-       sc->sc_bus.intr_context--;
 }
 
 /* Check for an interrupt. */
@@ -2078,7 +2072,7 @@
                return;
        }
 
-       if (xfer->device->bus->intr_context)
+       if (cpu_intr_p() || cpu_softintr_p())
                panic("uhci_abort_xfer: not in process context");
 
        /*
diff -r f1febcf76056 -r d7b50ab097ef sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Sun Mar 11 00:32:21 2012 +0000
+++ b/sys/dev/usb/usbdi.c       Sun Mar 11 00:34:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.135 2012/03/06 02:36:46 mrg Exp $  */
+/*     $NetBSD: usbdi.c,v 1.136 2012/03/11 00:34:46 mrg Exp $  */
 /*     $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $      */



Home | Main Index | Thread Index | Old Index