drm/amdgpu: wait till Gfxoff allow signal completes during suspend
Subsystems (2)
PATCH 1/1 drm/amdgpu: wait till Gfxoff allow signal completes during suspend
change guarantees that gfxoff is allowed before moving further in s2idle sequence to add more reliablity about gfxoff in amdgpu IP's suspend flow
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3 -3
@@ -581,11 +581,11 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable)if (adev->gfx.gfx_off_req_count ==0 && !adev->gfx.gfx_off_state) { -/* If going to s2idle, no need to wait */ -if (adev->in_s0ix) - delay =GFX_OFF_NO_DELAY ;schedule_delayed_work (&adev->gfx.gfx_off_delay_work, delay); +/* If going to s2idle, no need to wait */ +if (adev->in_s0ix) +flush_delayed_work (&adev->gfx.gfx_off_delay_work); } }else {if (adev->gfx.gfx_off_req_count ==0 ) {
Signature · 1 line
2.25.1
[AMD Official Use Only - General]
Quoted 25 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Harsh Jain
Sent: Friday, November 4, 2022 12:17 PM
To: Deucher, Alexander <[email protected]>
Cc: Jain, Harsh <[email protected]>; [email protected]
Subject: [PATCH] drm/amdgpu: wait till Gfxoff allow signal completes during suspendchange guarantees that gfxoff is allowed before moving further in s2idle sequence to add more reliablity about gfxoff in amdgpu IP's suspend flow
Signed-off-by Harsh Jain <[email protected]>drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-0@@ -581,11 +581,11 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable)if (adev->gfx.gfx_off_req_count ==0 && !adev->gfx.gfx_off_state) {
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c void amdgpu_gfx_off_ctrl(struct amdgpu_device · line 591
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3
-3-/* If going to s2idle, no need to wait */ -if (adev->in_s0ix) - delay =GFX_OFF_NO_DELAY ;schedule_delayed_work (&adev- >gfx.gfx_off_delay_work, delay); +/* If going to s2idle, no need to wait */ +if (adev->in_s0ix) +flush_delayed_work (&adev- >gfx.gfx_off_delay_work);
[Quan, Evan] This seems a little weird. Can you just call amdgpu_device_delay_enable_gfx_off directly for s0ix case?
Evan
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-1} }else {if (adev->gfx.gfx_off_req_count ==0 ) { --2.25.1
Please find my reply inline below
Quoted 30 lines
Quoted 30 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Harsh Jain
Sent: Friday, November 4, 2022 12:17 PM
To: Deucher, Alexander <[email protected]>
Cc: Jain, Harsh <[email protected]>; [email protected]
Subject: [PATCH] drm/amdgpu: wait till Gfxoff allow signal completes during suspendchange guarantees that gfxoff is allowed before moving further in s2idle sequence to add more reliablity about gfxoff in amdgpu IP's suspend flow
Signed-off-by Harsh Jain <[email protected]>drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-3@@ -581,11 +581,11 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable)if (adev->gfx.gfx_off_req_count ==0 && !adev->gfx.gfx_off_state) { -/* If going to s2idle, no need to wait */ -if (adev->in_s0ix) - delay =GFX_OFF_NO_DELAY ; schedule_delayed_work(&adev- >gfx.gfx_off_delay_work,
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable)
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3
-0delay); +/* If going to s2idle, no need to wait */ +if (adev->in_s0ix) +flush_delayed_work (&adev- >gfx.gfx_off_delay_work);[Quan, Evan] This seems a little weird. Can you just call
amdgpu_device_delay_enable_gfx_offdirectly for s0ix case?Evan
[Harsh Jain] amdgpu_device_delay_enable_gfx_off is a static function in amdgpu_device file.
It's better to keep it static otherwise it would create a new api for gfxoff control for which current api amdgpu_gfx_off_ctrl is available.
Thanks
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-1} }else {if (adev->gfx.gfx_off_req_count ==0 ) { --2.25.1
Quoted 12 lines · Harsh Jain
change guarantees that gfxoff is allowed before moving further in s2idle sequence to add more reliablity about gfxoff in amdgpu IP's suspend flow
Signed-off-by Harsh Jain <[email protected]>drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable) · line 586
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0
-3@@ -581,11 +581,11 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable)if (adev->gfx.gfx_off_req_count ==0 && !adev->gfx.gfx_off_state) { -/* If going to s2idle, no need to wait */ -if (adev->in_s0ix) - delay =GFX_OFF_NO_DELAY ;
I think we can leave this hunk. The 0 delay is still fine even if if flush.
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3
-1schedule_delayed_work (&adev->gfx.gfx_off_delay_work, delay); +/* If going to s2idle, no need to wait */ +if (adev->in_s0ix) +flush_delayed_work (&adev->gfx.gfx_off_delay_work); } }else {if (adev->gfx.gfx_off_req_count ==0 ) { --2.25.1