Skip to content

Commit d5331ec

Browse files
bigunclemaxlinusw
authored andcommitted
gpio: mvebu: clear irq in edge cause register before unmask edge irq
When input GPIO set from 0 to 1, the interrupt bit asserted in the GPIO Interrupt Cause Register (ICR) even if the corresponding interrupt masked in the GPIO Interrupt Mask Register. Because interrupt mask register only affects assertion of the interrupt bits in Main Interrupt Cause Register and it does not affect the setting of bits in the GPIO ICR. So, there is problem, when we unmask interrupt with already asserted bit in the GPIO ICR, then false interrupt immediately occurs even if GPIO don't change their value since last unmask. Signed-off-by: Maxim Kiselev <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 366950e commit d5331ec

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpio/gpio-mvebu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ static void mvebu_gpio_edge_irq_unmask(struct irq_data *d)
431431
u32 mask = d->mask;
432432

433433
irq_gc_lock(gc);
434+
mvebu_gpio_write_edge_cause(mvchip, ~mask);
434435
ct->mask_cache_priv |= mask;
435436
mvebu_gpio_write_edge_mask(mvchip, ct->mask_cache_priv);
436437
irq_gc_unlock(gc);

0 commit comments

Comments
 (0)