From: sashiko-bot@kernel.org
To: Zqiang <qiang.zhang@linux.dev>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [PATCH] gpiolib: Use srcu_barrier() instead of synchronize_srcu() in gpiodev_release()
Date: Fri, 27 Nov 2026 02:41:32 +0000 [thread overview]
Message-ID: <sashiko-outbox-236458@kernel.org> (raw)
In-Reply-To: <20261127023101.27568-1-qiang.zhang@linux.dev>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] gpiolib: missing Fixes trailer for srcu_barrier() fix in
gpiodev_release()
--
commit 7bde1b2938982ae74ae917349eb9ea19f1b65da8
Author: Zqiang <qiang.zhang@linux.dev>
> gpiolib: Use srcu_barrier() instead of synchronize_srcu() in gpiodev_release()
>
> The gpio_desc_label object are freed asynchronously via call_srcu() on
> gdev->desc_srcu (see desc_set_label()). to drain these pending SRCU
> callbacks before cleanup the SRCU structure, gpiodev_release() currently
> calls synchronize_srcu(&gdev->desc_srcu).
>
> However, synchronize_srcu() only waits for a grace period to elapse and
> for its own wakeme_after_rcu callback to be invoked. it does not guarantee
> that callbacks queued on other CPUs have actually been invoked by the time
> it returns. The following race may happen:
>
> CPUA CPUB
> call_srcu(desc_srcu, desc_free_label)
>
> gpiodev_release()
> ->synchronize_srcu()
> ->call_srcu() queue wakeme_after_rcu()
>
> SRCU GP end
> timer_reduce(delay_work)
>
> SRCU GP end
> synchronize_srcu() return
> ->cleanup_srcu_struct()
> /* timer still pending! */ ->for CPUA timer_delete_sync() return true
> and cblist not empty. tigger WARN_ON()
>
> This commit therefore use srcu_barrier() instead of synchronize_srcu() on
> gdev->desc_srcu, it entrains a barrier callback on every CPU that has callbacks
> queued and waits until all of them have been invoked.
>
> Signed-off-by: Zqiang <qiang.zhang@linux.dev>
[Severity: Low]
Should this include a Fixes tag for commit 7765ffed533d ("gpiolib: use a
single SRCU struct for all GPIO descriptors") (or commit a86d27693066
("gpiolib: fix the speed of descriptor label setting with SRCU"), which
originally paired call_srcu() with synchronize_srcu() before
cleanup_srcu_struct())?
Fixes: 7765ffed533d ("gpiolib: use a single SRCU struct for all GPIO descriptors")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261127023101.27568-1-qiang.zhang@linux.dev?part=1
next prev parent reply other threads:[~2026-11-27 2:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 2:31 [PATCH] gpiolib: Use srcu_barrier() instead of synchronize_srcu() in gpiodev_release() Zqiang
2026-11-27 2:41 ` sashiko-bot [this message]
2026-11-27 7:09 ` Adrian Ambrozewicz
2026-11-27 11:39 ` Zqiang
-- strict thread matches above, loose matches on Subject: below --
2026-11-26 8:42 Zqiang
2026-11-26 8:52 ` sashiko-bot
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=sashiko-outbox-236458@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=qiang.zhang@linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/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.