diff mbox series

[3/7] iio: adis16475: do not return ints in irq handlers

Message ID 20210413112105.69458-4-nuno.sa@analog.com (mailing list archive)
State New
Headers show
Series Adis IRQ fixes and minor improvements | expand

Commit Message

Sa, Nuno April 13, 2021, 11:21 a.m. UTC
On an IRQ handler we should return normal error codes as 'irqreturn_t'
is expected.

Fixes: fff7352bf7a3c ("iio: imu: Add support for adis16475")

Signed-off-by: Nuno Sa <nuno.sa@analog.com>
---
 drivers/iio/imu/adis16475.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexandru Ardelean April 14, 2021, 7:27 a.m. UTC | #1
On Tue, Apr 13, 2021 at 5:45 PM Nuno Sa <nuno.sa@analog.com> wrote:
>
> On an IRQ handler we should return normal error codes as 'irqreturn_t'
> is expected.
>
> Fixes: fff7352bf7a3c ("iio: imu: Add support for adis16475")
>
> Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> ---
>  drivers/iio/imu/adis16475.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c
> index 1de62fc79e0f..51b76444db0b 100644
> --- a/drivers/iio/imu/adis16475.c
> +++ b/drivers/iio/imu/adis16475.c
> @@ -1068,7 +1068,7 @@ static irqreturn_t adis16475_trigger_handler(int irq, void *p)
>
>         ret = spi_sync(adis->spi, &adis->msg);
>         if (ret)
> -               return ret;
> +               goto check_burst32;

This is also going to call adis16475_burst32_check().
Which in itself is [probably] an undesired behavior change.

Maybe this needs a new 'irq_done' label?

>
>         adis->spi->max_speed_hz = cached_spi_speed_hz;
>         buffer = adis->buffer;
> --
> 2.31.1
>
Sa, Nuno April 15, 2021, 7:38 a.m. UTC | #2
> From: Alexandru Ardelean <ardeleanalex@gmail.com>
> Sent: Wednesday, April 14, 2021 9:27 AM
> To: Sa, Nuno <Nuno.Sa@analog.com>
> Cc: linux-iio <linux-iio@vger.kernel.org>; Jonathan Cameron
> <jic23@kernel.org>; Hennerich, Michael
> <Michael.Hennerich@analog.com>; Lars-Peter Clausen
> <lars@metafoo.de>
> Subject: Re: [PATCH 3/7] iio: adis16475: do not return ints in irq
> handlers
> 
> [External]
> 
> On Tue, Apr 13, 2021 at 5:45 PM Nuno Sa <nuno.sa@analog.com>
> wrote:
> >
> > On an IRQ handler we should return normal error codes as
> 'irqreturn_t'
> > is expected.
> >
> > Fixes: fff7352bf7a3c ("iio: imu: Add support for adis16475")
> >
> > Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> > ---
> >  drivers/iio/imu/adis16475.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c
> > index 1de62fc79e0f..51b76444db0b 100644
> > --- a/drivers/iio/imu/adis16475.c
> > +++ b/drivers/iio/imu/adis16475.c
> > @@ -1068,7 +1068,7 @@ static irqreturn_t
> adis16475_trigger_handler(int irq, void *p)
> >
> >         ret = spi_sync(adis->spi, &adis->msg);
> >         if (ret)
> > -               return ret;
> > +               goto check_burst32;
> 
> This is also going to call adis16475_burst32_check().
> Which in itself is [probably] an undesired behavior change.
> 
> Maybe this needs a new 'irq_done' label?

That was intentional. If someone changed the decimation or the FIR
filters so that we can change to burst32, we can just do it now...
Alexandru Ardelean April 15, 2021, 8:17 a.m. UTC | #3
On Thu, Apr 15, 2021 at 10:38 AM Sa, Nuno <Nuno.Sa@analog.com> wrote:
>
>
> > From: Alexandru Ardelean <ardeleanalex@gmail.com>
> > Sent: Wednesday, April 14, 2021 9:27 AM
> > To: Sa, Nuno <Nuno.Sa@analog.com>
> > Cc: linux-iio <linux-iio@vger.kernel.org>; Jonathan Cameron
> > <jic23@kernel.org>; Hennerich, Michael
> > <Michael.Hennerich@analog.com>; Lars-Peter Clausen
> > <lars@metafoo.de>
> > Subject: Re: [PATCH 3/7] iio: adis16475: do not return ints in irq
> > handlers
> >
> > [External]
> >
> > On Tue, Apr 13, 2021 at 5:45 PM Nuno Sa <nuno.sa@analog.com>
> > wrote:
> > >
> > > On an IRQ handler we should return normal error codes as
> > 'irqreturn_t'
> > > is expected.
> > >
> > > Fixes: fff7352bf7a3c ("iio: imu: Add support for adis16475")
> > >
> > > Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> > > ---
> > >  drivers/iio/imu/adis16475.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c
> > > index 1de62fc79e0f..51b76444db0b 100644
> > > --- a/drivers/iio/imu/adis16475.c
> > > +++ b/drivers/iio/imu/adis16475.c
> > > @@ -1068,7 +1068,7 @@ static irqreturn_t
> > adis16475_trigger_handler(int irq, void *p)
> > >
> > >         ret = spi_sync(adis->spi, &adis->msg);
> > >         if (ret)
> > > -               return ret;
> > > +               goto check_burst32;
> >
> > This is also going to call adis16475_burst32_check().
> > Which in itself is [probably] an undesired behavior change.
> >
> > Maybe this needs a new 'irq_done' label?
>
> That was intentional. If someone changed the decimation or the FIR
> filters so that we can change to burst32, we can just do it now...
>

ack
diff mbox series

Patch

diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c
index 1de62fc79e0f..51b76444db0b 100644
--- a/drivers/iio/imu/adis16475.c
+++ b/drivers/iio/imu/adis16475.c
@@ -1068,7 +1068,7 @@  static irqreturn_t adis16475_trigger_handler(int irq, void *p)
 
 	ret = spi_sync(adis->spi, &adis->msg);
 	if (ret)
-		return ret;
+		goto check_burst32;
 
 	adis->spi->max_speed_hz = cached_spi_speed_hz;
 	buffer = adis->buffer;