AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lang Yu <Lang.Yu@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Christian Koenig <christian.koenig@amd.com>,
	Lang Yu <Lang.Yu@amd.com>
Subject: [PATCH 1/2] drm/amdgpu: use CPU to update VM during GPU reset
Date: Mon, 25 Mar 2024 13:35:58 +0800	[thread overview]
Message-ID: <20240325053558.3183164-1-Lang.Yu@amd.com> (raw)

drm sched is stopped and SDMA mode is not available,
while CPU mode worked well in such a case.

Use case,
amdgpu_do_asic_reset
amdgpu_device_ip_late_init
umsch_mm_late_init
umsch_mm_test
amdgpu_vm_init

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 8af3f0fd3073..af53f9cfcc40 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -2404,8 +2404,8 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
 
 	vm->is_compute_context = false;
 
-	vm->use_cpu_for_update = !!(adev->vm_manager.vm_update_mode &
-				    AMDGPU_VM_USE_CPU_FOR_GFX);
+	vm->use_cpu_for_update = !!(amdgpu_in_reset(adev) ||
+		adev->vm_manager.vm_update_mode & AMDGPU_VM_USE_CPU_FOR_GFX);
 
 	DRM_DEBUG_DRIVER("VM update mode is %s\n",
 			 vm->use_cpu_for_update ? "CPU" : "SDMA");
-- 
2.25.1


             reply	other threads:[~2024-03-25  5:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25  5:35 Lang Yu [this message]
2024-03-28  3:44 ` [PATCH 1/2] drm/amdgpu: use CPU to update VM during GPU reset Yu, Lang
2024-03-29 11:08 ` Christian König
2024-04-02  8:47   ` Yu, Lang
2024-04-02 11:40     ` Christian König

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=20240325053558.3183164-1-Lang.Yu@amd.com \
    --to=lang.yu@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.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