QUERY: How to handle sharing of interrupt between different peripherals.

Bill Gatliff bgat at billgatliff.com
Mon Mar 15 09:05:25 EDT 2010


Viresh KUMAR wrote:
> On 3/15/2010 10:48 AM, jassi brar wrote:
>   
>> On Mon, Mar 15, 2010 at 1:37 PM, Viresh KUMAR <viresh.kumar at st.com> wrote:
>>     
>>> In our SOC (SPEArxxx), we have few peripherals which share common interrupt
>>> line.
>>>       
>> how about set_irq_chained_handler ?
>>     
>
> I think it is not for this purpose. Better to use IRQF_SHARED in normal
> request_irq. what do you say?
>   

Actually, set_irq_chained_handler() is designed specifically for
demultiplexing interrupt lines into independent descriptors, which is
exactly what you want here.  Otherwise, your drivers must know that
they're sharing interrupts, which is a platform-specific assumption. 
You don't want that.

Take a look at how AT91 is handing their GPIO.  Each bank has 32 pins,
but only one shared interrupt signal.  By demultiplexing that into 32
separate descriptors with set_irq_chained_handler(), drivers can all
uniformly call request_irq() when one of their interrupt sources is tied
to a GPIO--- same as if their interrupt source is a true IRQ line, an
internal source, or whatever.  That's what you want.

b.g.

-- 
Bill Gatliff
Embedded systems training and consulting
http://billgatliff.com
bgat at billgatliff.com




More information about the linux-arm-kernel mailing list