On Tue Sep 16 14:10:07 2025 +0800, Ming Qian wrote:
> To avoid accessing the VPU register after release of the VPU core,
> cancel the message work and destroy the workqueue that handles the
> VPU message before release of the VPU core.
>
> Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support")
> Cc: [email protected]
> Signed-off-by: Ming Qian <[email protected]>
> Signed-off-by: Nicolas Dufresne <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>
Patch committed.
Thanks,
Hans Verkuil
drivers/media/platform/amphion/vpu_v4l2.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/drivers/media/platform/amphion/vpu_v4l2.c
b/drivers/media/platform/amphion/vpu_v4l2.c
index 511881a131b7..47dff9a35bb4 100644
--- a/drivers/media/platform/amphion/vpu_v4l2.c
+++ b/drivers/media/platform/amphion/vpu_v4l2.c
@@ -703,15 +703,15 @@ static int vpu_v4l2_release(struct vpu_inst *inst)
{
vpu_trace(inst->vpu->dev, "%p\n", inst);
- vpu_release_core(inst->core);
- put_device(inst->dev);
-
if (inst->workqueue) {
cancel_work_sync(&inst->msg_work);
destroy_workqueue(inst->workqueue);
inst->workqueue = NULL;
}
+ vpu_release_core(inst->core);
+ put_device(inst->dev);
+
v4l2_ctrl_handler_free(&inst->ctrl_handler);
mutex_destroy(&inst->lock);
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]