[PATCH v2] media: venus: hfi: explicitly release IRQ during teardown

Jorge Ramirez-Ortiz posted 1 patch 3 months, 3 weeks ago
drivers/media/platform/qcom/venus/hfi_venus.c | 1 +
1 file changed, 1 insertion(+)
[PATCH v2] media: venus: hfi: explicitly release IRQ during teardown
Posted by Jorge Ramirez-Ortiz 3 months, 3 weeks ago
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")
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
---

 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(+)

diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index b5f2ea879950..ed003adb0282 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -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;
 }
 
-- 
2.34.1
Re: [PATCH v2] media: venus: hfi: explicitly release IRQ during teardown
Posted by Dikshita Agarwal 3 months, 3 weeks ago

On 6/19/2025 1:18 PM, Jorge Ramirez-Ortiz wrote:
> 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")
> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
> ---
> 
>  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(+)
> 
> diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
> index b5f2ea879950..ed003adb0282 100644
> --- a/drivers/media/platform/qcom/venus/hfi_venus.c
> +++ b/drivers/media/platform/qcom/venus/hfi_venus.c
> @@ -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: Dikshita Agarwal <quic_dikshita@quicinc.com>
Tested-by: Dikshita Agarwal <quic_dikshita@quicinc.com> # RB5
Re: [PATCH v2] media: venus: hfi: explicitly release IRQ during teardown
Posted by Bryan O'Donoghue 3 months, 3 weeks ago
On 19/06/2025 08:48, Jorge Ramirez-Ortiz wrote:
> 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")
> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>
> ---
> 
>   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(+)
> 
> diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
> index b5f2ea879950..ed003adb0282 100644
> --- a/drivers/media/platform/qcom/venus/hfi_venus.c
> +++ b/drivers/media/platform/qcom/venus/hfi_venus.c
> @@ -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: Bryan O'Donoghue <bryan.odonoghue@linaro.org>