From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] MPU-401 fixes Date: Mon, 05 May 2003 16:15:21 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Clemens Ladisch Cc: Jaroslav Kysela , "alsa-devel@lists.sourceforge.net" List-Id: alsa-devel@alsa-project.org At Mon, 05 May 2003 13:19:34 +0200 (METDST), Clemens Ladisch wrote: > > Jaroslav Kysela wrote: > > On Mon, 5 May 2003, Clemens Ladisch wrote: > > > > > - fix deadlock: when snd_mpu401_uart_input_trigger() is interrupted > > > immediately after the call to spin_unlock_irqrestore(), the interrupt > > > handler won't clear the interrupt condition because the RX_LOOP bit is > > > still set > > > > Thanks. The RX_LOOP bit is cleared before unlock now. > > The same thing will happen when the interrupt occurs immediately before > the call to spin_lock_irqsave(). > > The real problem is that the interrupt handler _must_ read the data from > the device to clear the MPU401's interrupt condition. Therefore, there > must not be any condition which can prevent the handler from reading data. hmm, this problem is not easy to solve. originally, the bit check was introduced to prevent double spinlocks in the path: irq -> snd_mpu401_uart_interrupt() -> lock -> snd_mpu401_uart_input_read() -> snd_rawmidi_receive() -> rawmidi->event() -> rawmidi->trigger() (in seq_midi.c) -> snd_mpu401_uart_input_trigger() > > > - abort the tx loop when the FIFO is full; otherwise, the inner loop would > > > be executed 25600 times > > > > Fixed. > > Without the "if (timeout == 0)" test, the loop will be aborted after the > first byte written. yep. > > BTW: Where did my patches from Friday go? applied now. thanks. ciao, Takashi ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf