drm/amdgpu:fix waiting on dirty fence
Subsystems (2)
PATCH 1/1 drm/amdgpu:fix waiting on dirty fence
if bo->shadow is NULL (race issue:BO shadow was just released and gpu-reset kick in but BO hasn't yet) recover_vram_from_shadow won't set @next, so the following "fence=next"
will wrongly use a fence pointer which may already dirty. fixing it by set next to NULL prior to recover_vram_from_shadow
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
@@ -2601,6 +2601,7 @@ int amdgpu_sriov_gpu_reset(struct amdgpu_device *adev, struct amdgpu_job *job, b ring = adev->mman.buffer_funcs_ring;mutex_lock (&adev->shadow_list_lock);list_for_each_entry_safe (bo, tmp, &adev->shadow_list, shadow_list) { + next =NULL ;amdgpu_recover_vram_from_shadow (adev, ring, bo, &next);if (fence) { r =fence_wait (fence, false);
@@ -2766,6 +2767,7 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)DRM_INFO ("recover vram bo from shadow\n" );mutex_lock (&adev->shadow_list_lock);list_for_each_entry_safe (bo, tmp, &adev->shadow_list, shadow_list) { + next =NULL ;amdgpu_recover_vram_from_shadow (adev, ring, bo, &next);if (fence) { r =fence_wait (fence, false);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1493626697-7016-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Zhou, David(ChunMing)
Reviewed-by Chunming Zhou-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Monday, May 01, 2017 4:18 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu:fix waiting on dirty fence
if bo->shadow is NULL (race issue:BO shadow was just released and gpu-reset kick in but BO hasn't yet) recover_vram_from_shadow won't set @next, so the following "fence=next" will wrongly use a fence pointer which may already dirty.
fixing it by set next to NULL prior to recover_vram_from_shadow
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
@@ -2601,6 +2601,7 @@ int amdgpu_sriov_gpu_reset(struct amdgpu_device *adev, struct amdgpu_job *job, b ring = adev->mman.buffer_funcs_ring;mutex_lock (&adev->shadow_list_lock);list_for_each_entry_safe (bo, tmp, &adev->shadow_list, shadow_list) { + next =NULL ;amdgpu_recover_vram_from_shadow (adev, ring, bo, &next);if (fence) { r =fence_wait (fence, false);
@@ -2766,6 +2767,7 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)DRM_INFO ("recover vram bo from shadow\n" );mutex_lock (&adev->shadow_list_lock);list_for_each_entry_safe (bo, tmp, &adev->shadow_list, shadow_list) { + next =NULL ;amdgpu_recover_vram_from_shadow (adev, ring, bo, &next);if (fence) { r =fence_wait (fence, false);
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx