summaryrefslogtreecommitdiffstats
path: root/sys/dev/amr/amr.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2000-03-23 18:33:19 +0000
committermsmith <msmith@FreeBSD.org>2000-03-23 18:33:19 +0000
commit2054c7bab47b0600e4308a6dd0d6d9f7605067ee (patch)
tree748794e9e4675cd48d8499df036d1faa3f4c1be6 /sys/dev/amr/amr.c
parentf3ae48fd505aa13a32ee063d82a80ed52e7a298f (diff)
downloadFreeBSD-src-2054c7bab47b0600e4308a6dd0d6d9f7605067ee.zip
FreeBSD-src-2054c7bab47b0600e4308a6dd0d6d9f7605067ee.tar.gz
Fix detection of the card-ready-for-command state. Use an ultimate
timeout closer to the 1-second value that AMI use in their Linux driver, and mark the mailbox structures as volatile so that gcc doesn't over-optimise access to them. This should fix the "controller wedged" bug. Submitted by: Brian Dean <brdean@unx.sas.com>
Diffstat (limited to 'sys/dev/amr/amr.c')
-rw-r--r--sys/dev/amr/amr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c
index 6d7524d..3145e08 100644
--- a/sys/dev/amr/amr.c
+++ b/sys/dev/amr/amr.c
@@ -1126,7 +1126,7 @@ amr_start(struct amr_command *ac)
/* spin waiting for the mailbox */
debug("wait for mailbox");
- for (i = 100000, done = 0, worked = 0; (i > 0) && !done; i--) {
+ for (i = 10000, done = 0, worked = 0; (i > 0) && !done; i--) {
s = splbio();
/* is the mailbox free? */
@@ -1142,7 +1142,12 @@ amr_start(struct amr_command *ac)
/* not free, try to clean up while we wait */
} else {
debug("busy flag %x\n", sc->amr_mailbox->mb_busy);
- worked = amr_done(sc);
+ /* try to kill some time being useful */
+ if (amr_done(sc)) {
+ worked = 1;
+ } else {
+ DELAY(100);
+ }
}
splx(s);
}
OpenPOWER on IntegriCloud