From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Zack Rusin <zack.rusin@broadcom.com>,
Maaz Mombasawala <maaz.mombasawala@broadcom.com>,
fausten <yunfeng.li.nb@gmail.com>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.12.y] drm/vmwgfx: reserve cursor MOBs before unpinning them
Date: Thu, 3 Dec 2026 21:31:47 -0500 [thread overview]
Message-ID: <20261204023111.2133413-1-sashal@kernel.org> (raw)
In-Reply-To: <2026120229-triage-runway-6083@gregkh>
From: Zack Rusin <zack.rusin@broadcom.com>
[ Upstream commit 8a9b3b4c3a6cc95ea959183e20871d2421a6b986 ]
vmw_cursor_mob_destroy() unpins cursor MOBs when discarding an image from
the plane's cache or destroying the cursor plane. It calls ttm_bo_unpin()
without reserving the BO, although TTM requires its reservation to be held
when changing pin counts and LRU membership.
KMS clients issuing repeated nonblocking cursor updates can exhaust the
cache and reach this path. On a lockdep-enabled kernel this triggers
reservation assertions in ttm_bo_unpin() and ttm_resource_unevictable().
Reserve the MOB around ttm_bo_unpin(), then release the reservation before
dropping the BO reference.
Fixes: 485d98d472d5 ("drm/vmwgfx: Add support for CursorMob and CursorBypass 4")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com>
Tested-by: fausten <yunfeng.li.nb@gmail.com>
Link: https://patch.msgid.link/20261027211729.646988-7-zack.rusin@broadcom.com
[ sashal: Replaced the file and function names with vmw_du_destroy_cursor_mob() in vmwgfx_kms.c, since the cursor code isn't split into vmwgfx_cursor_plane.c here; the reserve/unreserve change itself is identical. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 03bf0f9574bcf..5b7f04c3a3772 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -236,10 +236,17 @@ static bool vmw_du_cursor_plane_has_changed(struct vmw_plane_state *old_vps,
static void vmw_du_destroy_cursor_mob(struct vmw_bo **vbo)
{
+ int ret;
+
if (!(*vbo))
return;
+ ret = ttm_bo_reserve(&(*vbo)->tbo, false, false, NULL);
+ if (WARN_ON_ONCE(ret))
+ return;
+
ttm_bo_unpin(&(*vbo)->tbo);
+ ttm_bo_unreserve(&(*vbo)->tbo);
vmw_bo_unreference(vbo);
}
--
2.53.0
prev parent reply other threads:[~2026-12-04 2:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 12:54 FAILED: patch "[PATCH] drm/vmwgfx: reserve cursor MOBs before unpinning them" failed to apply to 6.12-stable tree gregkh
2026-12-04 2:31 ` Sasha Levin [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=20261204023111.2133413-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=maaz.mombasawala@broadcom.com \
--cc=stable@vger.kernel.org \
--cc=yunfeng.li.nb@gmail.com \
--cc=zack.rusin@broadcom.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