Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Ardelean <ardeleanalex@gmail.com>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
	linux-iio <linux-iio@vger.kernel.org>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>
Subject: Re: [PATCH] iio: adis16475: fix deadlock on frequency set
Date: Sat, 25 Sep 2021 16:01:42 +0100	[thread overview]
Message-ID: <20210925160133.17801b47@jic23-huawei> (raw)
In-Reply-To: <CA+U=DsoVS74-eQ_aj96QU1ayTd4WKg7FgZGDnt=W81sDjXk7XA@mail.gmail.com>

On Mon, 20 Sep 2021 14:42:25 +0300
Alexandru Ardelean <ardeleanalex@gmail.com> wrote:

> On Mon, Sep 20, 2021 at 12:59 PM Nuno Sá <nuno.sa@analog.com> wrote:
> >
> > With commit 39c024b51b560
> > ("iio: adis16475: improve sync scale mode handling"), two deadlocks were
> > introduced:
> >  1) The call to 'adis_write_reg_16()' was not changed to it's unlocked
> >     version.
> >  2) The lock was not being released on the success path of the function.
> >
> > This change fixes both these issues.
> >  
> 
> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

> 
> > Fixes: 39c024b51b560 ("iio: adis16475: improve sync scale mode handling")
> > Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> > ---
> >  drivers/iio/imu/adis16475.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c
> > index eb48102f9424..287fff39a927 100644
> > --- a/drivers/iio/imu/adis16475.c
> > +++ b/drivers/iio/imu/adis16475.c
> > @@ -353,10 +353,11 @@ static int adis16475_set_freq(struct adis16475 *st, const u32 freq)
> >         if (dec > st->info->max_dec)
> >                 dec = st->info->max_dec;
> >
> > -       ret = adis_write_reg_16(&st->adis, ADIS16475_REG_DEC_RATE, dec);
> > +       ret = __adis_write_reg_16(&st->adis, ADIS16475_REG_DEC_RATE, dec);
> >         if (ret)
> >                 goto error;
> >
> > +       adis_dev_unlock(&st->adis);
> >         /*
> >          * If decimation is used, then gyro and accel data will have meaningful
> >          * bits on the LSB registers. This info is used on the trigger handler.
> > --
> > 2.33.0
> >  


      reply	other threads:[~2021-09-25 14:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20  9:00 [PATCH] iio: adis16475: fix deadlock on frequency set Nuno Sá
2021-09-20 11:42 ` Alexandru Ardelean
2021-09-25 15:01   ` Jonathan Cameron [this message]

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=20210925160133.17801b47@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=ardeleanalex@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /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