Source-Changes-HG archive

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

[src/netbsd-6-0]: src/sys/dev/ic Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/4f96dc01a7b8
branches:  netbsd-6-0
changeset: 775055:4f96dc01a7b8
user:      riz <riz%NetBSD.org@localhost>
date:      Thu Mar 05 22:22:30 2015 +0000

description:
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.

diffstat:

 sys/dev/ic/tulip.c |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (45 lines):

diff -r 7445192ca4f5 -r 4f96dc01a7b8 sys/dev/ic/tulip.c
--- a/sys/dev/ic/tulip.c        Sat Feb 28 05:36:47 2015 +0000
+++ b/sys/dev/ic/tulip.c        Thu Mar 05 22:22:30 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tulip.c,v 1.180 2012/02/02 19:43:03 tls Exp $  */
+/*     $NetBSD: tulip.c,v 1.180.6.1 2015/03/05 22:22:30 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.6.1 2015/03/05 22:22:30 riz Exp $");
 
 
 #include <sys/param.h>
@@ -595,7 +595,7 @@
        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 @@
        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 */



Home | Main Index | Thread Index | Old Index