[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Openvortex-dev] Eureka!
From: |
Shamus |
Subject: |
[Openvortex-dev] Eureka! |
Date: |
Fri, 25 Apr 2003 00:03:39 -0700 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all!
I've finally figured out what the heck is causing the kernel
panic--and quite frankly, I'm having a hard time figuring out just how
the driver *works* for you guys who it works for!
Let me explain...
The problem lies in this line (from vortex_interrupt()):
snd_mpu401_uart_interrupt(vortex->irq,
vortex->rmidi->private_data, regs);
Putting a printk in front of this line verifies that vortex->rmidi is
NULL! So of course the machine crashes when trying to dereference
private_data...
I believe the root of the problem is in au88x0_mpu401.c:
int __devinit snd_vortex_midi(vortex_t *vortex)
{
snd_rawmidi_t *rmidi;
int temp, mode;
mpu401_t *mpu;
int port;
... snipped ...
if ((temp = snd_mpu401_uart_new(vortex->card, 0, MPU401_HW_AUREAL,
port, 1, 0, 0, &rmidi)) != 0)
... snipped ...
mpu = snd_magic_cast(mpu401_t, rmidi->private_data, return -ENOMEM);
mpu->cport = (unsigned long)(vortex->mmio + (VORTEX_MIDI_CMD >> 2));
#endif
return 0;
}
Here rmidi is declared a local variable to the function, which means
after you initialize rmidi in the snd_mpu_401_uart_new() function, by
the end of snd_vortex_midi() the local variable is thrown away! The
same goes for the variable mpu at the very end--it's initialized and
then thrown away...
I can't seem to find any other place that vortex->rmidi gets
initialized, so how come it works for you guys? It should, by all
rights, crash and burn on you. If not, then how does vortex->rmidi
(from vortex_interrupt()) get initialized?
Shouldn't the code in snd_vortex_midi() be something along the lines
of
if ((temp = snd_mpu401_uart_new(vortex->card, 0, MPU401_HW_AUREAL,
port, 1, 0, 0, &vortex->rmidi)) != 0)
? Am I missing something?
- -- Shamus
-----BEGIN PGP SIGNATURE-----
Version: Encrypted with PGP Plugin for Calypso
iQA/AwUBPqjdiphOW/ztyY5GEQIjjwCfeYH9O8LUzc9CgnaJuUQpYQuGocAAoIoK
H/lANVpk4P+9Q7+snUCHCrRI
=Rc+0
-----END PGP SIGNATURE-----
- [Openvortex-dev] Eureka!,
Shamus <=