diff options
-rw-r--r-- | sys/dev/amr/amr.c | 9 | ||||
-rw-r--r-- | sys/dev/amr/amrvar.h | 4 |
2 files changed, 9 insertions, 4 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); } diff --git a/sys/dev/amr/amrvar.h b/sys/dev/amr/amrvar.h index f3955a6..13e0f46 100644 --- a/sys/dev/amr/amrvar.h +++ b/sys/dev/amr/amrvar.h @@ -106,8 +106,8 @@ struct amr_softc void *amr_intr; /* mailbox */ - struct amr_mailbox *amr_mailbox; - struct amr_mailbox64 *amr_mailbox64; + volatile struct amr_mailbox *amr_mailbox; + volatile struct amr_mailbox64 *amr_mailbox64; u_int32_t amr_mailboxphys; bus_dma_tag_t amr_mailbox_dmat; bus_dmamap_t amr_mailbox_dmamap; |