aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pccbb/pccbb.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2007-03-04 19:33:12 +0000
committerWarner Losh <imp@FreeBSD.org>2007-03-04 19:33:12 +0000
commit8c6c85bef3498a69e0753844f29e40bb81714a7a (patch)
treecc34f425df8aae8204ede4cb8707465c8057aa66 /sys/dev/pccbb/pccbb.c
parent92cb9e01dc24c72dd3621212f497470ce32e99c1 (diff)
downloadsrc-8c6c85bef3498a69e0753844f29e40bb81714a7a.tar.gz
src-8c6c85bef3498a69e0753844f29e40bb81714a7a.zip
Reduce the number of retries to 10 from 20 for not_a_card retry test.
Add some comments to explain how 10 was picked. 20 was completely arbitrary, at least 10 has some reasoning behind it. Also, update the comments about how long we sleep to reflect the new, shorter timeout we use.
Notes
Notes: svn path=/head/; revision=167208
Diffstat (limited to 'sys/dev/pccbb/pccbb.c')
-rw-r--r--sys/dev/pccbb/pccbb.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index d66e59bf0f4b..48e17f127e85 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -486,10 +486,13 @@ cbb_event_thread(void *arg)
cbb_removal(sc);
} else if (status & CBB_STATE_NOT_A_CARD) {
/*
- * Up to 20 times, try to rescan the card when we
- * see NOT_A_CARD.
+ * Up to 10 times, try to rescan the card when we see
+ * NOT_A_CARD. 10 is somehwat arbitrary. When this
+ * pathology hits, there's a ~40% chance each try will
+ * fail. 10 tries takes about 5s and results in a
+ * 99.99% certainty of the results.
*/
- if (not_a_card++ < 20) {
+ if (not_a_card++ < 10) {
DEVPRINTF((sc->dev,
"Not a card bit set, rescanning\n"));
cbb_setb(sc, CBB_SOCKET_FORCE, CBB_FORCE_CV_TEST);
@@ -504,12 +507,12 @@ cbb_event_thread(void *arg)
mtx_unlock(&Giant);
/*
- * Wait until it has been 1s since the last time we
+ * 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
* ISR, we signal sc->cv from the detach path after we've
* set the CBB_KTHREAD_DONE bit, so we can't do a simple
- * 1s sleep here.
+ * 250ms sleep here.
*
* In our ISR, we turn off the card changed interrupt. Turn
* them back on here before we wait for them to happen. We