Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Sep 2003 15:02:17 -0700 (PDT)
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 38924 for review
Message-ID:  <200309302202.h8UM2HsO026596@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=38924

Change 38924 by imp@imp_koguchi on 2003/09/30 15:01:37

	More tweaking with input from jhb.
	
	phk has indicated he'd like to see new/old examples, so I'll try to
	do that later.  gotta get back to work.

Affected files ...

.. //depot/doc/strawman-driver.c#5 edit

Differences ...

==== //depot/doc/strawman-driver.c#5 (text+ko) ====

@@ -40,6 +40,7 @@
 foo_wakeup_my_sleepers(foo_softc *sc)
 {	
 	sc->dead = 1;				/* Race #1, c */
+	sc->d->si_drv1 = NULL;			/* Race #2, b */
 	mtx_lock(&sc->mtx);
 	cv_broadcast(&sc->cv);
 	mtx_unlock(&sc->mtx);
@@ -67,23 +68,23 @@
 {
 	sc = device_get_softc(dev);
 
-	sc->d->si_drv1 = NULL	/* Race #2, b */
+	foo_wakeup_my_sleepers(sc);
 
 	foo_disable_intr(sc);	/* disable hardware intr ??? */
 
 	/* Everybody active here */
-	callout_reset(&sc->stat_ch, hz, fxp_tick, sc);
+	if (callout_stop(&sc->stat_ch, hz, fxp_tick, sc) == 0)
+		printf("Maybe we just lost a race\n");
 
 	/* Network, ISR and devsw active */
 	bus_teardown_intr(sc->dev, sc->irq, sc->ih);
 
-	/* Network and devsw active */
+	/* network and devsw active */
+	destroy_dev(sc->d);
+
+	/* Network active */
 	ether_ifdetach(&sc->arpcom.ac_if);
 	sc->ih = NULL;
-	foo_wakeup_my_sleepers(sc);
-
-	/* devsw active */
-	destroy_dev(sc->d);
 
 	/* only mutex alive */
 	mtx_destroy(&sc->mtx);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309302202.h8UM2HsO026596>