* FAILED: patch "[PATCH] drm/amdgpu/userq: actually validate userq BOs" failed to apply to 7.2-stable tree
@ 2026-10-21 14:45 gregkh
2026-10-21 21:36 ` [PATCH 7.2.y 1/2] drm/amdgpu: correct reservation fence slots for userq per-vm BOs eviction Sasha Levin
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2026-10-21 14:45 UTC (permalink / raw)
To: benjamin.cheng, alexander.deucher, christian.koenig; +Cc: stable
The patch below does not apply to the 7.2-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-7.2.y
git checkout FETCH_HEAD
git cherry-pick -x 32d0771ef4ca69c30a1db3aefa34dd177cd2a047
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026102137-thermos-preaching-3697@gregkh' --subject-prefix 'PATCH 7.2.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 32d0771ef4ca69c30a1db3aefa34dd177cd2a047 Mon Sep 17 00:00:00 2001
From: Benjamin Cheng <benjamin.cheng@amd.com>
Date: Fri, 9 Oct 2026 09:31:42 -0400
Subject: [PATCH] drm/amdgpu/userq: actually validate userq BOs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This was supposed to loop over the individual evicted list, as the
kernel and always_valid evicted lists were already handled in
amdgpu_vm_validate.
Without this, BOs that were created and evicted before a userq was made
would never end up in an eviction fence rearm.
Also add the missing ref to the BO before drm_exec locks and refs it.
Fixes: 4cdbba5a16aa ("drm/amdgpu: restructure VM state machine v4")
Signed-off-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 18decfc9e8cc0fa70b6de9944cc27a37729edfbd)
Cc: stable@vger.kernel.org
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index 9316423f9340..b3dc5dd49a64 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -980,19 +980,21 @@ amdgpu_userq_bo_validate(struct amdgpu_device *adev, struct drm_exec *exec,
{
struct ttm_operation_ctx ctx = { false, false };
struct amdgpu_bo_va *bo_va;
- struct amdgpu_bo *bo;
+ struct amdgpu_bo *bo, *tmp;
int ret;
spin_lock(&vm->individual_lock);
- while (!list_empty(&vm->always_valid.evicted)) {
- bo_va = list_first_entry(&vm->always_valid.evicted,
+ while (!list_empty(&vm->individual.evicted)) {
+ bo_va = list_first_entry(&vm->individual.evicted,
struct amdgpu_bo_va,
base.vm_status);
+ bo = bo_va->base.bo;
+ tmp = amdgpu_bo_ref(bo);
spin_unlock(&vm->individual_lock);
- bo = bo_va->base.bo;
ret = drm_exec_prepare_obj(exec, &bo->tbo.base,
TTM_NUM_MOVE_FENCES + 1);
+ amdgpu_bo_unref(&tmp);
if (unlikely(ret))
return ret;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 7.2.y 1/2] drm/amdgpu: correct reservation fence slots for userq per-vm BOs eviction
2026-10-21 14:45 FAILED: patch "[PATCH] drm/amdgpu/userq: actually validate userq BOs" failed to apply to 7.2-stable tree gregkh
@ 2026-10-21 21:36 ` Sasha Levin
2026-10-21 21:36 ` [PATCH 7.2.y 2/2] drm/amdgpu/userq: actually validate userq BOs Sasha Levin
0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2026-10-21 21:36 UTC (permalink / raw)
To: stable; +Cc: Prike Liang, Christian König, Alex Deucher, Sasha Levin
From: Prike Liang <Prike.Liang@amd.com>
[ Upstream commit 50b24a20be8c0d35f89f7d5c39533f69d84fe48e ]
It fixes both the move overflow and the eviction fence add for
evicting these per-vm BOs.
Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 32d0771ef4ca ("drm/amdgpu/userq: actually validate userq BOs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index 0c3fa2d60555a..9352efa98bfa9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -948,7 +948,8 @@ amdgpu_userq_bo_validate(struct amdgpu_device *adev, struct drm_exec *exec,
spin_unlock(&vm->individual_lock);
bo = bo_va->base.bo;
- ret = drm_exec_prepare_obj(exec, &bo->tbo.base, 2);
+ ret = drm_exec_prepare_obj(exec, &bo->tbo.base,
+ TTM_NUM_MOVE_FENCES + 1);
if (unlikely(ret))
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 7.2.y 2/2] drm/amdgpu/userq: actually validate userq BOs
2026-10-21 21:36 ` [PATCH 7.2.y 1/2] drm/amdgpu: correct reservation fence slots for userq per-vm BOs eviction Sasha Levin
@ 2026-10-21 21:36 ` Sasha Levin
0 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2026-10-21 21:36 UTC (permalink / raw)
To: stable; +Cc: Benjamin Cheng, Christian König, Alex Deucher, Sasha Levin
From: Benjamin Cheng <benjamin.cheng@amd.com>
[ Upstream commit 32d0771ef4ca69c30a1db3aefa34dd177cd2a047 ]
This was supposed to loop over the individual evicted list, as the
kernel and always_valid evicted lists were already handled in
amdgpu_vm_validate.
Without this, BOs that were created and evicted before a userq was made
would never end up in an eviction fence rearm.
Also add the missing ref to the BO before drm_exec locks and refs it.
Fixes: 4cdbba5a16aa ("drm/amdgpu: restructure VM state machine v4")
Signed-off-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 18decfc9e8cc0fa70b6de9944cc27a37729edfbd)
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index 9352efa98bfa9..f014faf7eb1cd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -937,19 +937,21 @@ amdgpu_userq_bo_validate(struct amdgpu_device *adev, struct drm_exec *exec,
{
struct ttm_operation_ctx ctx = { false, false };
struct amdgpu_bo_va *bo_va;
- struct amdgpu_bo *bo;
+ struct amdgpu_bo *bo, *tmp;
int ret;
spin_lock(&vm->individual_lock);
- while (!list_empty(&vm->always_valid.evicted)) {
- bo_va = list_first_entry(&vm->always_valid.evicted,
+ while (!list_empty(&vm->individual.evicted)) {
+ bo_va = list_first_entry(&vm->individual.evicted,
struct amdgpu_bo_va,
base.vm_status);
+ bo = bo_va->base.bo;
+ tmp = amdgpu_bo_ref(bo);
spin_unlock(&vm->individual_lock);
- bo = bo_va->base.bo;
ret = drm_exec_prepare_obj(exec, &bo->tbo.base,
TTM_NUM_MOVE_FENCES + 1);
+ amdgpu_bo_unref(&tmp);
if (unlikely(ret))
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-21 21:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 14:45 FAILED: patch "[PATCH] drm/amdgpu/userq: actually validate userq BOs" failed to apply to 7.2-stable tree gregkh
2026-10-21 21:36 ` [PATCH 7.2.y 1/2] drm/amdgpu: correct reservation fence slots for userq per-vm BOs eviction Sasha Levin
2026-10-21 21:36 ` [PATCH 7.2.y 2/2] drm/amdgpu/userq: actually validate userq BOs Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).