openvortex-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openvortex-dev] Eureka!


From: Jeff Muizelaar
Subject: Re: [Openvortex-dev] Eureka!
Date: Fri, 25 Apr 2003 18:42:18 -0400 (EDT)


On Fri, 25 Apr 2003, Shamus wrote:

> -----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...

yes it is null for me as well. The reason it worked for me though is
obviously is that I was never getting any IRQ_MIDI interrupts.

> 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?

That looks sane to me. Manuel?

Additionally, I think we should get rid of the VORTEX_MPU401_LEGACY stuff.
I think it is perfectly acceptable for us to break if older versions of
alsa are used. There should be no reason to use an older version if you
are patching source.

-Jeff





reply via email to

[Prev in Thread] Current Thread [Next in Thread]