Please find my reply inline below
>> -----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 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
>>
>> Signed-off-by: Harsh Jain <[email protected]>
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
>> index 222d3d7ea076..5b2afe348c23 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
>> @@ -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);
>[Quan, Evan] This seems a little weird. Can you just call
>amdgpu_device_delay_enable_gfx_off directly 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
>> }
>> } else {
>> if (adev->gfx.gfx_off_req_count == 0) {
>> --
>> 2.25.1