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

Re: acquiring an interrupt for swim3 floppy driver



> No - my attempts right now were to get the driver to compile (by getting
> rid of the old sti/cli/save_flags/restore_flags).  I was able to do this
> by getting rid of these functions and replacing them with the local_irq_
> equivalents, and the driver compiled, and even worked ;-)
> 
> However, in trying to make the driver SMP-safe, I haven't had any luck.
> Replacing the local_irq functions by their spin_lock equivalents have
> not resulted in a working kernel for me.  I thought this was due to the
> local_irq_enable.  x86 floppy.c did not use such a routine, but the way
> that driver acquired an interrupt value led me back to defined values
> for FLOPPY_IRQ and FLOPPY_DMA - which did not look right for PowerPC...

The irq number has nothing to do with the masking of interrupts done by
local_irq_enable/disable and/or sti/cli.

The irq number is what the driver passes to request_irq() to obtain it's
interrupt function and that works just fine already, you don't have to
touch this.

The local_irq_save/enable/disable etc... was meant as a way to avoid
re-entrency from the interrupt function or from some external functions
or timers etc... it's supposed to be broader than just masking the
specific interrupt of this device and thus cannot really be directly
replaced by disable/enable_irq.

You need to understand the locking required by the driver and use
spinlocks.

Ben.




Reply to: