Skip to contentSkip to conversation

drm/amdgpu/vpe: cancel delayed work in hw_fini

PATCH In review Alex Deucher 3 participants 3 messages Aug 25, 2025 – Aug 26, 2025

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu/vpe: cancel delayed work in hw_fini

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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c +2 -4
index 86573c8d9b91e..474bfe36c0c2f 100644
@@ -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);
 }
 
Signature · 1 line
2.51.0
#1 lore raw

ping?

Quoted 37 lines · 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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c +2 -5
index 86573c8d9b91e..474bfe36c0c2f 100644
@@ -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

Reviewed-by David (Ming Qiang) Wu
#2 lore raw

Looks good to me - thanks!

Quoted 39 lines · Alex Deucher

ping?

Quoted 36 lines · 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.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c +2 -5
index 86573c8d9b91e..474bfe36c0c2f 100644
@@ -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