svn commit: r188701 - head/sys/dev/pccbb

Warner Losh imp at FreeBSD.org
Mon Feb 16 18:14:05 PST 2009


Author: imp
Date: Tue Feb 17 02:14:04 2009
New Revision: 188701
URL: http://svn.freebsd.org/changeset/base/188701

Log:
  Hold off root mounting until we've gone through the loop of our thread
  almost once.  After we've configured the devices that were present the
  first time through, then we know that we're done.  If the device has
  other devices that are deferred, then it must do a similar dance.
  This catches both PC Cards and CardBus cards.

Modified:
  head/sys/dev/pccbb/pccbb.c
  head/sys/dev/pccbb/pccbb_pci.c
  head/sys/dev/pccbb/pccbbvar.h

Modified: head/sys/dev/pccbb/pccbb.c
==============================================================================
--- head/sys/dev/pccbb/pccbb.c	Mon Feb 16 22:25:39 2009	(r188700)
+++ head/sys/dev/pccbb/pccbb.c	Tue Feb 17 02:14:04 2009	(r188701)
@@ -500,6 +500,15 @@ cbb_event_thread(void *arg)
 		mtx_unlock(&Giant);
 
 		/*
+		 * First time through we need to tell mountroot that we're
+		 * done.
+		 */
+		if (sc->sc_root_token) {
+			root_mount_rel(sc->sc_root_token);
+			sc->sc_root_token = NULL;
+		}
+
+		/*
 		 * Wait until it has been 250ms since the last time we
 		 * get an interrupt.  We handle the rest of the interrupt
 		 * at the top of the loop.  Although we clear the bit in the

Modified: head/sys/dev/pccbb/pccbb_pci.c
==============================================================================
--- head/sys/dev/pccbb/pccbb_pci.c	Mon Feb 16 22:25:39 2009	(r188700)
+++ head/sys/dev/pccbb/pccbb_pci.c	Tue Feb 17 02:14:04 2009	(r188701)
@@ -439,6 +439,7 @@ cbb_pci_attach(device_t brdev)
 		device_printf(brdev, "unable to create event thread.\n");
 		panic("cbb_create_event_thread");
 	}
+	sc->sc_root_token = root_mount_hold(device_get_nameunit(sc->dev));
 	return (0);
 err:
 	if (sc->irq_res)

Modified: head/sys/dev/pccbb/pccbbvar.h
==============================================================================
--- head/sys/dev/pccbb/pccbbvar.h	Mon Feb 16 22:25:39 2009	(r188700)
+++ head/sys/dev/pccbb/pccbbvar.h	Tue Feb 17 02:14:04 2009	(r188701)
@@ -88,6 +88,7 @@ struct cbb_softc {
 	struct proc	*event_thread;
 	void (*chipinit)(struct cbb_softc *);
 	int	powerintr;
+	struct root_hold_token *sc_root_token;
 };
 
 /* result of detect_card */


More information about the svn-src-head mailing list