]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: chips-media: wave5: add missing spinlock protection for send_eos_event()
authorZiyi Guo <n7l8m4@u.northwestern.edu>
Sat, 31 Jan 2026 22:03:23 +0000 (22:03 +0000)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 23 Mar 2026 10:18:33 +0000 (11:18 +0100)
commitf48050436746be75227fbc90066a8658cbe94d17
tree8455d471aadd120f9297a6b09dad5df03ee029aa
parent95bd174a453f77b09ea66e1e22834680754ba501
media: chips-media: wave5: add missing spinlock protection for send_eos_event()

Add spin_lock_irqsave()/spin_unlock_irqrestore() around send_eos_event()
calls in the VB2 buffer queue and streamoff callbacks to fix the missing
lock protection.

wave5_vpu_dec_buf_queue_dst() and streamoff_output() call send_eos_event()
without holding inst->state_spinlock. However, send_eos_event() has
lockdep_assert_held(&inst->state_spinlock) indicating that callers must
hold this lock.

Other callers of send_eos_event() properly acquire the spinlock:
- wave5_vpu_dec_finish_decode() acquires lock at line 431
- wave5_vpu_dec_encoder_cmd() acquires lock at line 821
- wave5_vpu_dec_device_run() acquires lock at line 1592

Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Fixes: 9707a6254a8a6b ("media: chips-media: wave5: Add the v4l2 layer")
Cc: stable@vger.kernel.org
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c