In fxp_detach(), disable interrupts after fxp_stop(), since software resetting
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 28 Dec 2005 10:28:24 +0000 (10:28 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 28 Dec 2005 10:28:24 +0000 (10:28 +0000)
in fxp_stop() may leave interrupts turned on (*).

(*) My "Intel 82559 Pro/100 Ethernet" always does this

sys/dev/netif/fxp/if_fxp.c

index 6c92e39..d4555d8 100644 (file)
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.110.2.30 2003/06/12 16:47:05 mux Exp $
- * $DragonFly: src/sys/dev/netif/fxp/if_fxp.c,v 1.40 2005/12/17 09:09:21 sephe Exp $
+ * $DragonFly: src/sys/dev/netif/fxp/if_fxp.c,v 1.41 2005/12/28 10:28:24 sephe Exp $
  */
 
 /*
@@ -732,9 +732,6 @@ fxp_detach(device_t dev)
 {
        struct fxp_softc *sc = device_get_softc(dev);
 
-       /* disable interrupts */
-       CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE);
-
        lwkt_serialize_enter(sc->arpcom.ac_if.if_serializer);
 
        /*
@@ -742,6 +739,14 @@ fxp_detach(device_t dev)
         */
        fxp_stop(sc);
 
+       /*
+        * Disable interrupts.
+        *
+        * NOTE: This should be done after fxp_stop(), because software
+        * resetting in fxp_stop() may leave interrupts turned on.
+        */
+       CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE);
+
        /*
         * Close down routes etc.
         */