From: "Nuno Sá" <noname.nuno@gmail.com>
To: Ramona Bolboaca <ramona.bolboaca@analog.com>,
jic23@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/8] Remove adis_initial_startup usage
Date: Wed, 02 Nov 2022 16:27:06 +0100 [thread overview]
Message-ID: <20ea4d6a3cd2a01fe0c5a5a6db1b2ed05548cf8f.camel@gmail.com> (raw)
In-Reply-To: <20221102141843.122182-1-ramona.bolboaca@analog.com>
On Wed, 2022-11-02 at 16:18 +0200, Ramona Bolboaca wrote:
> Remove adis_initial_startup usage due to the fact that it leads to a
> deadlock.
> The same mutex is acquired twice, without releasing it, once inside
> adis_initial_startup and once inside adis_enable_irq.
> Instead of adis_initial_startup, use __adis_initial_startup.
>
Auchhhh!!! Thanks for catching this... However, the Fixes tag is
pointing to the wrong place. I'm fairly sure I introduced this bug in
commit b600bd7eb3335 ("iio: adis: do not disabe IRQs in 'adis_init()'")
This was where the call to adis_enable_irq() was moved to
__adis_initial_startup() and effectively creating the deadlock for some
devices (adis->data->unmasked_drdy is not set)...
I guess I did not saw this when bringing in the change because I
probably tested the full series on some device supported by adis16475.c
where this won't trigger.
From a quick look I think it's safe to drop adis_initial_startup() as
it is always called during probe() before registering the IIO device.
We could also just create an unlocked version of adis_enable_irq()
(since we don't need to grab the lock in this path) but likely not
worth the trouble.
- Nuno Sá
prev parent reply other threads:[~2022-11-02 15:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 14:18 Ramona Bolboaca
2022-11-02 14:18 ` [PATCH 1/8] iio: accel: adis16201: Fix deadlock in probe Ramona Bolboaca
2022-11-02 14:18 ` [PATCH 2/8] iio: accel: adis16209: " Ramona Bolboaca
2022-11-02 14:18 ` [PATCH 3/8] iio: gyro: adis16136: " Ramona Bolboaca
2022-11-02 14:18 ` [PATCH 4/8] iio: gyro: adis16260: " Ramona Bolboaca
2022-11-02 14:18 ` [PATCH 5/8] iio: imu: adis16400: " Ramona Bolboaca
2022-11-02 14:18 ` [PATCH 6/8] staging: iio: accel: adis16203: " Ramona Bolboaca
2022-11-02 14:18 ` [PATCH 7/8] staging: iio: accel: adis16240: " Ramona Bolboaca
2022-11-02 14:18 ` [PATCH 8/8] iio: imu: adis: Remove adis_initial_startup function Ramona Bolboaca
2022-11-02 15:27 ` Nuno Sá [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=20ea4d6a3cd2a01fe0c5a5a6db1b2ed05548cf8f.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ramona.bolboaca@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
all inboxes | Powered by JetHome®