Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: let mode2 reset fallback to default when failure

- introduce AMDGPU_SKIP_MODE2_RESET flag
- let mode2 reset fallback to default reset method if failed

v2: move this part out from the asic specific part

Signed-off-by: Victor Zhao <Victor.Zhao@amd.com>
Acked-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Victor Zhao and committed by
Alex Deucher
dac6b808 672c0218

+19 -1
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
··· 135 135 reset_context.method = AMD_RESET_METHOD_NONE; 136 136 reset_context.reset_req_dev = adev; 137 137 clear_bit(AMDGPU_NEED_FULL_RESET, &reset_context.flags); 138 + clear_bit(AMDGPU_SKIP_MODE2_RESET, &reset_context.flags); 138 139 139 140 amdgpu_device_gpu_recover(adev, NULL, &reset_context); 140 141 }
+6 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 5148 5148 5149 5149 reset_context->job = job; 5150 5150 reset_context->hive = hive; 5151 + 5151 5152 /* 5152 5153 * Build list of devices to reset. 5153 5154 * In case we are in XGMI hive mode, resort the device list ··· 5268 5267 amdgpu_ras_resume(adev); 5269 5268 } else { 5270 5269 r = amdgpu_do_asic_reset(device_list_handle, reset_context); 5271 - if (r && r == -EAGAIN) 5270 + if (r && r == -EAGAIN) { 5271 + set_bit(AMDGPU_SKIP_MODE2_RESET, &reset_context->flags); 5272 + adev->asic_reset_res = 0; 5272 5273 goto retry; 5274 + } 5273 5275 } 5274 5276 5275 5277 skip_hw_reset: ··· 5703 5699 reset_context.reset_req_dev = adev; 5704 5700 set_bit(AMDGPU_NEED_FULL_RESET, &reset_context.flags); 5705 5701 set_bit(AMDGPU_SKIP_HW_RESET, &reset_context.flags); 5702 + set_bit(AMDGPU_SKIP_MODE2_RESET, &reset_context.flags); 5706 5703 5707 5704 adev->no_hw_access = true; 5708 5705 r = amdgpu_device_pre_asic_reset(adev, &reset_context);
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
··· 71 71 reset_context.method = AMD_RESET_METHOD_NONE; 72 72 reset_context.reset_req_dev = adev; 73 73 clear_bit(AMDGPU_NEED_FULL_RESET, &reset_context.flags); 74 + clear_bit(AMDGPU_SKIP_MODE2_RESET, &reset_context.flags); 74 75 75 76 r = amdgpu_device_gpu_recover(ring->adev, job, &reset_context); 76 77 if (r)
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
··· 1949 1949 reset_context.method = AMD_RESET_METHOD_NONE; 1950 1950 reset_context.reset_req_dev = adev; 1951 1951 clear_bit(AMDGPU_NEED_FULL_RESET, &reset_context.flags); 1952 + clear_bit(AMDGPU_SKIP_MODE2_RESET, &reset_context.flags); 1952 1953 1953 1954 amdgpu_device_gpu_recover(ras->adev, NULL, &reset_context); 1954 1955 }
+6
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
··· 74 74 { 75 75 struct amdgpu_reset_handler *reset_handler = NULL; 76 76 77 + if (test_bit(AMDGPU_SKIP_MODE2_RESET, &reset_context->flags)) 78 + return -ENOSYS; 79 + 77 80 if (adev->reset_cntl && adev->reset_cntl->get_reset_handler) 78 81 reset_handler = adev->reset_cntl->get_reset_handler( 79 82 adev->reset_cntl, reset_context); ··· 92 89 { 93 90 int ret; 94 91 struct amdgpu_reset_handler *reset_handler = NULL; 92 + 93 + if (test_bit(AMDGPU_SKIP_MODE2_RESET, &reset_context->flags)) 94 + return -ENOSYS; 95 95 96 96 if (adev->reset_cntl) 97 97 reset_handler = adev->reset_cntl->get_reset_handler(
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h
··· 30 30 31 31 AMDGPU_NEED_FULL_RESET = 0, 32 32 AMDGPU_SKIP_HW_RESET = 1, 33 + AMDGPU_SKIP_MODE2_RESET = 2, 33 34 }; 34 35 35 36 struct amdgpu_reset_context {
+1
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
··· 290 290 reset_context.method = AMD_RESET_METHOD_NONE; 291 291 reset_context.reset_req_dev = adev; 292 292 clear_bit(AMDGPU_NEED_FULL_RESET, &reset_context.flags); 293 + clear_bit(AMDGPU_SKIP_MODE2_RESET, &reset_context.flags); 293 294 294 295 amdgpu_device_gpu_recover(adev, NULL, &reset_context); 295 296 }
+1
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c
··· 317 317 reset_context.method = AMD_RESET_METHOD_NONE; 318 318 reset_context.reset_req_dev = adev; 319 319 clear_bit(AMDGPU_NEED_FULL_RESET, &reset_context.flags); 320 + clear_bit(AMDGPU_SKIP_MODE2_RESET, &reset_context.flags); 320 321 321 322 amdgpu_device_gpu_recover(adev, NULL, &reset_context); 322 323 }
+1
drivers/gpu/drm/amd/amdgpu/mxgpu_vi.c
··· 529 529 reset_context.method = AMD_RESET_METHOD_NONE; 530 530 reset_context.reset_req_dev = adev; 531 531 clear_bit(AMDGPU_NEED_FULL_RESET, &reset_context.flags); 532 + clear_bit(AMDGPU_SKIP_MODE2_RESET, &reset_context.flags); 532 533 533 534 amdgpu_device_gpu_recover(adev, NULL, &reset_context); 534 535 }