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.
This commit is contained in:
Warner Losh 2009-02-17 02:14:04 +00:00
parent 2e46610e21
commit 993b1ae273
3 changed files with 11 additions and 0 deletions

View file

@ -499,6 +499,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

View file

@ -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)

View file

@ -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 */