Commit c33adbc7 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: always recover VRAM during GPU recovery

It shouldn't add much overhead and we should make sure that critical
VRAM content is always restored.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Acked-by: default avatarJunwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7fcb0657
...@@ -2999,7 +2999,7 @@ static int amdgpu_device_recover_vram_from_shadow(struct amdgpu_device *adev, ...@@ -2999,7 +2999,7 @@ static int amdgpu_device_recover_vram_from_shadow(struct amdgpu_device *adev,
} }
/** /**
* amdgpu_device_handle_vram_lost - Handle the loss of VRAM contents * amdgpu_device_recover_vram - Recover some VRAM contents
* *
* @adev: amdgpu_device pointer * @adev: amdgpu_device pointer
* *
...@@ -3008,7 +3008,7 @@ static int amdgpu_device_recover_vram_from_shadow(struct amdgpu_device *adev, ...@@ -3008,7 +3008,7 @@ static int amdgpu_device_recover_vram_from_shadow(struct amdgpu_device *adev,
* the contents of VRAM might be lost. * the contents of VRAM might be lost.
* Returns 0 on success, 1 on failure. * Returns 0 on success, 1 on failure.
*/ */
static int amdgpu_device_handle_vram_lost(struct amdgpu_device *adev) static int amdgpu_device_recover_vram(struct amdgpu_device *adev)
{ {
struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring; struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring;
struct amdgpu_bo *bo, *tmp; struct amdgpu_bo *bo, *tmp;
...@@ -3135,8 +3135,8 @@ static int amdgpu_device_reset(struct amdgpu_device *adev) ...@@ -3135,8 +3135,8 @@ static int amdgpu_device_reset(struct amdgpu_device *adev)
} }
} }
if (!r && ((need_full_reset && !(adev->flags & AMD_IS_APU)) || vram_lost)) if (!r)
r = amdgpu_device_handle_vram_lost(adev); r = amdgpu_device_recover_vram(adev);
return r; return r;
} }
...@@ -3182,7 +3182,7 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev, ...@@ -3182,7 +3182,7 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,
amdgpu_virt_release_full_gpu(adev, true); amdgpu_virt_release_full_gpu(adev, true);
if (!r && adev->virt.gim_feature & AMDGIM_FEATURE_GIM_FLR_VRAMLOST) { if (!r && adev->virt.gim_feature & AMDGIM_FEATURE_GIM_FLR_VRAMLOST) {
atomic_inc(&adev->vram_lost_counter); atomic_inc(&adev->vram_lost_counter);
r = amdgpu_device_handle_vram_lost(adev); r = amdgpu_device_recover_vram(adev);
} }
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment