On Sat Jan 31 22:19:07 2026 +0000, Ziyi Guo wrote:
> Add spin_lock_irqsave()/spin_unlock_irqrestore() around the
> handle_dynamic_resolution_change() call in initialize_sequence() to fix
> the missing lock protection.
> 
> initialize_sequence() calls handle_dynamic_resolution_change() without
> holding inst->state_spinlock. However, handle_dynamic_resolution_change()
> has lockdep_assert_held(&inst->state_spinlock) indicating that callers
> must hold this lock.
> 
> Other callers of handle_dynamic_resolution_change() properly acquire the
> spinlock:
> - wave5_vpu_dec_finish_decode()
> - wave5_vpu_dec_device_run()
> 
> Signed-off-by: Ziyi Guo <[email protected]>
> Reviewed-by: Nicolas Dufresne <[email protected]>
> Fixes: 9707a6254a8a6b ("media: chips-media: wave5: Add the v4l2 layer")
> Cc: [email protected]
> Signed-off-by: Nicolas Dufresne <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c | 3 +++
 1 file changed, 3 insertions(+)

---

diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c 
b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
index 18cd1a6a7e1d..d419076d7052 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
@@ -1593,6 +1593,7 @@ static int initialize_sequence(struct vpu_instance *inst)
 {
        struct dec_initial_info initial_info;
        int ret = 0;
+       unsigned long flags;
 
        memset(&initial_info, 0, sizeof(struct dec_initial_info));
 
@@ -1614,7 +1615,9 @@ static int initialize_sequence(struct vpu_instance *inst)
                return ret;
        }
 
+       spin_lock_irqsave(&inst->state_spinlock, flags);
        handle_dynamic_resolution_change(inst);
+       spin_unlock_irqrestore(&inst->state_spinlock, flags);
 
        return 0;
 }
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to