summaryrefslogtreecommitdiffstats
path: root/sys/dev/amr/amr.c
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2008-07-20 16:50:14 +0000
committerscottl <scottl@FreeBSD.org>2008-07-20 16:50:14 +0000
commit00653a63b3d7b26afb7e99a88041d111fba5048f (patch)
tree80f5c2634d74aecef1fb7095ed83556383185e72 /sys/dev/amr/amr.c
parent65211db2c166fabd2d0d3b908cd58cadcc5b098a (diff)
downloadFreeBSD-src-00653a63b3d7b26afb7e99a88041d111fba5048f.zip
FreeBSD-src-00653a63b3d7b26afb7e99a88041d111fba5048f.tar.gz
While spin-waiting for the mailbox semaphore to update, do flushing reads of
PCI bus so that we don't have to wait more than needed.
Diffstat (limited to 'sys/dev/amr/amr.c')
-rw-r--r--sys/dev/amr/amr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c
index b394950..d586a36 100644
--- a/sys/dev/amr/amr.c
+++ b/sys/dev/amr/amr.c
@@ -2082,8 +2082,11 @@ amr_quartz_submit_command(struct amr_command *ac)
int i = 0;
mtx_lock(&sc->amr_hw_lock);
- while (sc->amr_mailbox->mb_busy && (i++ < 10))
+ while (sc->amr_mailbox->mb_busy && (i++ < 10)) {
DELAY(1);
+ /* This is a no-op read that flushes pending mailbox updates */
+ AMR_QGET_ODB(sc);
+ }
if (sc->amr_mailbox->mb_busy) {
mtx_unlock(&sc->amr_hw_lock);
if (ac->ac_retries++ > 1000) {
OpenPOWER on IntegriCloud