drm/amdgpu: Handle the GPU recovery failure in SRIOV environment.
authorSurbhi Kakarya <surbhi.kakarya@amd.com>
Wed, 26 Jan 2022 17:04:39 +0000 (12:04 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 14 Feb 2022 20:08:41 +0000 (15:08 -0500)
commit7258fa31eabd882f6c8ed4d6d281f6657a33ef94
tree188ff6cc7c8b5593b99ec6fd5a470bd87857a788
parent1ec1944eb50c8de2d96de1188eec9f8b22d03366
drm/amdgpu: Handle the GPU recovery failure in SRIOV environment.

This patch handles the GPU recovery failure in sriov environment by
retrying the reset if the first reset fails. To determine the condition
of retry, a new macro AMDGPU_RETRY_SRIOV_RESET is added which returns
true if failure is due to ETIMEDOUT, EINVAL or EBUSY, otherwise return
false.A new macro AMDGPU_MAX_RETRY_LIMIT is used to limit the retry to 2.

It also handles the return status in Post Asic Reset by updating the return
code with asic_reset_res and eventually return the return code in
amdgpu_job_timedout().

Signed-off-by: Surbhi Kakarya <surbhi.kakarya@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c