Skip to contentSkip to conversation

pinctrl: intel: Unify the way of handling chained IRQ

PATCH In review Andy Shevchenko 4 participants 7 messages Jan 29, 2025 – Feb 6, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover pinctrl: intel: Unify the way of handling chained IRQ

Some of the drivers are using the dedicated helpers (chained_irq_enter(), chained_irq_exit() helpers) and some relies on the specific implementations of the parent IRQ chip and its configuration. Update the latter ones to use dedicated helpers that cover all possible scenarios.

Andy Shevchenko (2):
pinctrl: baytrail: Use dedicated helpers for chained IRQ handlers
pinctrl: lynxpoint: Use dedicated helpers for chained IRQ handlers

 drivers/pinctrl/intel/pinctrl-baytrail.c  | 5 ++++-
 drivers/pinctrl/intel/pinctrl-lynxpoint.c | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
#1 lore raw

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

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.

---
 drivers/pinctrl/intel/pinctrl-baytrail.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-baytrail.c +4 -1
index 7340dc20349c..c4458ac539ff 100644
@@ -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)
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
Reviewed-by on v1 1/2
#2 lore raw

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

Quoted 8 lines · Andy Shevchenko

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.

Looks fine to me, also 2/2.

Expect to get this from you as pull request!

Yours,
Linus Walleij

#3 lore raw

PATCH 2/2 pinctrl: lynxpoint: Use dedicated helpers for chained IRQ handlers

In reply to Andy Shevchenko

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.

---
 drivers/pinctrl/intel/pinctrl-lynxpoint.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-lynxpoint.c +4 -1
index cc5ede17c383..ac5459a4c63e 100644
@@ -549,6 +549,8 @@ static void lp_gpio_irq_handler(struct irq_desc *desc)
 	unsigned long pending;
 	u32 base, pin;
 
+	chained_irq_enter(chip, desc);
+
 	/* check from GPIO controller which pin triggered the interrupt */
 	for (base = 0; base < lg->chip.ngpio; base += 32) {
 		reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT);
@@ -560,7 +562,8 @@ static void lp_gpio_irq_handler(struct irq_desc *desc)
 		for_each_set_bit(pin, &pending, 32)
 			generic_handle_domain_irq(lg->chip.irq.domain, base + pin);
 	}
-	chip->irq_eoi(data);
+
+	chained_irq_exit(chip, desc);
 }
 
 static void lp_irq_ack(struct irq_data *d)
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
Reviewed-by on the v1 series
#4 lore raw
In reply to Andy Shevchenko

Hi,

Quoted 8 lines · Andy Shevchenko

Some of the drivers are using the dedicated helpers (chained_irq_enter(), chained_irq_exit() helpers) and some relies on the specific implementations of the parent IRQ chip and its configuration. Update the latter ones to use dedicated helpers that cover all possible scenarios.

Andy Shevchenko (2):
pinctrl: baytrail: Use dedicated helpers for chained IRQ handlers
pinctrl: lynxpoint: Use dedicated helpers for chained IRQ handlers

Thanks, patches looks good to me:

For the series.

Regards,

Hans

Quoted 5 lines
 drivers/pinctrl/intel/pinctrl-baytrail.c  | 5 ++++-
 drivers/pinctrl/intel/pinctrl-lynxpoint.c | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
maintainer Acked-by on the v1 series
#5 lore raw
In reply to Andy Shevchenko
Quoted 8 lines · Andy Shevchenko

Some of the drivers are using the dedicated helpers (chained_irq_enter(), chained_irq_exit() helpers) and some relies on the specific implementations of the parent IRQ chip and its configuration. Update the latter ones to use dedicated helpers that cover all possible scenarios.

Andy Shevchenko (2):
pinctrl: baytrail: Use dedicated helpers for chained IRQ handlers
pinctrl: lynxpoint: Use dedicated helpers for chained IRQ handlers

Both,

#6 lore raw
Quoted 6 lines · Mika Westerberg
Quoted 5 lines · Andy Shevchenko

Some of the drivers are using the dedicated helpers (chained_irq_enter(), chained_irq_exit() helpers) and some relies on the specific implementations of the parent IRQ chip and its configuration. Update the latter ones to use dedicated helpers that cover all possible scenarios.

Quoted 7 lines
Quoted 3 lines

Andy Shevchenko (2):
pinctrl: baytrail: Use dedicated helpers for chained IRQ handlers
pinctrl: lynxpoint: Use dedicated helpers for chained IRQ handlers

Both,

Pushed to my review and testing queue, thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko