Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Make sure not to re-arm the statistics callout w...



details:   https://anonhg.NetBSD.org/src/rev/636161397480
branches:  trunk
changeset: 338883:636161397480
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jun 14 08:46:33 2015 +0000

description:
Make sure not to re-arm the statistics callout when we are about to detach.

diffstat:

 sys/dev/pci/if_bge.c    |  12 +++++++-----
 sys/dev/pci/if_bgevar.h |   3 ++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diffs (58 lines):

diff -r 49c4e39ff92c -r 636161397480 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Sun Jun 14 08:32:02 2015 +0000
+++ b/sys/dev/pci/if_bge.c      Sun Jun 14 08:46:33 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bge.c,v 1.291 2015/05/23 13:44:40 msaitoh Exp $     */
+/*     $NetBSD: if_bge.c,v 1.292 2015/06/14 08:46:33 martin Exp $      */
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.291 2015/05/23 13:44:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.292 2015/06/14 08:46:33 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -4863,7 +4863,8 @@
 
        bge_asf_driver_up(sc);
 
-       callout_reset(&sc->bge_timeout, hz, bge_tick, sc);
+       if (!sc->bge_detaching)
+               callout_reset(&sc->bge_timeout, hz, bge_tick, sc);
 
        splx(s);
 }
@@ -5890,9 +5891,10 @@
 {
        struct bge_softc *sc = ifp->if_softc;
 
-       if (disable)
+       if (disable) {
+               sc->bge_detaching = 1;
                callout_halt(&sc->bge_timeout, NULL);
-       else
+       } else
                callout_stop(&sc->bge_timeout);
 
        /* Disable host interrupts. */
diff -r 49c4e39ff92c -r 636161397480 sys/dev/pci/if_bgevar.h
--- a/sys/dev/pci/if_bgevar.h   Sun Jun 14 08:32:02 2015 +0000
+++ b/sys/dev/pci/if_bgevar.h   Sun Jun 14 08:46:33 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bgevar.h,v 1.19 2015/05/17 12:06:26 msaitoh Exp $   */
+/*     $NetBSD: if_bgevar.h,v 1.20 2015/06/14 08:46:33 martin Exp $    */
 /*
  * Copyright (c) 2001 Wind River Systems
  * Copyright (c) 1997, 1998, 1999, 2001
@@ -338,6 +338,7 @@
        int                     bge_txcnt;
        struct callout          bge_timeout;
        int                     bge_pending_rxintr_change;
+       int                     bge_detaching;
        SLIST_HEAD(, txdmamap_pool_entry) txdma_list;
        struct txdmamap_pool_entry *txdma[BGE_TX_RING_CNT];
 



Home | Main Index | Thread Index | Old Index