PERFORCE change 106679 for review

Warner Losh imp at FreeBSD.org
Mon Sep 25 12:06:28 PDT 2006


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

Change 106679 by imp at imp_lighthouse on 2006/09/25 19:05:44

	Defer probing of mmc bus til we have a sane system running.

Affected files ...

.. //depot/projects/arm/src/sys/dev/mmc/mmc.c#2 edit

Differences ...

==== //depot/projects/arm/src/sys/dev/mmc/mmc.c#2 (text+ko) ====

@@ -40,6 +40,7 @@
 struct mmc_softc {
 	device_t dev;
 	struct mtx sc_mtx;
+	struct intr_config_hook config_intrhook;
 };
 
 /* bus entry points */
@@ -56,6 +57,8 @@
 #define MMC_ASSERT_LOCKED(_sc)	mtx_assert(&_sc->sc_mtx, MA_OWNED);
 #define MMC_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED);
 
+static void mmc_delayed_attach(void *);
+
 static int
 mmc_probe(device_t dev)
 {
@@ -73,6 +76,11 @@
 	sc->dev = dev;
 	MMC_LOCK_INIT(sc);
 
+	/* We'll probe and attach our children later, but before / mount */
+	sc->config_intrhook.ich_func = mmc_delayed_attach;
+	sc->config_intrhook.ich_arg = sc;
+	if (config_intrhook_establish(&sc->config_intrhook) != 0)
+		device_printf(dev, "config_intrhook_establish failed\n");
 	return (0);
 }
 
@@ -82,6 +90,15 @@
 	return (EBUSY);	/* XXX */
 }
 
+static void
+mmc_delayed_attach(void *xsc)
+{
+	struct mmc_softc *sc = xsc;
+	
+	device_printf(sc->dev, "insert mmc/sd probe code here\n");
+	config_intrhook_disestablish(&sc->config_intrhook);
+}
+
 static device_method_t mmc_methods[] = {
 	DEVMETHOD(device_probe, mmc_probe),
 	DEVMETHOD(device_attach, mmc_attach),


More information about the p4-projects mailing list