From owner-svn-src-head@FreeBSD.ORG Tue Feb 17 02:14:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 496761065673; Tue, 17 Feb 2009 02:14:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DDEF8FC14; Tue, 17 Feb 2009 02:14:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1H2E5En000573; Tue, 17 Feb 2009 02:14:05 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1H2E4mW000570; Tue, 17 Feb 2009 02:14:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200902170214.n1H2E4mW000570@svn.freebsd.org> From: Warner Losh Date: Tue, 17 Feb 2009 02:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188701 - head/sys/dev/pccbb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 02:14:05 -0000 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 */