@BASICFreak
Do you send an acknowledge to the interrupt controller?
No I don't ack the interrupt controller. I don't think there is a ACK in the interrupt controller except clearing all the masking and pending interrupts.
It also could be a press then a release INT.
I have kept the interrupt trigger to only falling edge. The pins are pulled up.
What scancode(s) does each of the INTs have?
I am not sure what you mean by scan codes but the right interrupt flags are set in the interrupt pending, source pending and GPIO external interrupt.
@Brendan,
If you have a button without any de-bouncing you should expect "bounces" (multiple interrupts), especially with a cheaper button/switch. As far as I can tell this is "safe" (electrically), and you could do de-bounce in software (e.g. when the first interrupt occurs set a timer, and don't allow that IRQ to happen again until the timer expires).
The buttons are cheap alright. I tried some experiments i.e. I pressed the button and released it after certain seconds and I don't get multiple interrupts. The multiple interrupts are happening when I press and release in an instant. Looks more like de-bouncing but want to be sure about this. There is a filter in the GPIO which seems to trigger an interrupt only after 90ns but I feel it is useless.
However it could also be completely unrelated to de-bounce (e.g. for all I know you could have a button connected to an external interrupt and the "external interrupt control register" is configured for level trigger and not edge trigger).
I have configured it to falling edge. The buttons are pulled up.
I don't know enough about ARM to guess if masking and unmasking the IRQ in the interrupt controller makes sense; but I'd be tempted to assume that (if the IRQ priority arbiters are configured properly) you might only need to clear the source pending flag then interrupt pending flag.
Could you please explain why masking,unmasking the IRQ in the interrupt controller does not make sense?
Possible bug fix and solution
In the external interrupt handler I was clearing the "external interrupt pending" before my interrupt logic. I have rearranged such that the clearing of "external interrupt pending" is done after I finish my logic. Testing this does not give me multiple interrupts. I removed the interrupt masking as you suggested and found that the masking is pointless with the current changes.