Skip to content

Commit e74200e

Browse files
Marek Vasutlinusw
authored andcommitted
pinctrl: stm32: Do not call stm32_gpio_get() for edge triggered IRQs in EOI
The stm32_gpio_get() should only be called for LEVEL triggered interrupts, skip calling it for EDGE triggered interrupts altogether to avoid wasting CPU cycles in EOI handler. On this platform, EDGE triggered interrupts are the majority and LEVEL triggered interrupts are the exception no less, and the CPU cycles are not abundant. Fixes: 47beed5 ("pinctrl: stm32: Add level interrupt support to gpio irq chip") Signed-off-by: Marek Vasut <[email protected]> Cc: Alexandre Torgue <[email protected]> Cc: Fabien Dessenne <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: [email protected] Cc: [email protected] To: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 08b7cf1 commit e74200e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/pinctrl/stm32/pinctrl-stm32.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ static void stm32_gpio_irq_trigger(struct irq_data *d)
311311
struct stm32_gpio_bank *bank = d->domain->host_data;
312312
int level;
313313

314+
/* Do not access the GPIO if this is not LEVEL triggered IRQ. */
315+
if (!(bank->irq_type[d->hwirq] & IRQ_TYPE_LEVEL_MASK))
316+
return;
317+
314318
/* If level interrupt type then retrig */
315319
level = stm32_gpio_get(&bank->gpio_chip, d->hwirq);
316320
if ((level == 0 && bank->irq_type[d->hwirq] == IRQ_TYPE_LEVEL_LOW) ||

0 commit comments

Comments
 (0)