Skip to content

Commit 2e97663

Browse files
Lijo Lazaralexdeucher
authored andcommitted
drm/amdgpu: Report individual reset error
If reinitialization of one of the GPUs fails after reset, it logs failure on all subsequent GPUs eventhough they have resumed successfully. A sample log where only device at 0000:95:00.0 had a failure - amdgpu 0000:15:00.0: amdgpu: GPU reset(19) succeeded! amdgpu 0000:65:00.0: amdgpu: GPU reset(19) succeeded! amdgpu 0000:75:00.0: amdgpu: GPU reset(19) succeeded! amdgpu 0000:85:00.0: amdgpu: GPU reset(19) succeeded! amdgpu 0000:95:00.0: amdgpu: GPU reset(19) failed amdgpu 0000:e5:00.0: amdgpu: GPU reset(19) failed amdgpu 0000:f5:00.0: amdgpu: GPU reset(19) failed amdgpu 0000:05:00.0: amdgpu: GPU reset(19) failed amdgpu 0000:15:00.0: amdgpu: GPU reset end with ret = -5 To avoid confusion, report the error for each device separately and return the first error as the overall result. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Asad Kamal <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent a107aeb commit 2e97663

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6389,23 +6389,28 @@ static int amdgpu_device_sched_resume(struct list_head *device_list,
63896389
if (!drm_drv_uses_atomic_modeset(adev_to_drm(tmp_adev)) && !job_signaled)
63906390
drm_helper_resume_force_mode(adev_to_drm(tmp_adev));
63916391

6392-
if (tmp_adev->asic_reset_res)
6393-
r = tmp_adev->asic_reset_res;
6394-
6395-
tmp_adev->asic_reset_res = 0;
6396-
6397-
if (r) {
6392+
if (tmp_adev->asic_reset_res) {
63986393
/* bad news, how to tell it to userspace ?
63996394
* for ras error, we should report GPU bad status instead of
64006395
* reset failure
64016396
*/
64026397
if (reset_context->src != AMDGPU_RESET_SRC_RAS ||
64036398
!amdgpu_ras_eeprom_check_err_threshold(tmp_adev))
6404-
dev_info(tmp_adev->dev, "GPU reset(%d) failed\n",
6405-
atomic_read(&tmp_adev->gpu_reset_counter));
6406-
amdgpu_vf_error_put(tmp_adev, AMDGIM_ERROR_VF_GPU_RESET_FAIL, 0, r);
6399+
dev_info(
6400+
tmp_adev->dev,
6401+
"GPU reset(%d) failed with error %d \n",
6402+
atomic_read(
6403+
&tmp_adev->gpu_reset_counter),
6404+
tmp_adev->asic_reset_res);
6405+
amdgpu_vf_error_put(tmp_adev,
6406+
AMDGIM_ERROR_VF_GPU_RESET_FAIL, 0,
6407+
tmp_adev->asic_reset_res);
6408+
if (!r)
6409+
r = tmp_adev->asic_reset_res;
6410+
tmp_adev->asic_reset_res = 0;
64076411
} else {
6408-
dev_info(tmp_adev->dev, "GPU reset(%d) succeeded!\n", atomic_read(&tmp_adev->gpu_reset_counter));
6412+
dev_info(tmp_adev->dev, "GPU reset(%d) succeeded!\n",
6413+
atomic_read(&tmp_adev->gpu_reset_counter));
64096414
if (amdgpu_acpi_smart_shift_update(tmp_adev,
64106415
AMDGPU_SS_DEV_D0))
64116416
dev_warn(tmp_adev->dev,

0 commit comments

Comments
 (0)