Yosemite/440EP is there a global interrupt enable mask?

Eugene Surovegin ebs at ebshome.net
Thu Jan 26 05:55:18 EST 2006


On Wed, Jan 25, 2006 at 10:30:30AM -0800, David Hawkins wrote:
> 
> Hi Stephan,
> 
> > You seem to have used the wrong IRQ number though. Please see below.
> > 
> > You are using the "External IRQ 8". This results in IRQ number 19 of the 2nd 
> > interrupt controller of the 440ep. So please try (19+32) as the IRQ number 
> > upon requesting the interrupt.
> 
> Yep, that was it!
> 
> Now while looking at some of the other drivers, I noticed the use
> of the following syntax:
> 
>    unsigned long flags;
>    local_irq_save(flags);
> 
>    ... mfdcr, mtdcr, etc operations ...
> 
>    local_irq_restore(flags);
> 
> which is treating the operations on the DCRs as a critical section.
> 
> I should probably be doing the same when I enable the external IRQs
> and modify the GPIO registers.

You have to use locks if you access GPIO registers, because other bits 
can be used by other device drivers, although there is no drivers in 
the official tree which use GPIO (I have tons of them in my private 
tree and I added global "gpio_lock" to serialize GPIO access).

DCRs are a little different, there are separate DCR for different 
peripherals, so generally, you don't have to use locks, because those 
DCR accesses are implicitly bound to particular device anyway and 
device "owns" them.

-- 
Eugene




More information about the Linuxppc-embedded mailing list