aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pccbb/pccbb.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2011-06-18 02:25:08 +0000
committerWarner Losh <imp@FreeBSD.org>2011-06-18 02:25:08 +0000
commit0b96c05a7a0b32ce6776ba6ad48d061c8f69923f (patch)
treec757174a5a49f34714a44f88c9a9fdaad7320483 /sys/dev/pccbb/pccbb.c
parenta57971c6798e9e5b1b96773fb3645932b8482ac0 (diff)
downloadsrc-0b96c05a7a0b32ce6776ba6ad48d061c8f69923f.tar.gz
src-0b96c05a7a0b32ce6776ba6ad48d061c8f69923f.zip
After we get a good power signal, always wait about 10ms before
proceeding. On boot, some laptops with certain cards in them sometimes fail on boot, but if the card is inserted after boot it works. Experiments show that small delays here makes things more reliable. It is believed that some combinations need a little more time before the power on the card is really stable enough to be reliable once the power is stable in the bridge.
Notes
Notes: svn path=/head/; revision=223218
Diffstat (limited to 'sys/dev/pccbb/pccbb.c')
-rw-r--r--sys/dev/pccbb/pccbb.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index bbb9eae14164..7382c7c964c4 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -800,24 +800,36 @@ cbb_power(device_t brdev, int volts)
* We have a shortish timeout of 500ms here. Some bridges do
* not generate a POWER_CYCLE event for 16-bit cards. In
* those cases, we have to cope the best we can, and having
- * only a short delay is better than the alternatives.
+ * only a short delay is better than the alternatives. Others
+ * raise the power cycle a smidge before it is really ready.
+ * We deal with those below.
*/
sane = 10;
while (!(cbb_get(sc, CBB_SOCKET_STATE) & CBB_STATE_POWER_CYCLE) &&
cnt == sc->powerintr && sane-- > 0)
msleep(&sc->powerintr, &sc->mtx, 0, "-", hz / 20);
mtx_unlock(&sc->mtx);
+
+ /*
+ * Relax for 10ms. Some bridges appear to assert this signal
+ * right away, but before the card has stabilized. Other
+ * cards need need more time to cope up reliabily.
+ * Experiments with troublesome setups show this to be a
+ * "cheap" way to enhance reliabilty. We need not do this for
+ * "off" since we don't touch the card after we turn it off.
+ */
+ pause("cbbPwr", min(hz / 100, 1));
+
/*
* The TOPIC95B requires a little bit extra time to get its
* act together, so delay for an additional 100ms. Also as
* documented below, it doesn't seem to set the POWER_CYCLE
* bit, so don't whine if it never came on.
*/
- if (sc->chipset == CB_TOPIC95) {
+ if (sc->chipset == CB_TOPIC95)
pause("cbb95B", hz / 10);
- } else if (sane <= 0) {
+ else if (sane <= 0)
device_printf(sc->dev, "power timeout, doom?\n");
- }
}
/*