From: Myeonghun Pak <mhun512@gmail.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>
Cc: dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Ijae Kim <ae878000@gmail.com>
Subject: [PATCH] drm/lima: disable the recover work before tearing down the scheduler
Date: Mon, 9 Nov 2026 23:30:03 -0500 [thread overview]
Message-ID: <20261110043003.56648-1-mhun512@gmail.com> (raw)
GP and GP MMU interrupt handlers queue pipe->recover_work to grow a
faulting task's heap and resume it. lima_device_fini() tears down the
pipes before freeing these interrupts, without cancelling the work.
It can therefore run during or after drm_sched_fini(), access hardware
after clocks are disabled, or use the freed lima_device.
Disable the work before drm_sched_fini(). Use disable_work_sync()
because interrupts can still queue it until lima_fini_ip() frees them.
Probe initializes fresh work on rebind.
Found by a static analysis tool under development.
Fixes: 2081e8dcf1ee ("drm/lima: recover task by enlarging heap buffer")
Cc: stable@vger.kernel.org # v6.10+
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c
index 9a1e6b9ecbe5..7a9ccca1291a 100644
--- a/drivers/gpu/drm/lima/lima_sched.c
+++ b/drivers/gpu/drm/lima/lima_sched.c
@@ -539,6 +539,7 @@ int lima_sched_pipe_init(struct lima_sched_pipe *pipe, const char *name)
void lima_sched_pipe_fini(struct lima_sched_pipe *pipe)
{
+ disable_work_sync(&pipe->recover_work);
drm_sched_fini(&pipe->base);
}
base-commit: 630059a5a632377b9b7b487baccde92b7ae1dd47
--
2.43.0
reply other threads:[~2026-11-10 4:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261110043003.56648-1-mhun512@gmail.com \
--to=mhun512@gmail.com \
--cc=ae878000@gmail.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=lima@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--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®