From: "Nuno Sá" <noname.nuno@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>,
David Lechner <dlechner@baylibre.com>
Cc: nuno.sa@analog.com, linux-iio@vger.kernel.org,
Andy Shevchenko <andy@kernel.org>
Subject: Re: [PATCH] iio: buffer: Fix wait_queue not being removed
Date: Mon, 23 Feb 2026 13:39:37 +0000 [thread overview]
Message-ID: <09ea310dee18ba2174c29e078dce00a539a20a27.camel@gmail.com> (raw)
In-Reply-To: <20260222123756.59273a33@jic23-huawei>
On Sun, 2026-02-22 at 12:37 +0000, Jonathan Cameron wrote:
> On Sat, 21 Feb 2026 15:27:42 -0600
> David Lechner <dlechner@baylibre.com> wrote:
>
> > On 2/16/26 7:24 AM, Nuno Sá via B4 Relay wrote:
> > > From: Nuno Sá <nuno.sa@analog.com>
> > >
> > > In the edge case where the IIO device is unregistered while we're
> > > buffering, we were directly returning an error without removing the wait
> > > queue. Instead, set 'ret' and break out of the loop.
> > >
> > > Fixes: 9eeee3b0bf19 ("iio: Add output buffer support")
> > > Signed-off-by: Nuno Sá <nuno.sa@analog.com>
> > > ---
> > Reviewed-by: David Lechner <dlechner@baylibre.com>
> >
> This brings the code inline with the near identical
> flow in the read path.
>
> It's been a while since I last looked at the locking / tear
> down (what that ->info check is all about). I'll add actually
Yeah not sure if you remember but I already said this a couple of times. In the buffer
paths I'm not convinced the check we have is enough. Still very open to races AFAICT.
I have it in my list to try and trigger and actual issue/dump on that path so it's not just
theory. Already asked the bot to write some stressor/test code :).
> documenting all the corner cases to the todo list as IIRC
> there are some non obvious ordering constraints. IIRC,
> in the buffer paths, it is fairly straight forward
> as it's just an optimization to avoid queuing or draining
> data when the device is going down - nothing about the buffers
> themselves involves interacting directly with the hardware.
>
> Applied to the fixes-togreg branch of iio.git and marked
> for stable.
>
BTW, I just realized we now have an Assisted-by: tag for getting help from AI. I should
say that this bug was identified by Claude code (when bulding the stressor test app I
mentioned above :)). So, maybe (or can we Reported by: Claude Code?!!):
Assisted-by: Claude Code
- Nuno Sá
next prev parent reply other threads:[~2026-02-23 13:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 13:24 [PATCH] iio: buffer: Fix wait_queue not being removed Nuno Sá via B4 Relay
2026-02-21 21:27 ` David Lechner
2026-02-22 12:37 ` Jonathan Cameron
2026-02-23 13:39 ` Nuno Sá [this message]
2026-02-23 15:05 ` Andy Shevchenko
2026-02-23 17:08 ` Nuno Sá
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=09ea310dee18ba2174c29e078dce00a539a20a27.camel@gmail.com \
--to=noname.nuno@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--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