Module Name:    src
Committed By:   martin
Date:           Sun Jun 14 08:46:33 UTC 2015

Modified Files:
        src/sys/dev/pci: if_bge.c if_bgevar.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.291 -r1.292 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/if_bgevar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.291 src/sys/dev/pci/if_bge.c:1.292
--- src/sys/dev/pci/if_bge.c:1.291	Sat May 23 13:44:40 2015
+++ src/sys/dev/pci/if_bge.c	Sun Jun 14 08:46:33 2015
@@ -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_tick(void *xsc)
 
 	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 @@ bge_stop(struct ifnet *ifp, int disable)
 {
 	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. */

Index: src/sys/dev/pci/if_bgevar.h
diff -u src/sys/dev/pci/if_bgevar.h:1.19 src/sys/dev/pci/if_bgevar.h:1.20
--- src/sys/dev/pci/if_bgevar.h:1.19	Sun May 17 12:06:26 2015
+++ src/sys/dev/pci/if_bgevar.h	Sun Jun 14 08:46:33 2015
@@ -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 @@ struct bge_softc {
 	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];
 

Reply via email to