drm/amdgpu: Fix kernel panic while gpu recovery
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix kernel panic while gpu recovery
Ras error occurs while gpu recovery. We can not add its list head to two lists at same time.
Signed-off-by xinhui pan <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +7 -11
@@ -1449,20 +1449,16 @@ static void amdgpu_ras_do_recovery(struct work_struct *work) container_of(work, struct amdgpu_ras, recovery_work);struct amdgpu_device *remote_adev =NULL ;struct amdgpu_device *adev = ras->adev; -struct list_head device_list, *device_list_handle =NULL ;struct amdgpu_hive_info *hive =amdgpu_get_xgmi_hive (adev, false);/* Build list of devices to query RAS related errors */ -if (hive && adev->gmc.xgmi.num_physical_nodes >1 ) - device_list_handle = &hive->device_list; -else { -INIT_LIST_HEAD (&device_list); -list_add_tail (&adev->gmc.xgmi.head, &device_list); - device_list_handle = &device_list; - } - -list_for_each_entry (remote_adev, device_list_handle, gmc.xgmi.head) { -amdgpu_ras_log_on_err_counter (remote_adev); +if (hive && adev->gmc.xgmi.num_physical_nodes >1 ) { +list_for_each_entry (remote_adev, &hive->device_list, + gmc.xgmi.head) { +amdgpu_ras_log_on_err_counter (remote_adev); + } + }else { +amdgpu_ras_log_on_err_counter (adev); }if (amdgpu_device_should_recover_gpu (ras->adev))
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx