Skip to contentSkip to conversation

drm/amdgpu: Fix warning in dma_fence_is_later on resume from S3.

PATCH In review Andrey Grodzovsky 3 participants 3 messages Jul 20, 2018 – Jul 23, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 fence and set the pointer to NULL.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -0
index 13977ea..8ed1029 100644
@@ -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 */
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): 1532101641-24755-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

Am 20.07.2018 um 17:47 schrieb Andrey Grodzovsky:

Quoted 11 lines

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 fence and set the pointer to NULL.

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -0
index 13977ea..8ed1029 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c void amdgpu_ttm_set_buffer_funcs_status(struct amdgpu_device *adev, bool enable) · line 1934

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -0
@@ -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 */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Acked-by Junwei Zhang
#3 lore raw
In reply to a message not in the archive
Quoted 11 lines · Andrey Grodzovsky

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 fence and set the pointer to NULL.

Quoted 10 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -0
index 13977ea..8ed1029 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c void amdgpu_ttm_set_buffer_funcs_status(struct amdgpu_device *adev, bool enable) · line 1934

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -0
@@ -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 */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx