Skip to contentSkip to conversation

drm/amdgpu: fix buffer funcs setting order on suspend

PATCH In review Alex Deucher 2 participants 2 messages Dec 4, 2023 – Dec 5, 2023

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu: fix buffer funcs setting order on suspend

We need to disable this after the last eviction call, but before we disable the SDMA IP.

Fixes b70438004a14 ("drm/amdgpu: move buffer funcs setting up a level")
Cc Phillip Susi <[email protected]>
Cc Luben Tuikov <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index f29d0faf956e..b76ec5ec04c5 100644
@@ -4593,8 +4593,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
 	amdgpu_ras_suspend(adev);
 
-	amdgpu_ttm_set_buffer_funcs_status(adev, false);
-
 	amdgpu_device_ip_suspend_phase1(adev);
 
 	if (!adev->in_s0ix)
@@ -4604,6 +4602,8 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 	if (r)
 		return r;
 
+	amdgpu_ttm_set_buffer_funcs_status(adev, false);
+
 	amdgpu_fence_driver_hw_fini(adev);
 
 	amdgpu_device_ip_suspend_phase2(adev);
Signature · 1 line
2.42.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Alex Deucher

We need to disable this after the last eviction call, but before we disable the SDMA IP.

Fixes b70438004a14 ("drm/amdgpu: move buffer funcs setting up a level")
Cc Phillip Susi <[email protected]>
Cc Luben Tuikov <[email protected]>

Thank you Alex for this patch and thank you Phillip for testing it! (Let's also add a Tested-by tag.)

Regards,
Luben

Quoted 26 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index f29d0faf956e..b76ec5ec04c5 100644
@@ -4593,8 +4593,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
 	amdgpu_ras_suspend(adev);
 
-	amdgpu_ttm_set_buffer_funcs_status(adev, false);
-
 	amdgpu_device_ip_suspend_phase1(adev);
 
 	if (!adev->in_s0ix)
@@ -4604,6 +4602,8 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 	if (r)
 		return r;
 
+	amdgpu_ttm_set_buffer_funcs_status(adev, false);
+
 	amdgpu_fence_driver_hw_fini(adev);
 
 	amdgpu_device_ip_suspend_phase2(adev);