From 4eb1ee7733f4e5d783fc389c8a415b034cfe988f Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 25 Feb 2008 10:59:52 +0100 Subject: [PATCH] --- yaml --- r: 92071 b: refs/heads/master c: ea6b5828cdbbedaf26b12ae64befbec18084ea3c h: refs/heads/master i: 92069: 6a33ab586ddfbba432ac850fa5633a6e048f95cd 92067: 4f40440ff580e145a35f04f9f0d1342a7587eec3 92063: 07a1c630aa61e28ad73f0bbbaba78ef17612f2b5 v: v3 --- [refs] | 2 +- trunk/sound/drivers/mpu401/mpu401_uart.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 95f943bed6ff..2acfb7a87877 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 47ba97f8fa01bb5b48e73b4b1271fbf1436a2d4b +refs/heads/master: ea6b5828cdbbedaf26b12ae64befbec18084ea3c diff --git a/trunk/sound/drivers/mpu401/mpu401_uart.c b/trunk/sound/drivers/mpu401/mpu401_uart.c index 5993864acbd3..dd6ec4266732 100644 --- a/trunk/sound/drivers/mpu401/mpu401_uart.c +++ b/trunk/sound/drivers/mpu401/mpu401_uart.c @@ -425,16 +425,17 @@ static void snd_mpu401_uart_input_read(struct snd_mpu401 * mpu) static void snd_mpu401_uart_output_write(struct snd_mpu401 * mpu) { unsigned char byte; - int max = 256, timeout; + int max = 256; do { if (snd_rawmidi_transmit_peek(mpu->substream_output, &byte, 1) == 1) { - for (timeout = 100; timeout > 0; timeout--) { - if (snd_mpu401_output_ready(mpu)) - break; - } - if (timeout == 0) + /* + * Try twice because there is hardware that insists on + * setting the output busy bit after each write. + */ + if (!snd_mpu401_output_ready(mpu) && + !snd_mpu401_output_ready(mpu)) break; /* Tx FIFO full - try again later */ mpu->write(mpu, byte, MPU401D(mpu)); snd_rawmidi_transmit_ack(mpu->substream_output, 1);