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/isa | |
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/isa')
-rw-r--r-- | sys/dev/isa/mpu401.c | 12 | ||||
-rw-r--r-- | sys/dev/isa/sbdsp.c | 9 |
2 files changed, 10 insertions, 11 deletions
diff --git a/sys/dev/isa/mpu401.c b/sys/dev/isa/mpu401.c index 9e98db5a536..593d0b0fd23 100644 --- a/sys/dev/isa/mpu401.c +++ b/sys/dev/isa/mpu401.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpu401.c,v 1.11 2008/06/26 05:42:16 ray Exp $ */ +/* $OpenBSD: mpu401.c,v 1.12 2012/03/30 08:18:19 ratchov Exp $ */ /* $NetBSD: mpu401.c,v 1.3 1998/11/25 22:17:06 augustss Exp $ */ /* @@ -208,12 +208,12 @@ mpu_output(v, d) mpu_readinput(sc); splx(s); } - if (mpu_waitready(sc)) { - DPRINTF(("mpu_output: not ready\n")); - return EIO; - } + if (MPU_GETSTATUS(sc->iot, sc->ioh) & MPU_OUTPUT_BUSY) + delay(10); + if (MPU_GETSTATUS(sc->iot, sc->ioh) & MPU_OUTPUT_BUSY) + return 0; bus_space_write_1(sc->iot, sc->ioh, MPU_DATA, d); - return 0; + return 1; } void diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c index 32d63f06567..5c5a507f13c 100644 --- a/sys/dev/isa/sbdsp.c +++ b/sys/dev/isa/sbdsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbdsp.c,v 1.31 2010/07/15 03:43:11 jakemsr Exp $ */ +/* $OpenBSD: sbdsp.c,v 1.32 2012/03/30 08:18:19 ratchov Exp $ */ /* * Copyright (c) 1991-1993 Regents of the University of California. @@ -2385,10 +2385,9 @@ sbdsp_midi_output(addr, d) struct sbdsp_softc *sc = addr; if (sc->sc_model < SB_20 && sbdsp_wdsp(sc, SB_MIDI_WRITE)) - return EIO; - if (sbdsp_wdsp(sc, d)) - return EIO; - return 0; + return 1; + (void)sbdsp_wdsp(sc, d); + return 1; } void |