From: Andrey Grodzovsky Date: Fri, 20 Jul 2018 15:42:24 +0000 (-0400) Subject: drm/amdgpu: Fix warning in dma_fence_is_later on resume from S3. X-Git-Tag: v5.15~8118^2~21^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7766484b4a18373ac557ce6ea442ef28517c8224;p=platform%2Fkernel%2Flinux-starfive.git drm/amdgpu: Fix warning in dma_fence_is_later on resume from S3. Problem: amdgpu_ttm_set_buffer_funcs_status destroys adev->mman.entity on suspend without releasing adev->mman.bdev.man[TTM_PL_VRAM].move fence so on resume the new drm_sched_entity.fence_context causes the warning against the old fence context which is different. Fix: When destroying sched_entity in amdgpu_ttm_set_buffer_funcs_status release man->move and set the pointer to NULL. Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 13977ea6a097..8ed102933ca2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -1927,6 +1927,8 @@ void amdgpu_ttm_set_buffer_funcs_status(struct amdgpu_device *adev, bool enable) } else { drm_sched_entity_destroy(adev->mman.entity.sched, &adev->mman.entity); + dma_fence_put(man->move); + man->move = NULL; } /* this just adjusts TTM size idea, which sets lpfn to the correct value */