AnsweredAssumed Answered

Request_irq Flag mismatch

Question asked by Lucas Gerhard on May 22, 2017
Latest reply on May 23, 2017 by Pavel Chubakov

I'm facing a problem with request_irq, when I try to hook my interrupt handler with the interrupt line, I receive the following message:

 

root@device:~# insmod kernelModule.ko
genirq: Flags mismatch irq 18. 00000000 (xyz) vs. 00000000 (xyz)
Request_irq return: -16 (This is my print of the return value of request_irq function)

 

The flags are totally equal, and I don't know what is the problem.

 

The irq number looks correct, as shown below:

 

root@device:~# cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7
  18:         0          0          0          0          0          0          0          0   OpenPIC     8 Level     xyz
 
 
And my code is listed below:
 
#define XYZ_IRQ         (18)

int reqRet;

static irqreturn_t xyz_interrupt(int irq, void *dev)
{
 printk(KERN_INFO "Interrupt "XYZ Handled!!!);
    return IRQ_HANDLED;
}
 
static int __init hello_init(void)
{
 reqRet = request_irq(XYZ_IRQ, xyz_interrupt, 0, "xyz", (void*)&reqRet);          
// reqRet = request_irq(XYZ_IRQ, xyz_interrupt, 0, "xyz", (void*)NULL); /* If I use this call, I don't receive the mismatch message, but the return code still -16 */
 printk(KERN_INFO "xyz_irq: Request_irq return: %d\n", reqRet);
 
    if(reqRet)
    {
  printk(KERN_ERR "xyz_irq: cannot register IRQ %d\n", XYZ_IRQ);
        return -EIO;
    }
 
 return 0;
}

 

My Device tree config for this external device:

 

xyz@5,0 {

   compatible = "generic-uio";

   reg = <0x5 0x0 0x1000>;

   interrupt = <0x8 0x1 0x0 0x0>

};

 

My device is based on p4080ds.
 
Could someone help me?

 

Thanks in advance

Outcomes