Re: Requesting shared IRQ?

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

 



Hi Ole,

El Tue, Feb 17, 2009 at 05:51:35PM +0100 Ole Loots ha dit:

> I want to handle an Interrupt on an ARM processor... (at91).
>
> The Interrupt is already handled by the module at91_timer (compiled into  
> kernel). the module registers it's interrupt this way:
>
> ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt,
>    IRQF_DISABLED | IRQF_SHARED,
>    "at91_rtc", pdev);
>
> Shouldn't it be possible to register a second interrupt handler for  
> AT91_ID_SYS? Because that is a shared Interrupt... the handler has to 
> check if it is the interrupt it has to handle, like that:
>
> rtsr = at91_sys_read(AT91_RTC_SR) & at91_sys_read(AT91_RTC_IMR);
> if (rtsr) {  /* this interrupt is shared!  Is it ours? */
>
> why can't I reqister another handler, this is how I do it:
>
> ret = request_irq(AT91_ID_SYS, timer_interrupt, SA_SHIRQ,  
> AD_IRQ_DEVICE_NAME, NULL);
> if( ret )
> {
>  printk(KERN_ERR "IRQ %d already claimed :(\n", AT91_ID_SYS);
>  return ret;
> }
>
> that gives me just the message that the IRQ is already claimed.
> Can somebody tell me that this is the right way to use shared IRQ's, or 
> am I totally wrong?

i guess your problem is the missing (NULL) dev_id parameter. when
using shared IRQs a unique device id must be passed, usually a pointer
to the device data structure

btw: you should use IRQF_SHARED instead of SA_SHIRQ, recent kernels
don't define this symbol anymore

-- 
Matthias Kaehlcke
Embedded Linux Engineer
Barcelona

      El trabajo es el refugio de los que no tienen nada que hacer
                            (Oscar Wilde)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux