stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] nouveau: set placement to original placement on uvmm" failed to apply to 6.6-stable tree
@ 2024-08-07 14:10 gregkh
  2024-08-07 16:03 ` [PATCH 6.6.y] nouveau: set placement to original placement on uvmm validate Danilo Krummrich
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2024-08-07 14:10 UTC (permalink / raw)
  To: airlied, dakr, dakr, stable; +Cc: stable


The patch below does not apply to the 6.6-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-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 9c685f61722d30a22d55bb8a48f7a48bb2e19bcc
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2024080722-overlying-unmasking-3eb7@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..

Possible dependencies:

9c685f61722d ("nouveau: set placement to original placement on uvmm validate.")
014f831abcb8 ("drm/nouveau: use GPUVM common infrastructure")
94bc2249f08e ("drm/gpuvm: add an abstraction for a VM / BO combination")
8af72338dd81 ("drm/gpuvm: reference count drm_gpuvm structures")
266f7618e761 ("drm/nouveau: separately allocate struct nouveau_uvmm")
809ef191ee60 ("drm/gpuvm: add drm_gpuvm_flags to drm_gpuvm")
6118411428a3 ("drm/nouveau: make use of the GPUVM's shared dma-resv")
bbe8458037e7 ("drm/gpuvm: add common dma-resv per struct drm_gpuvm")
b41e297abd23 ("drm/nouveau: make use of drm_gpuvm_range_valid()")
546ca4d35dcc ("drm/gpuvm: convert WARN() to drm_WARN() variants")
78f54469b871 ("drm/nouveau: uvmm: rename 'umgr' to 'base'")
f72c2db47080 ("drm/gpuvm: rename struct drm_gpuva_manager to struct drm_gpuvm")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 9c685f61722d30a22d55bb8a48f7a48bb2e19bcc Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Wed, 15 May 2024 12:55:41 +1000
Subject: [PATCH] nouveau: set placement to original placement on uvmm
 validate.

When a buffer is evicted for memory pressure or TTM evict all,
the placement is set to the eviction domain, this means the
buffer never gets revalidated on the next exec to the correct domain.

I think this should be fine to use the initial domain from the
object creation, as least with VM_BIND this won't change after
init so this should be the correct answer.

Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI")
Cc: Danilo Krummrich <dakr@redhat.com>
Cc: <stable@vger.kernel.org> # v6.6
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240515025542.2156774-1-airlied@gmail.com

diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
index 9402fa320a7e..48f105239f42 100644
--- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
@@ -1803,6 +1803,7 @@ nouveau_uvmm_bo_validate(struct drm_gpuvm_bo *vm_bo, struct drm_exec *exec)
 {
 	struct nouveau_bo *nvbo = nouveau_gem_object(vm_bo->obj);
 
+	nouveau_bo_placement_set(nvbo, nvbo->valid_domains, 0);
 	return nouveau_bo_validate(nvbo, true, false);
 }
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 6.6.y] nouveau: set placement to original placement on uvmm validate.
  2024-08-07 14:10 FAILED: patch "[PATCH] nouveau: set placement to original placement on uvmm" failed to apply to 6.6-stable tree gregkh
@ 2024-08-07 16:03 ` Danilo Krummrich
  2024-08-12 14:37   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Danilo Krummrich @ 2024-08-07 16:03 UTC (permalink / raw)
  To: stable; +Cc: Dave Airlie, Danilo Krummrich, Danilo Krummrich

From: Dave Airlie <airlied@redhat.com>

When a buffer is evicted for memory pressure or TTM evict all,
the placement is set to the eviction domain, this means the
buffer never gets revalidated on the next exec to the correct domain.

I think this should be fine to use the initial domain from the
object creation, as least with VM_BIND this won't change after
init so this should be the correct answer.

Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI")
Cc: Danilo Krummrich <dakr@redhat.com>
Cc: <stable@vger.kernel.org> # v6.6
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240515025542.2156774-1-airlied@gmail.com
(cherry picked from commit 9c685f61722d30a22d55bb8a48f7a48bb2e19bcc)
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
 drivers/gpu/drm/nouveau/nouveau_uvmm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
index 2bbcdc649e86..3d41e590d471 100644
--- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
@@ -1320,6 +1320,7 @@ nouveau_uvmm_bind_job_submit(struct nouveau_job *job)
 
 		drm_gpuva_for_each_op(va_op, op->ops) {
 			struct drm_gem_object *obj = op_gem_obj(va_op);
+			struct nouveau_bo *nvbo;
 
 			if (unlikely(!obj))
 				continue;
@@ -1330,8 +1331,9 @@ nouveau_uvmm_bind_job_submit(struct nouveau_job *job)
 			if (unlikely(va_op->op == DRM_GPUVA_OP_UNMAP))
 				continue;
 
-			ret = nouveau_bo_validate(nouveau_gem_object(obj),
-						  true, false);
+			nvbo = nouveau_gem_object(obj);
+			nouveau_bo_placement_set(nvbo, nvbo->valid_domains, 0);
+			ret = nouveau_bo_validate(nvbo, true, false);
 			if (ret) {
 				op = list_last_op(&bind_job->ops);
 				goto unwind;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 6.6.y] nouveau: set placement to original placement on uvmm validate.
  2024-08-07 16:03 ` [PATCH 6.6.y] nouveau: set placement to original placement on uvmm validate Danilo Krummrich
@ 2024-08-12 14:37   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2024-08-12 14:37 UTC (permalink / raw)
  To: Danilo Krummrich; +Cc: stable, Dave Airlie, Danilo Krummrich

On Wed, Aug 07, 2024 at 06:03:42PM +0200, Danilo Krummrich wrote:
> From: Dave Airlie <airlied@redhat.com>
> 
> When a buffer is evicted for memory pressure or TTM evict all,
> the placement is set to the eviction domain, this means the
> buffer never gets revalidated on the next exec to the correct domain.
> 
> I think this should be fine to use the initial domain from the
> object creation, as least with VM_BIND this won't change after
> init so this should be the correct answer.
> 
> Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI")
> Cc: Danilo Krummrich <dakr@redhat.com>
> Cc: <stable@vger.kernel.org> # v6.6
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> Link: https://patchwork.freedesktop.org/patch/msgid/20240515025542.2156774-1-airlied@gmail.com
> (cherry picked from commit 9c685f61722d30a22d55bb8a48f7a48bb2e19bcc)
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
>  drivers/gpu/drm/nouveau/nouveau_uvmm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-12 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07 14:10 FAILED: patch "[PATCH] nouveau: set placement to original placement on uvmm" failed to apply to 6.6-stable tree gregkh
2024-08-07 16:03 ` [PATCH 6.6.y] nouveau: set placement to original placement on uvmm validate Danilo Krummrich
2024-08-12 14:37   ` Greg KH

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).