Skip to contentSkip to conversation

iio: adc: stm32-adc: Use generic_handle_domain_irq()

PATCH In review Sebastian Andrzej Siewior 2 participants 3 messages May 11, 2022 – Jun 19, 2022

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

PATCH 1/1 iio: adc: stm32-adc: Use generic_handle_domain_irq()

The call chain

	generic_handle_irq(irq_find_mapping(domain, x));

could be replaced with

	generic_handle_domain_irq(domain, x);

which looks up the struct irq_desc for the interrupt and handles it with handle_irq_desc().
This is a slight optimisation given that the driver invokes only one function and the struct irq_desc is used directly instead being looked up via irq_to_desc().

Use generic_handle_domain_irq().

---
 drivers/iio/adc/stm32-adc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/stm32-adc-core.c +1 -1
index 1426562321575..c8fc97e52fef4 100644
@@ -356,7 +356,7 @@ static void stm32_adc_irq_handler(struct irq_desc *desc)
 		if ((status & priv->cfg->regs->eoc_msk[i] &&
 		     stm32_adc_eoc_enabled(priv, i)) ||
 		     (status & priv->cfg->regs->ovr_msk[i]))
-			generic_handle_irq(irq_find_mapping(priv->domain, i));
+			generic_handle_domain_irq(priv->domain, i);
 	}
 
 	chained_irq_exit(chip, desc);
Signature · 1 line
2.36.1
maintainer
#1 lore raw
Quoted 12 lines · On Wed, 11 May 2022 13:06:09 +0200 Sebastian Andrzej Siewior…

The call chain

	generic_handle_irq(irq_find_mapping(domain, x));

could be replaced with

	generic_handle_domain_irq(domain, x);

which looks up the struct irq_desc for the interrupt and handles it with handle_irq_desc().
This is a slight optimisation given that the driver invokes only one function and the struct irq_desc is used directly instead being looked up via irq_to_desc().

Quoted 3 lines

Use generic_handle_domain_irq().

+CC Fabrice,

Fun following through the different checks in the two functions, but looks fine to me.

Applied to the togreg branch of iio.git and pushed out as testing for 0-day to see if it can find any problems.

Thanks,

Jonathan

Quoted 17 lines
---
 drivers/iio/adc/stm32-adc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/stm32-adc-core.c +1 -1
index 1426562321575..c8fc97e52fef4 100644
@@ -356,7 +356,7 @@ static void stm32_adc_irq_handler(struct irq_desc *desc)
 		if ((status & priv->cfg->regs->eoc_msk[i] &&
 		     stm32_adc_eoc_enabled(priv, i)) ||
 		     (status & priv->cfg->regs->ovr_msk[i]))
-			generic_handle_irq(irq_find_mapping(priv->domain, i));
+			generic_handle_domain_irq(priv->domain, i);
 	}
 
 	chained_irq_exit(chip, desc);
maintainer
#2 lore raw
Quoted 19 lines · On Sat, 14 May 2022 15:44:36 +0100 Jonathan Cameron <[email protected]> wrote:
Quoted 12 lines · On Wed, 11 May 2022 13:06:09 +0200 Sebastian Andrzej Siewior…

The call chain

	generic_handle_irq(irq_find_mapping(domain, x));

could be replaced with

	generic_handle_domain_irq(domain, x);

which looks up the struct irq_desc for the interrupt and handles it with handle_irq_desc().
This is a slight optimisation given that the driver invokes only one function and the struct irq_desc is used directly instead being looked up via irq_to_desc().

Quoted 3 lines

Use generic_handle_domain_irq().

Quoted 7 lines

+CC Fabrice,

Fun following through the different checks in the two functions, but looks fine to me.

Applied to the togreg branch of iio.git and pushed out as testing for 0-day to see if it can find any problems.

oops. I applied this to the fixes-togreg branch of iio.git. Will have to rebase that to drop it.

Now applied to the togreg branch of iio.git

Thanks,

Jonathan

Quoted 24 lines

Thanks,

Jonathan

Quoted 17 lines
---
 drivers/iio/adc/stm32-adc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/stm32-adc-core.c +1 -1
index 1426562321575..c8fc97e52fef4 100644
@@ -356,7 +356,7 @@ static void stm32_adc_irq_handler(struct irq_desc *desc)
 		if ((status & priv->cfg->regs->eoc_msk[i] &&
 		     stm32_adc_eoc_enabled(priv, i)) ||
 		     (status & priv->cfg->regs->ovr_msk[i]))
-			generic_handle_irq(irq_find_mapping(priv->domain, i));
+			generic_handle_domain_irq(priv->domain, i);
 	}
 
 	chained_irq_exit(chip, desc);