I am using GPIO interrupts in kernel module and every time I got interrupt at first registration (at request_irq()).
Registering irq code:
at91_set_gpio_input(AT91_PIN_PB12, 0);
at91_set_pulldown(AT91_PIN_PB12, 1);
at91_set_deglitch(AT91_PIN_PB12, 1);
request_irq(gpio_to_irq(AT91_PIN_PB12), &interrupt_handler, IRQF_TRIGGER_FALLING, "irqname", NULL)
Console log:
# cat /proc/interrupts | grep irqname
<----- the "irqname" interrupt is not registred
# insmod testmodule.ko
# cat /proc/interrupts | grep irqname
76: 1 GPIO irqname <------Why first interrupt hapened at registration
# rmmod testmodule
# insmod testmodule.ko
# cat /proc/interrupts | grep irqname
76: 1 GPIO irqname
# rmmod testmodule
# insmod testmodule.ko
# cat /proc/interrupts | grep irqname
76: 1 GPIO irqname
# rmmod testmodule