From: Varsha Rao <rvarsha016@gmail.com>
To: outreachy-kernel <outreachy-kernel@googlegroups.com>
Cc: rvarsha016@gmail.com, Michael.Hennerich@analog.com,
jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net,
gregkh@linuxfoundation.org, 21cnbao@gmail.com,
linux-iio@vger.kernel.org, lars@metafoo.de
Subject: Re: [PATCH 1/2] staging: iio: adis16240: Replace mlock with driver private lock.
Date: Mon, 13 Mar 2017 07:39:41 -0700 (PDT) [thread overview]
Message-ID: <677299aa-1a1c-412c-85cf-b9117be3e4be@googlegroups.com> (raw)
In-Reply-To: <45f0ef85-3753-946f-4956-6cba4e8a6859@metafoo.de>
[-- Attachment #1.1: Type: text/plain, Size: 1017 bytes --]
> > +++ b/drivers/staging/iio/accel/adis16240.c
> > @@ -229,11 +229,12 @@ static ssize_t adis16240_read_12bit_signed(struct
> device *dev,
> > {
> > ssize_t ret;
> > struct iio_dev *indio_dev = dev_to_iio_dev(dev);
> > + struct adis *st = iio_priv(indio_dev);
> >
> > /* Take the iio_dev status lock */
> > - mutex_lock(&indio_dev->mlock);
> > + mutex_lock(&st->txrx_lock);
>
> This unfortunately wont work. The adis_read_reg()/adis_write_reg()
> functions
> take the txrx_lock. So this change causes a deadlock, trying to take a
> lock
> that is already locked.
>
> Yes, it would cause deadlock. Can the lock be placed within the
adis_read_reg() function and removing locks from other place?
> But this lock can probably be removed. It should be safe to run the
> function
> multiple times in parallel.
>
> Same for the other changes in this patch.
>
Then should I remove all the locks in this file?
Thanks,
Varsha
[-- Attachment #1.2: Type: text/html, Size: 1484 bytes --]
next prev parent reply other threads:[~2017-03-13 14:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1489395260.git.rvarsha016@gmail.com>
2017-03-13 9:23 ` [PATCH 1/2] staging: iio: adis16240: Replace mlock with driver private lock Varsha Rao
2017-03-13 11:47 ` Lars-Peter Clausen
2017-03-13 14:39 ` Varsha Rao [this message]
2017-03-13 9:23 ` [PATCH 2/2] staging: iio: adis16240: Modify existing comment Varsha Rao
2017-03-13 11:39 ` Lars-Peter Clausen
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=677299aa-1a1c-412c-85cf-b9117be3e4be@googlegroups.com \
--to=rvarsha016@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).