All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: stm32-adc: Use generic_handle_domain_irq()
@ 2022-05-11 11:06 Sebastian Andrzej Siewior
  2022-05-14 14:44 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2022-05-11 11:06 UTC (permalink / raw)
  To: linux-iio, linux-stm32
  Cc: Jonathan Cameron, Lars-Peter Clausen, Maxime Coquelin,
	Alexandre Torgue, Thomas Gleixner

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().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/iio/adc/stm32-adc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
index 1426562321575..c8fc97e52fef4 100644
--- a/drivers/iio/adc/stm32-adc-core.c
+++ b/drivers/iio/adc/stm32-adc-core.c
@@ -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);
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: adc: stm32-adc: Use generic_handle_domain_irq()
  2022-05-11 11:06 [PATCH] iio: adc: stm32-adc: Use generic_handle_domain_irq() Sebastian Andrzej Siewior
@ 2022-05-14 14:44 ` Jonathan Cameron
  2022-06-19 16:21   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2022-05-14 14:44 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-iio, linux-stm32, Lars-Peter Clausen, Maxime Coquelin,
	Alexandre Torgue, Thomas Gleixner, Fabrice Gasnier

On Wed, 11 May 2022 13:06:09 +0200
Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> 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().
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

+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


> ---
>  drivers/iio/adc/stm32-adc-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
> index 1426562321575..c8fc97e52fef4 100644
> --- a/drivers/iio/adc/stm32-adc-core.c
> +++ b/drivers/iio/adc/stm32-adc-core.c
> @@ -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);


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: adc: stm32-adc: Use generic_handle_domain_irq()
  2022-05-14 14:44 ` Jonathan Cameron
@ 2022-06-19 16:21   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2022-06-19 16:21 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-iio, linux-stm32, Lars-Peter Clausen, Maxime Coquelin,
	Alexandre Torgue, Thomas Gleixner, Fabrice Gasnier

On Sat, 14 May 2022 15:44:36 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> On Wed, 11 May 2022 13:06:09 +0200
> Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> 
> > 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().
> > 
> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>  
> 
> +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

> 
> Thanks,
> 
> Jonathan
> 
> 
> > ---
> >  drivers/iio/adc/stm32-adc-core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
> > index 1426562321575..c8fc97e52fef4 100644
> > --- a/drivers/iio/adc/stm32-adc-core.c
> > +++ b/drivers/iio/adc/stm32-adc-core.c
> > @@ -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);  
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-19 16:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11 11:06 [PATCH] iio: adc: stm32-adc: Use generic_handle_domain_irq() Sebastian Andrzej Siewior
2022-05-14 14:44 ` Jonathan Cameron
2022-06-19 16:21   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.