From: Vladimir Zapolskiy <vz@kernel.org>
To: Rob Clark <robin.clark@oss.qualcomm.com>,
Dmitry Baryshkov <lumag@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>
Cc: Abhinav Kumar <abhinav.kumar@linux.dev>,
Jessica Zhang <jesszhan0024@gmail.com>,
Sean Paul <sean@poorly.run>,
Marijn Suijten <marijn.suijten@somainline.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
freedreno@lists.freedesktop.org
Subject: [PATCH 1/2] drm/msm: fbdev: Unpin the framebuffer buffer object on destroy
Date: Thu, 26 Nov 2026 19:05:34 +0200 [thread overview]
Message-ID: <20261126170535.361985-2-vz@kernel.org> (raw)
In-Reply-To: <20261126170535.361985-1-vz@kernel.org>
The fbdev emulation pins the framebuffer buffer object in the KMS
address space and maps it on probe, however on fbdev destruction only
the mapping is released, and the buffer object is freed while still
pinned. For instance on removal of a DSI panel driver module, which
unbinds the MSM DRM driver, the next warning message is displayed:
msm_obj->pin_count
WARNING: drivers/gpu/drm/msm/msm_gem.c:173 at update_lru_locked+0x90/0x98
Call trace:
update_lru_locked+0x90/0x98 (P)
put_pages+0x8c/0x104
msm_gem_free_object+0x1bc/0x244
drm_gem_object_free+0x1c/0x30
drm_client_buffer_delete+0xd4/0xf8
msm_fbdev_fb_destroy+0x54/0x6c
put_fb_info+0x48/0x84
unregister_framebuffer+0x88/0xf8
drm_fb_helper_unregister_info+0x14/0x20
drm_fbdev_client_unregister+0x18/0x34
drm_client_dev_unregister+0x80/0xfc
drm_dev_unregister+0x24/0x98
msm_drm_uninit.isra.0+0x8c/0xcc
Unpin the buffer object on fbdev destruction in the same way as it is
done on the error path of the fbdev probe.
Fixes: 940b869c2f2f ("drm/msm: Implement fbdev emulation as in-kernel client")
Signed-off-by: Vladimir Zapolskiy <vz@kernel.org>
---
drivers/gpu/drm/msm/msm_fbdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c
index f37cc3f97a21..25e55b5c5ecc 100644
--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -41,6 +41,7 @@ static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
static void msm_fbdev_fb_destroy(struct fb_info *info)
{
struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par;
+ struct msm_drm_private *priv = helper->dev->dev_private;
struct drm_gem_object *bo = msm_framebuffer_bo(helper->fb, 0);
DBG();
@@ -48,6 +49,7 @@ static void msm_fbdev_fb_destroy(struct fb_info *info)
drm_fb_helper_fini(helper);
msm_gem_put_vaddr(bo);
+ msm_gem_unpin_iova(bo, priv->kms->vm);
drm_client_buffer_delete(helper->buffer);
drm_client_release(&helper->client);
--
2.51.0
next prev parent reply other threads:[~2026-11-26 17:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 17:05 [PATCH 0/2] drm/msm: fbdev: Fix the framebuffer pin leak on destroy Vladimir Zapolskiy
2026-11-26 17:05 ` Vladimir Zapolskiy [this message]
2026-11-26 17:05 ` [PATCH 2/2] drm/msm: fbdev: Add the missing VMA reference of the framebuffer Vladimir Zapolskiy
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=20261126170535.361985-2-vz@kernel.org \
--to=vz@kernel.org \
--cc=abhinav.kumar@linux.dev \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jesszhan0024@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=robin.clark@oss.qualcomm.com \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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