Re: acquiring an interrupt for swim3 floppy driver
On Tue, Apr 12, 2005 at 07:37:16PM -0500, vinai wrote:
> I was wondering what was the best/cleanest (and SMP-safe) way to grab
> an interrupt ? swim3 currently uses local_irq_enable, but from past
> discussions on the list, it did not sound like it was SMP safe. All
> of the other local_irq_ code seems to be easily enough bracketed off
> by equivalent spin lock functions, but I haven't found one that works
> for just the irq_enable ...
I just looked at the copy of swim3.c that I have (from 22.214.171.124), and I
can't figure out why it's even using local_irq_enable(). It doesn't
seem like a safe thing to do anyway. I'd suggest trying to figure out
why it was doing that before, since it's possible you can just drop it.
> I looked at floppy.c, and tried to backtrack where that driver got an
> interrupt, and it went back to asm/floppy.h, which seemed to want hard
> coded values for floppy IRQ and DMA, which I did not think we had to
> do on PPC ? So that was the dead end that brought me back here ...
Are you converting it over to being a proper macio driver while you're
there? If so, you can just ask the macio layer for the various correct
addresses and IRQ values with the functions on the macio_dev object.
Otherwise, you would get them out of the device_node just like it does
in the old version.
The mainline floppy code is pretty stupid and PC specific. It expects
to have most of the information compiled into the kernel, which doesn't
really work for mac hardware.