mbox series

[0/7] iio: Use IRQF_NO_AUTOEN

Message ID 20210402184544.488862-1-jic23@kernel.org (mailing list archive)
Headers show
Series iio: Use IRQF_NO_AUTOEN | expand

Message

Jonathan Cameron April 2, 2021, 6:45 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This series is dependant on
cbe16f35bee68 ("genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()")
which is available in an immutable tag in the tip tree.
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tag/?h=irq-no-autoen-2021-03-25
which I'll merge in to the IIO tree if we need it before it's available
upstream.

That patch introduces a new IRQF_NO_AUTOEN flag for irq requests to avoid
the current dance where we either mark an irq as not to be autoenabled before
we know if we can actually request it succesfully, or (as IIO drivers seem to
have gone with) we disable the interrupt just after requesting it.
In short the flag stops the interrupt being autoenabled in the first place.

So this series applies this magic to IIO :)

Note these are all just compile tested and some of them aren't entirely
trivial because of other aspects of the irq flag handling.

Jonathan Cameron (7):
  iio:adc:ad7766: Use new IRQF_NO_AUTOEN to reduce boilerplate
  iio:adc:exynos-adc: Use new IRQF_NO_AUTOEN flag rather than separate
    irq_disable()
  iio:adc:nau7802: Use IRQF_NO_AUTOEN instead of request then disable
  iio:adc:sun4i-gpadc: Use new IRQF_NO_AUTOEN flag instead of request
    then disable
  iio:chemical:scd30: Use IRQF_NO_AUTOEN to avoid irq request then
    disable
  iio:imu:adis: Use IRQF_NO_AUTOEN instead of irq request then disable
  iio:adc:ad_sigma_delta: Use IRQF_NO_AUTOEN rather than request and
    disable

 drivers/iio/adc/ad7766.c          | 15 +++++++--------
 drivers/iio/adc/ad_sigma_delta.c  |  7 ++-----
 drivers/iio/adc/exynos_adc.c      |  4 ++--
 drivers/iio/adc/nau7802.c         |  6 +++---
 drivers/iio/adc/sun4i-gpadc-iio.c |  4 ++--
 drivers/iio/chemical/scd30_core.c | 16 ++++++++--------
 drivers/iio/imu/adis16460.c       |  4 ++--
 drivers/iio/imu/adis16475.c       |  5 +++--
 drivers/iio/imu/adis_trigger.c    | 11 ++++++-----
 9 files changed, 35 insertions(+), 37 deletions(-)

Comments

Andy Shevchenko April 2, 2021, 7 p.m. UTC | #1
On Fri, Apr 2, 2021 at 9:48 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This series is dependant on
> cbe16f35bee68 ("genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()")
> which is available in an immutable tag in the tip tree.
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tag/?h=irq-no-autoen-2021-03-25
> which I'll merge in to the IIO tree if we need it before it's available
> upstream.
>
> That patch introduces a new IRQF_NO_AUTOEN flag for irq requests to avoid
> the current dance where we either mark an irq as not to be autoenabled before
> we know if we can actually request it succesfully, or (as IIO drivers seem to

successfully

> have gone with) we disable the interrupt just after requesting it.
> In short the flag stops the interrupt being autoenabled in the first place.
>
> So this series applies this magic to IIO :)
>
> Note these are all just compile tested and some of them aren't entirely
> trivial because of other aspects of the irq flag handling.

I have looked at them and indeed in all cases it's clearer now what is going on.
FWIW,
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Jonathan Cameron (7):
>   iio:adc:ad7766: Use new IRQF_NO_AUTOEN to reduce boilerplate
>   iio:adc:exynos-adc: Use new IRQF_NO_AUTOEN flag rather than separate
>     irq_disable()
>   iio:adc:nau7802: Use IRQF_NO_AUTOEN instead of request then disable
>   iio:adc:sun4i-gpadc: Use new IRQF_NO_AUTOEN flag instead of request
>     then disable
>   iio:chemical:scd30: Use IRQF_NO_AUTOEN to avoid irq request then
>     disable
>   iio:imu:adis: Use IRQF_NO_AUTOEN instead of irq request then disable
>   iio:adc:ad_sigma_delta: Use IRQF_NO_AUTOEN rather than request and
>     disable
>
>  drivers/iio/adc/ad7766.c          | 15 +++++++--------
>  drivers/iio/adc/ad_sigma_delta.c  |  7 ++-----
>  drivers/iio/adc/exynos_adc.c      |  4 ++--
>  drivers/iio/adc/nau7802.c         |  6 +++---
>  drivers/iio/adc/sun4i-gpadc-iio.c |  4 ++--
>  drivers/iio/chemical/scd30_core.c | 16 ++++++++--------
>  drivers/iio/imu/adis16460.c       |  4 ++--
>  drivers/iio/imu/adis16475.c       |  5 +++--
>  drivers/iio/imu/adis_trigger.c    | 11 ++++++-----
>  9 files changed, 35 insertions(+), 37 deletions(-)
>
> --
> 2.31.1
>
Lars-Peter Clausen April 3, 2021, 11:45 a.m. UTC | #2
On 4/2/21 8:45 PM, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This series is dependant on
> cbe16f35bee68 ("genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()")
> which is available in an immutable tag in the tip tree.
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tag/?h=irq-no-autoen-2021-03-25
> which I'll merge in to the IIO tree if we need it before it's available
> upstream.
>
> That patch introduces a new IRQF_NO_AUTOEN flag for irq requests to avoid
> the current dance where we either mark an irq as not to be autoenabled before
> we know if we can actually request it succesfully, or (as IIO drivers seem to
> have gone with) we disable the interrupt just after requesting it.
> In short the flag stops the interrupt being autoenabled in the first place.
>
> So this series applies this magic to IIO :)
>
> Note these are all just compile tested and some of them aren't entirely
> trivial because of other aspects of the irq flag handling.

Something like IRQF_NO_AUTOEN has been on my wish list for a long time. 
Thanks Barry!

Series looks good.

Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>