[PATCH v1 1/2] pinctrl: baytrail: Use dedicated helpers for chained IRQ handlers

Andy Shevchenko posted 2 patches 1 year ago
[PATCH v1 1/2] pinctrl: baytrail: Use dedicated helpers for chained IRQ handlers
Posted by Andy Shevchenko 1 year ago
Instead of relying on the fact that the parent IRQ chip supports
fasteoi mode and calling the respective callback at the end of
the interrupt handler, surround it with enter and exit helpers
for chained IRQ handlers which will consider all possible cases.

This in particular unifies how GPIO drivers handle IRQ.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/intel/pinctrl-baytrail.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index 7340dc20349c..c4458ac539ff 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -1355,6 +1355,8 @@ static void byt_gpio_irq_handler(struct irq_desc *desc)
 	void __iomem *reg;
 	unsigned long pending;
 
+	chained_irq_enter(chip, desc);
+
 	/* check from GPIO controller which pin triggered the interrupt */
 	for (base = 0; base < vg->chip.ngpio; base += 32) {
 		reg = byt_gpio_reg(vg, base, BYT_INT_STAT_REG);
@@ -1369,7 +1371,8 @@ static void byt_gpio_irq_handler(struct irq_desc *desc)
 		for_each_set_bit(pin, &pending, 32)
 			generic_handle_domain_irq(vg->chip.irq.domain, base + pin);
 	}
-	chip->irq_eoi(data);
+
+	chained_irq_exit(chip, desc);
 }
 
 static bool byt_direct_irq_sanity_check(struct intel_pinctrl *vg, int pin, u32 conf0)
-- 
2.43.0.rc1.1336.g36b5255a03ac
Re: [PATCH v1 1/2] pinctrl: baytrail: Use dedicated helpers for chained IRQ handlers
Posted by Linus Walleij 1 year ago
On Wed, Jan 29, 2025 at 3:52 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> Instead of relying on the fact that the parent IRQ chip supports
> fasteoi mode and calling the respective callback at the end of
> the interrupt handler, surround it with enter and exit helpers
> for chained IRQ handlers which will consider all possible cases.
>
> This in particular unifies how GPIO drivers handle IRQ.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Looks fine to me, also 2/2.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Expect to get this from you as pull request!

Yours,
Linus Walleij