pinctrl: rockchip: Enhance support for IRQ_TYPE_EDGE_BOTH
Subsystems (2)
PATCH 1/1 pinctrl: rockchip: Enhance support for IRQ_TYPE_EDGE_BOTH
Switching between falling/rising edges for IRQ_TYPE_EDGE_BOTH on pins that require debounce can cause the device to lose events due to a desync between pin state and irq type.
This problem is resolved by switching between IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_LEVEL_HIGH instead.
--- drivers/gpio/gpio-rockchip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpio-rockchip.c +2 -2
@@ -417,11 +417,11 @@ static int rockchip_irq_set_type(struct irq_data *d, unsigned int type) goto out; }else { bank->toggle_edge_mode |= mask; - level |= mask; + level &= ~mask;/* * Determine gpio state. If 1 next interrupt should be -* falling otherwise rising. +* low otherwise high. */ data =readl (bank->reg_base + bank->gpio_regs->ext_port);if (data & mask)
Signature · 1 line
2.30.2
Quoted 9 lines · João H. Spies
Switching between falling/rising edges for
IRQ_TYPE_EDGE_BOTHon pins that require debounce can cause the device to lose events due to a desync between pin state and irq type.This problem is resolved by switching between
IRQ_TYPE_LEVEL_LOWandIRQ_TYPE_LEVEL_HIGHinstead.Fixes 936ee26 ("gpio/rockchip: add driver for rockchip gpio")Signed-off-by João H. Spies <[email protected]>
No reaction from maintainers so I'm just gonna assume this fix is correct and applied for fixes.
Yours,
Linus Walleij
Heiko Stübner
maintainerAm Montag, 22. August 2022, 11:03:08 CEST schrieb Linus Walleij:
Quoted 6 lines · João H. Spies
Quoted 5 lines
Switching between falling/rising edges for
IRQ_TYPE_EDGE_BOTHon pins that require debounce can cause the device to lose events due to a desync between pin state and irq type.
Quoted 8 lines
Quoted 5 lines
This problem is resolved by switching between
IRQ_TYPE_LEVEL_LOWandIRQ_TYPE_LEVEL_HIGHinstead.Fixes 936ee26 ("gpio/rockchip: add driver for rockchip gpio")Signed-off-by João H. Spies <[email protected]>No reaction from maintainers so I'm just gonna assume this fix is correct and applied for fixes.
This plays with behavioral peculiarities of the gpio controller (using the level setting to hopefully prevent missing edge irqs), so doesn't follow
So I guess it really is more of a wait-and-see. And I guess as João seems to have experienced that issue, that will hopefully work for others too.
Heiko
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip