Skip to contentSkip to conversation

ALSA MIDI serial u16550 horribly broken in 2.6.4

DISCUSSION Dave Jones 3 participants 4 messages Mar 15, 2004 Sound

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

poking io port 0x1 probably isn't going to do much good. Here's what happens after a 'modprobe snd_serial_u16550'

Dave

u16550: can't grab port 0x1
no UART detected at 0x1

Unable to handle kernel NULL pointer dereference at virtual address 00000020
 printing eip:
c788b38f
*pde = 00000000
Oops: 0000 [#1]
SMP
CPU:    0
EIP:    0060:[<c788b38f>]    Not tainted
EFLAGS: 00010246   (2.6.4-prep)

EIP is at snd_info_unregister+0x5/0x60 [snd]
eax: 00000000 ebx: c1286b1c ecx: 00000000 edx: 00000000
esi: 00000000 edi: c1286b59 ebp: c1286b40 esp: c21cef4c
ds: 007b es: 007b ss: 0068
Process modprobe (pid: 8679, threadinfo=c21ce000 task=c37a0ce0)

Stack: c1286b1c fffffff0 c1286b59 c7889c6d 00000000 c78991f6 c1286b59 c1286b40
       c78073f3 00009600 0001c200 00000000 00000000 c7807490 c1286b1c 00000000
       00000000 00000000 c031bbd8 c21ce000 c78074b4 c031bbf8 c789ac00 c0138fad
Call Trace:
 [<c7889c6d>] snd_card_free+0x163/0x1ed [snd]
 [<c78073f3>] snd_serial_probe+0x12a/0x1de [snd_serial_u16550]
 [<c7807490>] snd_serial_probe+0x1c7/0x1de [snd_serial_u16550]
 [<c78074b4>] alsa_card_serial_init+0xd/0x34 [snd_serial_u16550]
 [<c0138fad>] sys_init_module+0x14f/0x25f
 [<c02c4567>] syscall_call+0x7/0xb
 
Code: 8b 40 20 85 c0 74 05 8b 78 34 eb 06 8b 3d 2c 5f 89 c7 bb 90
#1 lore raw
Quoted 2 lines · Dave Jones

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.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

author
#2 lore raw
Quoted 7 lines · Jaroslav Kysela
Quoted 2 lines · Dave Jones

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 ?

This was pretty close to top of tree already btw, (only missing the csets from a few hours ago). I'll test again shortly with top-of-tree.

Dave

#3 lore raw

At Mon, 15 Mar 2004 17:51:10 +0000,

Quoted 4 lines · Dave Jones
Quoted 2 lines · Jaroslav Kysela

On Mon, 15 Mar 2004, Dave Jones wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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

sound/drivers/serial-u16550.c +2 -3
@@ -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;