Module Name: src Committed By: riz Date: Thu Mar 5 22:22:53 UTC 2015
Modified Files: src/sys/dev/ic [netbsd-6-1]: tulip.c Log Message: Pull up following revision(s) (requested by nakayama in ticket #1262): sys/dev/ic/tulip.c: revision 1.185 Stop the interface before detaching to avoid the race between tlp_detach() and tlp_intr(). While there, add missing callout_destroy()s. To generate a diff of this commit: cvs rdiff -u -r1.180 -r1.180.8.1 src/sys/dev/ic/tulip.c 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/ic/tulip.c diff -u src/sys/dev/ic/tulip.c:1.180 src/sys/dev/ic/tulip.c:1.180.8.1 --- src/sys/dev/ic/tulip.c:1.180 Thu Feb 2 19:43:03 2012 +++ src/sys/dev/ic/tulip.c Thu Mar 5 22:22:53 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tulip.c,v 1.180 2012/02/02 19:43:03 tls Exp $ */ +/* $NetBSD: tulip.c,v 1.180.8.1 2015/03/05 22:22:53 riz Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.180 2012/02/02 19:43:03 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.180.8.1 2015/03/05 22:22:53 riz Exp $"); #include <sys/param.h> @@ -595,7 +595,7 @@ tlp_detach(struct tulip_softc *sc) struct tulip_rxsoft *rxs; struct tulip_txsoft *txs; device_t self = sc->sc_dev; - int i; + int i, s; /* * Succeed now if there isn't any work to do. @@ -603,9 +603,14 @@ tlp_detach(struct tulip_softc *sc) if ((sc->sc_flags & TULIPF_ATTACHED) == 0) return (0); - /* Unhook our tick handler. */ - if (sc->sc_tick) - callout_stop(&sc->sc_tick_callout); + s = splnet(); + /* Stop the interface. Callouts are stopped in it. */ + tlp_stop(ifp, 1); + splx(s); + + /* Destroy our callouts. */ + callout_destroy(&sc->sc_nway_callout); + callout_destroy(&sc->sc_tick_callout); if (sc->sc_flags & TULIPF_HAS_MII) { /* Detach all PHYs */