aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pccbb/pccbb.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2012-01-27 21:49:02 +0000
committerWarner Losh <imp@FreeBSD.org>2012-01-27 21:49:02 +0000
commitdbd618bf56628596bd8bd739953f6e4f934d5253 (patch)
treea3b61be1abd067c97b96c2fc152f0e4b559e8a49 /sys/dev/pccbb/pccbb.c
parent263811f7244e52093fcab55bbbf8da19f7a186c8 (diff)
downloadsrc-dbd618bf56628596bd8bd739953f6e4f934d5253.tar.gz
src-dbd618bf56628596bd8bd739953f6e4f934d5253.zip
Some laptops have weak power controllers that cannot tolerate multiple
cards powering up at once. Work around the easy case (multiple cards inserted on boot) with a short sleep and a long comment. This improves reliability on those laptops with power hungry cards.
Notes
Notes: svn path=/head/; revision=230626
Diffstat (limited to 'sys/dev/pccbb/pccbb.c')
-rw-r--r--sys/dev/pccbb/pccbb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index b116b54de503..cd3e3cf6ede0 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -460,6 +460,13 @@ cbb_event_thread(void *arg)
int err;
int not_a_card = 0;
+ /*
+ * We need to act as a power sequencer on startup. Delay 2s/channel
+ * to ensure the other channels have had a chance to come up. We likely
+ * should add a lock that's shared on a per-slot basis so that only
+ * one power event can happen per slot at a time.
+ */
+ pause("cbbstart", hz * device_get_unit(sc->dev) * 2);
mtx_lock(&sc->mtx);
sc->flags |= CBB_KTHREAD_RUNNING;
while ((sc->flags & CBB_KTHREAD_DONE) == 0) {