[AMD Official Use Only - General] Please ignore this one. If user space calls amdgpu_vm_init between gpu reset start and end(driver doesn't prevent user space from doing that), this will change VM update mode and affect user space. That's not expected. Will find another way to solve this. Regards, Lang >-----Original Message----- >From: Yu, Lang <Lang.Yu@xxxxxxx> >Sent: Monday, March 25, 2024 1:36 PM >To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx >Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Koenig, Christian ><Christian.Koenig@xxxxxxx>; Yu, Lang <Lang.Yu@xxxxxxx> >Subject: [PATCH 1/2] drm/amdgpu: use CPU to update VM during GPU reset > >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@xxxxxxx> >--- > 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