Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/c48c50784340
branches:  netbsd-6
changeset: 776915:c48c50784340
user:      riz <riz%NetBSD.org@localhost>
date:      Thu Mar 05 22:21:02 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 45929f908e45 -r c48c50784340 sys/dev/ic/tulip.c
--- a/sys/dev/ic/tulip.c        Sat Feb 28 05:39:00 2015 +0000
+++ b/sys/dev/ic/tulip.c        Thu Mar 05 22:21:02 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.2.1 2015/03/05 22:21:02 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.2.1 2015/03/05 22:21:02 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