Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Make sure timeouts count as interrupt context too.



details:   https://anonhg.NetBSD.org/src/rev/a727e7dfea0a
branches:  trunk
changeset: 476334:a727e7dfea0a
user:      augustss <augustss%NetBSD.org@localhost>
date:      Mon Sep 13 19:49:41 1999 +0000

description:
Make sure timeouts count as interrupt context too.

diffstat:

 sys/dev/usb/TODO       |   2 ++
 sys/dev/usb/ohci.c     |   9 ++++++---
 sys/dev/usb/uhci.c     |  11 ++++++++---
 sys/dev/usb/usbdivar.h |   6 +++---
 4 files changed, 19 insertions(+), 9 deletions(-)

diffs (118 lines):

diff -r f0425899a8de -r a727e7dfea0a sys/dev/usb/TODO
--- a/sys/dev/usb/TODO  Mon Sep 13 19:36:30 1999 +0000
+++ b/sys/dev/usb/TODO  Mon Sep 13 19:49:41 1999 +0000
@@ -43,6 +43,8 @@
        declare all local definitions static
        rename s/request/xfer/
        use usb_ and usbd_ consistently
+       rename s/r/err/
+       use implicit test for no err
        indent continuation lines according to KNF
        rearrange the contents and names of some files (Nick)
 
diff -r f0425899a8de -r a727e7dfea0a sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Mon Sep 13 19:36:30 1999 +0000
+++ b/sys/dev/usb/ohci.c        Mon Sep 13 19:49:41 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.44 1999/09/13 19:18:17 augustss Exp $       */
+/*     $NetBSD: ohci.c,v 1.45 1999/09/13 19:49:41 augustss Exp $       */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -668,7 +668,7 @@
        if (!eintrs)
                return (0);
 
-       sc->sc_bus.intr_context = 1;
+       sc->sc_bus.intr_context++;
        sc->sc_bus.no_intrs++;
        DPRINTFN(7, ("ohci_intr: sc=%p intrs=%x(%x) eintr=%x\n", 
                     sc, (u_int)intrs, OREAD4(sc, OHCI_INTERRUPT_STATUS),
@@ -704,7 +704,7 @@
                ohci_rhsc_able(sc, 0);
        }
 
-       sc->sc_bus.intr_context = 0;
+       sc->sc_bus.intr_context--;
 
        /* Block unprocessed interrupts. XXX */
        OWRITE4(sc, OHCI_INTERRUPT_DISABLE, intrs);
@@ -1212,7 +1212,10 @@
        usbd_request_handle reqh = addr;
 
        DPRINTF(("ohci_timeout: reqh=%p\n", reqh));
+
+       reqh->device->bus->intr_context++;
        ohci_abort_req(reqh, USBD_TIMEOUT);
+       reqh->device->bus->intr_context--;
 }
 
 #ifdef USB_DEBUG
diff -r f0425899a8de -r a727e7dfea0a sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Mon Sep 13 19:36:30 1999 +0000
+++ b/sys/dev/usb/uhci.c        Mon Sep 13 19:49:41 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.50 1999/09/13 19:18:17 augustss Exp $       */
+/*     $NetBSD: uhci.c,v 1.51 1999/09/13 19:49:41 augustss Exp $       */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -613,7 +613,9 @@
        reqh->status = USBD_NORMAL_COMPLETION;
        s = splusb();
        reqh->hcpriv = 0;
+       reqh->device->bus->intr_context++;
        usb_transfer_complete(reqh);
+       reqh->device->bus->intr_context--;
        splx(s);
 }
 
@@ -808,7 +810,7 @@
        else    /* nothing to acknowledge */
                return (0);
 
-       sc->sc_bus.intr_context = 1;
+       sc->sc_bus.intr_context++;
        sc->sc_bus.no_intrs++;
 
        /*
@@ -827,7 +829,7 @@
 
        DPRINTFN(10, ("uhci_intr: exit\n"));
 
-       sc->sc_bus.intr_context = 0;
+       sc->sc_bus.intr_context--;
 
        return (1);
 }
@@ -995,7 +997,10 @@
        uhci_intr_info_t *ii = addr;
 
        DPRINTF(("uhci_timeout: ii=%p\n", ii));
+
+       ii->reqh->device->bus->intr_context++;
        uhci_abort_req(ii->reqh, USBD_TIMEOUT);
+       ii->reqh->device->bus->intr_context--;
 }
 
 /*
diff -r f0425899a8de -r a727e7dfea0a sys/dev/usb/usbdivar.h
--- a/sys/dev/usb/usbdivar.h    Mon Sep 13 19:36:30 1999 +0000
+++ b/sys/dev/usb/usbdivar.h    Mon Sep 13 19:49:41 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdivar.h,v 1.31 1999/09/13 19:18:18 augustss Exp $   */
+/*     $NetBSD: usbdivar.h,v 1.32 1999/09/13 19:49:41 augustss Exp $   */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -98,8 +98,8 @@
        char                    use_polling;
        struct usb_softc       *usbctl;
        struct usb_device_stats stats;
-       u_char                  intr_context;
-       int                     no_intrs;
+       int                     intr_context;
+       u_int                   no_intrs;
 #if defined(__NetBSD__) || defined(__OpenBSD__)
        bus_dma_tag_t           dmatag; /* DMA tag */
 #endif



Home | Main Index | Thread Index | Old Index