From: Aishwarya Pant <aishpant@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Barry Song <21cnbao@gmail.com>,
outreachy-kernel@googlegroups.com, linux-iio@vger.kernel.org
Subject: Re: [PATCH v3] staging: iio: accel: adis16201: remove iio_dev mlock
Date: Mon, 20 Mar 2017 16:04:32 +0530 [thread overview]
Message-ID: <20170320103432.GA8228@aishwarya> (raw)
In-Reply-To: <c4f803ee-8a6a-520e-2be3-bb68a57a8303@kernel.org>
On Sun, Mar 19, 2017 at 10:19:42AM +0000, Jonathan Cameron wrote:
> On 17/03/17 21:43, Aishwarya Pant wrote:
> > In the driver adis16201 read raw does not require an iio_dev->mlock for
> > reads. It can run concurrently as adis_read_reg_16() is protected by a
> > transaction lock.
> >
> > Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
> Great, one suggestion for a follow up patch below.
>
> Applied to the togreg branch of iio.git and pushed out as testing for
> the autobuilders to play with it.
>
> Thanks,
>
> Jonathan
> >
> > ---
> > Changes in v3:
> > -- Fix change log format
> > -- Send patch to linuc-iio
> > Changes in v2:
> > -- Remove read lock
> >
> > drivers/staging/iio/accel/adis16201.c | 6 +-----
> > 1 file changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel/adis16201.c
> > index d6c8658..fd2baf2 100644
> > --- a/drivers/staging/iio/accel/adis16201.c
> > +++ b/drivers/staging/iio/accel/adis16201.c
> > @@ -223,17 +223,13 @@ static int adis16201_read_raw(struct iio_dev *indio_dev,
> > default:
> > return -EINVAL;
> > }
> > - mutex_lock(&indio_dev->mlock);
> > addr = adis16201_addresses[chan->scan_index];
> > ret = adis_read_reg_16(st, addr, &val16);
> Not a lot of point in having the local variable addr given it's
> only used here. Perhaps you could follow up with a patch getting
> rid of it?
Sure. I will look at clean-up opportunities here.
But I'm unsure of where I should be rebasing from?
greg's staging tree or the togreg branch of the iio tree.
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/
According to the link, togreg was last updated 2 weeks ago.
thanks
Aishwarya
> > - if (ret) {
> > - mutex_unlock(&indio_dev->mlock);
> > + if (ret)
> > return ret;
> > - }
> > val16 &= (1 << bits) - 1;
> > val16 = (s16)(val16 << (16 - bits)) >> (16 - bits);
> > *val = val16;
> > - mutex_unlock(&indio_dev->mlock);
> > return IIO_VAL_INT;
> > }
> > return -EINVAL;
> >
>
next prev parent reply other threads:[~2017-03-20 10:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-17 21:43 [PATCH v3] staging: iio: accel: adis16201: remove iio_dev mlock Aishwarya Pant
2017-03-18 16:30 ` [Outreachy kernel] " Alison Schofield
2017-03-19 10:19 ` Jonathan Cameron
2017-03-20 10:34 ` Aishwarya Pant [this message]
2017-03-20 19:36 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170320103432.GA8228@aishwarya \
--to=aishpant@gmail.com \
--cc=21cnbao@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=outreachy-kernel@googlegroups.com \
--cc=pmeerw@pmeerw.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.