Any suggestions for troubleshooting missed interrupts?

Hey guys, a friend of mine is currently working on AT91SAM9M10-EKES. The Code registers IRQ for 2 GPIO pins (PA20 & PA21) but only receives 22/26 expected interrupts (random). Could there be an issue in this IRQ handling code?

  static irqreturn_t wiegand_interrupt(int irq, void *dev_id){
  atomic_inc(&counter);
  printk(KERN_WARNING "IRQ received, counting... %d\n", atomic_read(&counter));
  return 0;
}

irq1 = gpio_to_irq(AT91_PIN_PA21);
if (irq1 < 0) {
    err = irq1;
    printk("Unable to get irq number for GPIO %d, error %d\n", AT91_PIN_PA21, err);
    goto fail;
}

err = request_irq(irq1, wiegand_interrupt, 0, "wiegand", NULL);

irq2 = gpio_to_irq(AT91_PIN_PA20);
if (irq2 < 0) {
    err = irq2;
    printk("Unable to get irq number for GPIO %d, error %d\n", AT91_PIN_PA21, err);
    goto fail;
}

err = request_irq(irq2, wiegand_interrupt, 0, "wiegand", NULL);

Any suggestions for troubleshooting missed interrupts? @Middleware & OS
Solution
Yup, I had to define separate interrupt handler functions for each IRQ line. I also found this stuff helpful too
https://linux-kernel-labs.github.io/refs/heads/master/labs/interrupts.html
Was this page helpful?