PERFORCE change 38924 for review

Warner Losh imp at FreeBSD.org
Tue Sep 30 15:02:19 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=38924

Change 38924 by imp at 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);


More information about the p4-releng mailing list