Skip to contentSkip to conversation

media: venus: hfi: explicitly release IRQ during teardown

PATCH In review Jorge Ramirez-Ortiz 3 participants 3 messages Jun 19, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 media: venus: hfi: explicitly release IRQ during teardown

Ensure the IRQ is disabled - and all pending handlers completed - before dismantling the interrupt routing and clearing related pointers.

This prevents any possibility of the interrupt triggering after the handler context has been invalidated.

Fixes d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files")

---

v2:
disable the handler and block until complete. allow devres to release and free the allocated irq

 drivers/media/platform/qcom/venus/hfi_venus.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/qcom/venus/hfi_venus.c +1 -0
index b5f2ea879950..ed003adb0282 100644
@@ -1678,6 +1678,7 @@ void venus_hfi_destroy(struct venus_core *core)
 	venus_interface_queues_release(hdev);
 	mutex_destroy(&hdev->lock);
 	kfree(hdev);
+	disable_irq(core->irq);
 	core->ops = NULL;
 }
 
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 22 lines · Jorge Ramirez-Ortiz

Ensure the IRQ is disabled - and all pending handlers completed - before dismantling the interrupt routing and clearing related pointers.

This prevents any possibility of the interrupt triggering after the handler context has been invalidated.

Fixes d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files")

---

v2:
disable the handler and block until complete. allow devres to release and free the allocated irq

  drivers/media/platform/qcom/venus/hfi_venus.c | 1 +
  1 file changed, 1 insertion(+)
drivers/media/platform/qcom/venus/hfi_venus.c +0 -0
index b5f2ea879950..ed003adb0282 100644

drivers/media/platform/qcom/venus/hfi_venus.c void venus_hfi_destroy(struct venus_core *core) · line 1684

Quoted 7 lines
drivers/media/platform/qcom/venus/hfi_venus.c +1 -0
@@ -1678,6 +1678,7 @@ void venus_hfi_destroy(struct venus_core *core)
  	venus_interface_queues_release(hdev);
  	mutex_destroy(&hdev->lock);
  	kfree(hdev);
+	disable_irq(core->irq);
  	core->ops = NULL;
  }
 
Reviewed-by Tested-by on v2 1/1
#2 lore raw
In reply to Jorge Ramirez-Ortiz
Quoted 22 lines · Jorge Ramirez-Ortiz

Ensure the IRQ is disabled - and all pending handlers completed - before dismantling the interrupt routing and clearing related pointers.

This prevents any possibility of the interrupt triggering after the handler context has been invalidated.

Fixes d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files")

---

v2:
disable the handler and block until complete. allow devres to release and free the allocated irq

 drivers/media/platform/qcom/venus/hfi_venus.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/qcom/venus/hfi_venus.c +0 -0
index b5f2ea879950..ed003adb0282 100644

drivers/media/platform/qcom/venus/hfi_venus.c void venus_hfi_destroy(struct venus_core *core) · line 1684

Quoted 7 lines
drivers/media/platform/qcom/venus/hfi_venus.c +1 -0
@@ -1678,6 +1678,7 @@ void venus_hfi_destroy(struct venus_core *core)
 	venus_interface_queues_release(hdev);
 	mutex_destroy(&hdev->lock);
 	kfree(hdev);
+	disable_irq(core->irq);
 	core->ops = NULL;
 }