diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2012-03-30 08:18:20 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2012-03-30 08:18:20 +0000 |
commit | 5dea4f0939f565b7f438e71b0227ea049143f269 (patch) | |
tree | 40c06dc60075e2a6fa086379d213d3bd83b822de /sys/dev/pci/autri.c | |
parent | dea3c9e45ef09b352b75fac87e163b705debf46d (diff) |
If the MIDI UART is not ready for output, don't spin at IPL_CLOCK;
just return and make the midi(4) driver retry later. UART buffers
are large enough for this, except eap(4) which uses interrupts for
output.
help from and ok jsg@
Diffstat (limited to 'sys/dev/pci/autri.c')
-rw-r--r-- | sys/dev/pci/autri.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/pci/autri.c b/sys/dev/pci/autri.c index 57490580e76..78ba73425a1 100644 --- a/sys/dev/pci/autri.c +++ b/sys/dev/pci/autri.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autri.c,v 1.30 2011/07/03 15:47:16 matthew Exp $ */ +/* $OpenBSD: autri.c,v 1.31 2012/03/30 08:18:19 ratchov Exp $ */ /* * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro. @@ -1612,16 +1612,12 @@ int autri_midi_output(void *addr, int d) { struct autri_softc *sc = addr; - int x; - for (x = 0; x != MIDI_BUSY_WAIT; x++) { - if ((TREAD1(sc, AUTRI_MPUR1) & AUTRI_MIDIOUT_READY) == 0) { - TWRITE1(sc, AUTRI_MPUR0, d); - return (0); - } - delay(MIDI_BUSY_DELAY); + if ((TREAD1(sc, AUTRI_MPUR1) & AUTRI_MIDIOUT_READY) != 0) { + TWRITE1(sc, AUTRI_MPUR0, d); + return 0; } - return (EIO); + return 1; } void |