* [PATCH] iio: gyro: adis16130: remove mlock usage
@ 2019-09-17 16:10 Alexandru Ardelean
2019-10-05 12:45 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Alexandru Ardelean @ 2019-09-17 16:10 UTC (permalink / raw)
To: linux-iio; +Cc: jic23, Alexandru Ardelean
The use of indio_dev's mlock is discouraged. The driver already defines
it's own `bus_lock` in `adis16130_spi_read()`, so using the mlock is
redundant.
The parts supported by this chip are obsoleted anyway, so for now we just
remove mlock as part of a general cleanup, until the driver gets removed.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
drivers/iio/gyro/adis16130.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/iio/gyro/adis16130.c b/drivers/iio/gyro/adis16130.c
index de3f66f89496..79e63c8a2ea8 100644
--- a/drivers/iio/gyro/adis16130.c
+++ b/drivers/iio/gyro/adis16130.c
@@ -76,9 +76,7 @@ static int adis16130_read_raw(struct iio_dev *indio_dev,
switch (mask) {
case IIO_CHAN_INFO_RAW:
/* Take the iio_dev status lock */
- mutex_lock(&indio_dev->mlock);
ret = adis16130_spi_read(indio_dev, chan->address, &temp);
- mutex_unlock(&indio_dev->mlock);
if (ret)
return ret;
*val = temp;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] iio: gyro: adis16130: remove mlock usage
2019-09-17 16:10 [PATCH] iio: gyro: adis16130: remove mlock usage Alexandru Ardelean
@ 2019-10-05 12:45 ` Jonathan Cameron
2019-10-07 7:07 ` Ardelean, Alexandru
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2019-10-05 12:45 UTC (permalink / raw)
To: Alexandru Ardelean; +Cc: linux-iio
On Tue, 17 Sep 2019 19:10:23 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
> The use of indio_dev's mlock is discouraged. The driver already defines
> it's own `bus_lock` in `adis16130_spi_read()`, so using the mlock is
> redundant.
>
> The parts supported by this chip are obsoleted anyway, so for now we just
> remove mlock as part of a general cleanup, until the driver gets removed.
Hmm. Removing a device driver like this which isn't in staging is going
to be controversial. There may well be long term supported devices out
there using it. We have no way of knowing, so my inclination will be
to leave it there unless it is a significant maintenance burden.
The drivers in staging are a different matter as we never made any
'promise' of supporting those!
I'll hazard a guess that mlock here was cut and paste from another driver
and that driver supported buffered modes. In those cases it would need
to move to the utility functions to ensure we are not in buffered mode.
Here your fix is right though given the driver only support sysfs reads.
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.
Thanks,
Jonathan
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
> drivers/iio/gyro/adis16130.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/iio/gyro/adis16130.c b/drivers/iio/gyro/adis16130.c
> index de3f66f89496..79e63c8a2ea8 100644
> --- a/drivers/iio/gyro/adis16130.c
> +++ b/drivers/iio/gyro/adis16130.c
> @@ -76,9 +76,7 @@ static int adis16130_read_raw(struct iio_dev *indio_dev,
> switch (mask) {
> case IIO_CHAN_INFO_RAW:
> /* Take the iio_dev status lock */
> - mutex_lock(&indio_dev->mlock);
> ret = adis16130_spi_read(indio_dev, chan->address, &temp);
> - mutex_unlock(&indio_dev->mlock);
> if (ret)
> return ret;
> *val = temp;
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iio: gyro: adis16130: remove mlock usage
2019-10-05 12:45 ` Jonathan Cameron
@ 2019-10-07 7:07 ` Ardelean, Alexandru
0 siblings, 0 replies; 3+ messages in thread
From: Ardelean, Alexandru @ 2019-10-07 7:07 UTC (permalink / raw)
To: jic23@kernel.org; +Cc: linux-iio@vger.kernel.org
On Sat, 2019-10-05 at 13:45 +0100, Jonathan Cameron wrote:
> [External]
>
> On Tue, 17 Sep 2019 19:10:23 +0300
> Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
>
> > The use of indio_dev's mlock is discouraged. The driver already defines
> > it's own `bus_lock` in `adis16130_spi_read()`, so using the mlock is
> > redundant.
> >
> > The parts supported by this chip are obsoleted anyway, so for now we
> > just
> > remove mlock as part of a general cleanup, until the driver gets
> > removed.
> Hmm. Removing a device driver like this which isn't in staging is going
> to be controversial. There may well be long term supported devices out
> there using it. We have no way of knowing, so my inclination will be
> to leave it there unless it is a significant maintenance burden.
I'll admit I'm sometimes a bit trigger-happy [still] about removing drivers
that are marked obsolete on the company product-site.
This usually [for me] goes away with time [the trigger-happiness].
>
> The drivers in staging are a different matter as we never made any
> 'promise' of supporting those!
>
> I'll hazard a guess that mlock here was cut and paste from another driver
> and that driver supported buffered modes. In those cases it would need
> to move to the utility functions to ensure we are not in buffered mode.
>
> Here your fix is right though given the driver only support sysfs reads.
>
> Applied to the togreg branch of iio.git and pushed out as testing for
> the autobuilders to play with it.
>
> Thanks,
>
> Jonathan
>
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> > ---
> > drivers/iio/gyro/adis16130.c | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/iio/gyro/adis16130.c
> > b/drivers/iio/gyro/adis16130.c
> > index de3f66f89496..79e63c8a2ea8 100644
> > --- a/drivers/iio/gyro/adis16130.c
> > +++ b/drivers/iio/gyro/adis16130.c
> > @@ -76,9 +76,7 @@ static int adis16130_read_raw(struct iio_dev
> > *indio_dev,
> > switch (mask) {
> > case IIO_CHAN_INFO_RAW:
> > /* Take the iio_dev status lock */
> > - mutex_lock(&indio_dev->mlock);
> > ret = adis16130_spi_read(indio_dev, chan->address, &temp);
> > - mutex_unlock(&indio_dev->mlock);
> > if (ret)
> > return ret;
> > *val = temp;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-07 7:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-17 16:10 [PATCH] iio: gyro: adis16130: remove mlock usage Alexandru Ardelean
2019-10-05 12:45 ` Jonathan Cameron
2019-10-07 7:07 ` Ardelean, Alexandru
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox