Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Feb 2009 02:14:04 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r188701 - head/sys/dev/pccbb
Message-ID:  <200902170214.n1H2E4mW000570@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



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