From: Jiale Yao <yaojiale02@163.com>
To: Qiang Yu <yuq825@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Eric Anholt <eric@anholt.net>,
Erico Nunes <nunes.erico@gmail.com>,
Rob Herring <robh@kerrnel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Andreas Baierl <ichgeh@imkreisrum.de>,
dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Cc: Jiale Yao <yaojiale02@163.com>
Subject: [PATCH 3/3] drm/lima: Drain fence callbacks before destroying slab
Date: Sun, 27 Sep 2026 00:25:52 +0800 [thread overview]
Message-ID: <20260926162554.163197-4-yaojiale02@163.com> (raw)
In-Reply-To: <20260926162554.163197-1-yaojiale02@163.com>
lima_fence_release() defers freeing fences from lima_fence_slab to an
RCU callback. The last lima_sched_slab_fini() can destroy the slab and
clear its pointer while a release callback is still queued. Module removal
can also free lima_fence_release_rcu() before that callback runs.
Drain outstanding callbacks before destroying the last fence slab.
Fixes: a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
drivers/gpu/drm/lima/lima_sched.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c
index 9a1e6b9ecbe5..9c5ff1929d3e 100644
--- a/drivers/gpu/drm/lima/lima_sched.c
+++ b/drivers/gpu/drm/lima/lima_sched.c
@@ -44,6 +44,7 @@ int lima_sched_slab_init(void)
void lima_sched_slab_fini(void)
{
if (!--lima_fence_slab_refcnt) {
+ rcu_barrier();
kmem_cache_destroy(lima_fence_slab);
lima_fence_slab = NULL;
}
--
2.34.1
prev parent reply other threads:[~2026-09-26 16:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-26 16:25 [PATCH 0/3] Drain module-owned RCU callbacks during teardown Jiale Yao
2026-09-26 16:25 ` [PATCH 1/3] vfio/pci: Drain eventfd RCU callbacks on module exit Jiale Yao
2026-09-26 16:25 ` [PATCH 2/3] tun: Drain eBPF " Jiale Yao
2026-09-28 18:51 ` Willem de Bruijn
2026-10-01 23:12 ` Jakub Kicinski
2026-10-03 9:45 ` jiale yao
2026-09-26 16:25 ` Jiale Yao [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=20260926162554.163197-4-yaojiale02@163.com \
--to=yaojiale02@163.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric@anholt.net \
--cc=ichgeh@imkreisrum.de \
--cc=lima@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=nunes.erico@gmail.com \
--cc=robh@kerrnel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=yuq825@gmail.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®