mbox series

[0/5] Fixes and improvements to the ADIS lib/devices

Message ID 20210903141423.517028-1-nuno.sa@analog.com (mailing list archive)
Headers show
Series Fixes and improvements to the ADIS lib/devices | expand

Message

Nuno Sa Sept. 3, 2021, 2:14 p.m. UTC
This series adds some fixes and improvements for the ADIS library and
devices. There are two fixes:
 
1) On the library 'adis_init()' function, a call to 'adis_enable_irq()'
was being done. That does not make sense because
'__adis_initial_startup()' will reset the device and put the data ready
pin in the default state. For some drivers, these could mean that we
were leaving probe in a state different from the desired one.
2) The adis16480 driver was registering a managed reset action to put
the device into sleep mode in the unbinding path. Well, not all devices
supported by the driver support sleep mode.
 
The rest of the series is a minor improvement about passing the handling of
enabling/disabling IRQs (for devices that cannot unmask the data ready
pin) inside the library.

Nuno Sá (5):
  iio: adis: do not disabe IRQs in 'adis_init()'
  iio: adis: handle devices that cannot unmask the drdy pin
  iio: adis16475: make use of the new unmasked_drdy flag
  iio: adis16460: make use of the new unmasked_drdy flag
  iio: adis16480: fix devices that do not support sleep mode

 drivers/iio/imu/adis.c         | 17 ++++++++++++++++-
 drivers/iio/imu/adis16460.c    | 18 +-----------------
 drivers/iio/imu/adis16475.c    | 19 +------------------
 drivers/iio/imu/adis16480.c    | 14 +++++++++++---
 drivers/iio/imu/adis_trigger.c |  4 ++++
 include/linux/iio/imu/adis.h   |  2 ++
 6 files changed, 35 insertions(+), 39 deletions(-)

Comments

Jonathan Cameron Sept. 5, 2021, 1:39 p.m. UTC | #1
On Fri, 3 Sep 2021 16:14:18 +0200
Nuno Sá <nuno.sa@analog.com> wrote:

> This series adds some fixes and improvements for the ADIS library and
> devices. There are two fixes:
>  
> 1) On the library 'adis_init()' function, a call to 'adis_enable_irq()'
> was being done. That does not make sense because
> '__adis_initial_startup()' will reset the device and put the data ready
> pin in the default state. For some drivers, these could mean that we
> were leaving probe in a state different from the desired one.
> 2) The adis16480 driver was registering a managed reset action to put
> the device into sleep mode in the unbinding path. Well, not all devices
> supported by the driver support sleep mode.
>  
> The rest of the series is a minor improvement about passing the handling of
> enabling/disabling IRQs (for devices that cannot unmask the data ready
> pin) inside the library.
> 
> Nuno Sá (5):
>   iio: adis: do not disabe IRQs in 'adis_init()'
>   iio: adis: handle devices that cannot unmask the drdy pin
>   iio: adis16475: make use of the new unmasked_drdy flag
>   iio: adis16460: make use of the new unmasked_drdy flag
>   iio: adis16480: fix devices that do not support sleep mode

Hi Nuno.

Series looks good to me but I'd like it to sit on list a little longer before
I take any of it.

Would have been 'nice' to have had the two fixes at the start of the series
as they should probably go via stable whereas the 3 patches moving things
into the core are 5.16 material.

Looks like I should be fine picking two fixes up even in this order though so
not a big issue.

Thanks,

Jonathan

> 
>  drivers/iio/imu/adis.c         | 17 ++++++++++++++++-
>  drivers/iio/imu/adis16460.c    | 18 +-----------------
>  drivers/iio/imu/adis16475.c    | 19 +------------------
>  drivers/iio/imu/adis16480.c    | 14 +++++++++++---
>  drivers/iio/imu/adis_trigger.c |  4 ++++
>  include/linux/iio/imu/adis.h   |  2 ++
>  6 files changed, 35 insertions(+), 39 deletions(-)
>
Nuno Sa Sept. 6, 2021, 8:56 a.m. UTC | #2
> -----Original Message-----
> From: Jonathan Cameron <jic23@kernel.org>
> Sent: Sunday, September 5, 2021 3:40 PM
> To: Sa, Nuno <Nuno.Sa@analog.com>
> Cc: linux-iio@vger.kernel.org; Lars-Peter Clausen <lars@metafoo.de>;
> Hennerich, Michael <Michael.Hennerich@analog.com>; Bogdan,
> Dragos <Dragos.Bogdan@analog.com>
> Subject: Re: [PATCH 0/5] Fixes and improvements to the ADIS
> lib/devices
> 
> On Fri, 3 Sep 2021 16:14:18 +0200
> Nuno Sá <nuno.sa@analog.com> wrote:
> 
> > This series adds some fixes and improvements for the ADIS library
> and
> > devices. There are two fixes:
> >
> > 1) On the library 'adis_init()' function, a call to 'adis_enable_irq()'
> > was being done. That does not make sense because
> > '__adis_initial_startup()' will reset the device and put the data ready
> > pin in the default state. For some drivers, these could mean that we
> > were leaving probe in a state different from the desired one.
> > 2) The adis16480 driver was registering a managed reset action to put
> > the device into sleep mode in the unbinding path. Well, not all
> devices
> > supported by the driver support sleep mode.
> >
> > The rest of the series is a minor improvement about passing the
> handling of
> > enabling/disabling IRQs (for devices that cannot unmask the data
> ready
> > pin) inside the library.
> >
> > Nuno Sá (5):
> >   iio: adis: do not disabe IRQs in 'adis_init()'
> >   iio: adis: handle devices that cannot unmask the drdy pin
> >   iio: adis16475: make use of the new unmasked_drdy flag
> >   iio: adis16460: make use of the new unmasked_drdy flag
> >   iio: adis16480: fix devices that do not support sleep mode
> 
> Hi Nuno.
> 
> Series looks good to me but I'd like it to sit on list a little longer before
> I take any of it.
> 
> Would have been 'nice' to have had the two fixes at the start of the
> series
> as they should probably go via stable whereas the 3 patches moving
> things
> into the core are 5.16 material.

I actually wondered about this but since the adis16480 fix has no
dependencies on the lib stuff I ended up doing the lib patches first
and then the drivers. Next time I will send fixes together...

- Nuno Sá