drm/amdgpu: Stop any pending reset if another in progress.
authorAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Tue, 17 May 2022 18:56:34 +0000 (14:56 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 10 Jun 2022 19:26:18 +0000 (15:26 -0400)
We skip rest requests if another one is already in progress.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 2d5a623598b81972b613fa28833168867ed9b5a3..45dc96aee39ef929c7280bec4092582f9b7a1e44 100644 (file)
@@ -5065,6 +5065,27 @@ retry:
        }
 }
 
+static inline void amdggpu_device_stop_pedning_resets(struct amdgpu_device *adev)
+{
+       struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
+
+#if defined(CONFIG_DEBUG_FS)
+       if (!amdgpu_sriov_vf(adev))
+               cancel_work(&adev->reset_work);
+#endif
+
+       if (adev->kfd.dev)
+               cancel_work(&adev->kfd.reset_work);
+
+       if (amdgpu_sriov_vf(adev))
+               cancel_work(&adev->virt.flr_work);
+
+       if (con && adev->ras_enabled)
+               cancel_work(&con->recovery_work);
+
+}
+
+
 /**
  * amdgpu_device_gpu_recover_imp - reset the asic and recover scheduler
  *
@@ -5220,6 +5241,12 @@ retry:   /* Rest of adevs pre asic reset from XGMI hive. */
                                  r, adev_to_drm(tmp_adev)->unique);
                        tmp_adev->asic_reset_res = r;
                }
+
+               /*
+                * Drop all pending non scheduler resets. Scheduler resets
+                * were already dropped during drm_sched_stop
+                */
+               amdggpu_device_stop_pedning_resets(tmp_adev);
        }
 
        tmp_vram_lost_counter = atomic_read(&((adev)->vram_lost_counter));