linux/drivers/media
Chen-Yu Tsai a5844227e0 media: mediatek: vcodec: Use spinlock for context list protection lock
Previously a mutex was added to protect the encoder and decoder context
lists from unexpected changes originating from the SCP IP block, causing
the context pointer to go invalid, resulting in a NULL pointer
dereference in the IPI handler.

Turns out on the MT8173, the VPU IPI handler is called from hard IRQ
context. This causes a big warning from the scheduler. This was first
reported downstream on the ChromeOS kernels, but is also reproducible
on mainline using Fluster with the FFmpeg v4l2m2m decoders. Even though
the actual capture format is not supported, the affected code paths
are triggered.

Since this lock just protects the context list and operations on it are
very fast, it should be OK to switch to a spinlock.

Fixes: 6467cda18c ("media: mediatek: vcodec: adding lock to protect decoder context list")
Fixes: afaaf3a0f6 ("media: mediatek: vcodec: adding lock to protect encoder context list")
Cc: Yunfei Dong <yunfei.dong@mediatek.com>
Cc: stable@vger.kernel.org
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
History 2025-10-20 09:23:17 +02:00
..
cec media: cec: Fix debugfs leak on bus_register() failure 2025-10-14 15:07:37 +02:00
common media: update Hans Verkuil's email address 2025-09-09 15:59:02 +02:00
dvb-core media: dvbdev: Use %pe format specifier 2025-10-17 11:31:15 +02:00
dvb-frontends media: mn88443x: Use %pe format specifier 2025-10-17 11:31:15 +02:00
firewire media: firewire: firedtv-avc.c: replace BUG with proper, error return 2023-08-10 07:58:37 +02:00
i2c media: i2c: st-mipid02: Use %pe format specifier 2025-10-17 11:31:15 +02:00
mc media: mc: Clear minor number before put device 2025-09-10 10:42:13 +02:00
mmc media: mmc: siano: simplify module initialization 2024-04-08 13:48:19 +02:00
pci media: ipu6: isys: Use %pe format specifier 2025-10-17 11:31:16 +02:00
platform media: mediatek: vcodec: Use spinlock for context list protection lock 2025-10-20 09:23:17 +02:00
radio media: update Hans Verkuil's email address 2025-09-09 15:59:02 +02:00
rc [GIT PULL for v6.18] media updates 2025-10-02 13:13:26 -07:00
spi media: gs1662: remove unused struct 'gs_reg_fmt_custom' 2024-05-31 13:51:16 +02:00
test-drivers media: v4l2-mem2mem: Don't copy frame flags in v4l2_m2m_buf_copy_metadata() 2025-10-17 11:31:16 +02:00
tuners Revert "media: xc2028: avoid use-after-free in load_firmware_cb()" 2025-10-14 15:07:36 +02:00
usb media: pvrusb2: Fix incorrect variable used in trace message 2025-10-14 15:07:37 +02:00
v4l2-core media: v4l2-mem2mem: Don't copy frame flags in v4l2_m2m_buf_copy_metadata() 2025-10-17 11:31:16 +02:00
Kconfig media: Kconfig: Make DVB_CORE=m possible when MEDIA_SUPPORT=y 2022-12-07 17:58:46 +01:00
Makefile media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00