Re: ALSA MIDI serial u16550 horribly broken in 2.6.4

From: Takashi Iwai
Date: Mon Mar 15 2004 - 13:11:57 EST


At Mon, 15 Mar 2004 17:51:10 +0000,
Dave Jones wrote:
>
> On Mon, Mar 15, 2004 at 05:29:44PM +0100, Jaroslav Kysela wrote:
> > On Mon, 15 Mar 2004, Dave Jones wrote:
> >
> > > poking io port 0x1 probably isn't going to do much good.
> > > Here's what happens after a 'modprobe snd_serial_u16550'
> >
> > Thanks. I've fixed this problem in our CVS tree. The oops should
> > be fixed in the current Linus's tree, too.
>
> Hmm, I don't see it at http://cvs.sourceforge.net/viewcvs.py/alsa/alsa-kernel/drivers/serial-u16550.c
> Is there somewhere else I should look ?

it must be the usual delay of sourceforce's anon cvs tree...
the patch is attached below.


Takashi
--- linux/sound/drivers/serial-u16550.c 13 Jan 2004 17:09:57 -0000 1.20
+++ linux/sound/drivers/serial-u16550.c 15 Mar 2004 17:40:01 -0000 1.21
@@ -342,7 +342,7 @@
unsigned char c;

/* Do some vague tests for the presence of the uart */
- if (io_base == 0) {
+ if (io_base == 0 || io_base == SNDRV_AUTO_PORT) {
return -ENODEV; /* Not configured */
}

@@ -804,10 +804,9 @@
return err;
}

- if (irq >= 0) {
+ if (irq >= 0 && irq != SNDRV_AUTO_IRQ) {
if (request_irq(irq, snd_uart16550_interrupt,
SA_INTERRUPT, "Serial MIDI", (void *) uart)) {
- uart->irq = -1;
snd_printk("irq %d busy. Using Polling.\n", irq);
} else {
uart->irq = irq;