amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/vpe: cancel delayed work in hw_fini
@ 2025-08-25 13:37 Alex Deucher
  2025-08-26 16:29 ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2025-08-25 13:37 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

We need to cancel any outstanding work at both suspend
and driver teardown. Move the cancel to hw_fini which
gets called in both cases.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
index 86573c8d9b91e..474bfe36c0c2f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
@@ -436,6 +436,8 @@ static int vpe_hw_fini(struct amdgpu_ip_block *ip_block)
 	struct amdgpu_device *adev = ip_block->adev;
 	struct amdgpu_vpe *vpe = &adev->vpe;
 
+	cancel_delayed_work_sync(&adev->vpe.idle_work);
+
 	vpe_ring_stop(vpe);
 
 	/* Power off VPE */
@@ -446,10 +448,6 @@ static int vpe_hw_fini(struct amdgpu_ip_block *ip_block)
 
 static int vpe_suspend(struct amdgpu_ip_block *ip_block)
 {
-	struct amdgpu_device *adev = ip_block->adev;
-
-	cancel_delayed_work_sync(&adev->vpe.idle_work);
-
 	return vpe_hw_fini(ip_block);
 }
 
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu/vpe: cancel delayed work in hw_fini
  2025-08-25 13:37 [PATCH] drm/amdgpu/vpe: cancel delayed work in hw_fini Alex Deucher
@ 2025-08-26 16:29 ` Alex Deucher
  2025-08-26 17:29   ` David Wu
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2025-08-26 16:29 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx

ping?

On Mon, Aug 25, 2025 at 9:48 AM Alex Deucher <alexander.deucher@amd.com> wrote:
>
> We need to cancel any outstanding work at both suspend
> and driver teardown. Move the cancel to hw_fini which
> gets called in both cases.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> index 86573c8d9b91e..474bfe36c0c2f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> @@ -436,6 +436,8 @@ static int vpe_hw_fini(struct amdgpu_ip_block *ip_block)
>         struct amdgpu_device *adev = ip_block->adev;
>         struct amdgpu_vpe *vpe = &adev->vpe;
>
> +       cancel_delayed_work_sync(&adev->vpe.idle_work);
> +
>         vpe_ring_stop(vpe);
>
>         /* Power off VPE */
> @@ -446,10 +448,6 @@ static int vpe_hw_fini(struct amdgpu_ip_block *ip_block)
>
>  static int vpe_suspend(struct amdgpu_ip_block *ip_block)
>  {
> -       struct amdgpu_device *adev = ip_block->adev;
> -
> -       cancel_delayed_work_sync(&adev->vpe.idle_work);
> -
>         return vpe_hw_fini(ip_block);
>  }
>
> --
> 2.51.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu/vpe: cancel delayed work in hw_fini
  2025-08-26 16:29 ` Alex Deucher
@ 2025-08-26 17:29   ` David Wu
  0 siblings, 0 replies; 3+ messages in thread
From: David Wu @ 2025-08-26 17:29 UTC (permalink / raw)
  To: Alex Deucher, Alex Deucher; +Cc: amd-gfx

Looks good to me - thanks!
Reviewed-by: David (Ming Qiang) Wu <David.Wu3@amd.com>

On 2025-08-26 12:29, Alex Deucher wrote:
> ping?
>
> On Mon, Aug 25, 2025 at 9:48 AM Alex Deucher <alexander.deucher@amd.com> wrote:
>> We need to cancel any outstanding work at both suspend
>> and driver teardown. Move the cancel to hw_fini which
>> gets called in both cases.
>>
>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 6 ++----
>>   1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
>> index 86573c8d9b91e..474bfe36c0c2f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
>> @@ -436,6 +436,8 @@ static int vpe_hw_fini(struct amdgpu_ip_block *ip_block)
>>          struct amdgpu_device *adev = ip_block->adev;
>>          struct amdgpu_vpe *vpe = &adev->vpe;
>>
>> +       cancel_delayed_work_sync(&adev->vpe.idle_work);
>> +
>>          vpe_ring_stop(vpe);
>>
>>          /* Power off VPE */
>> @@ -446,10 +448,6 @@ static int vpe_hw_fini(struct amdgpu_ip_block *ip_block)
>>
>>   static int vpe_suspend(struct amdgpu_ip_block *ip_block)
>>   {
>> -       struct amdgpu_device *adev = ip_block->adev;
>> -
>> -       cancel_delayed_work_sync(&adev->vpe.idle_work);
>> -
>>          return vpe_hw_fini(ip_block);
>>   }
>>
>> --
>> 2.51.0
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-26 17:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25 13:37 [PATCH] drm/amdgpu/vpe: cancel delayed work in hw_fini Alex Deucher
2025-08-26 16:29 ` Alex Deucher
2025-08-26 17:29   ` David Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).