android_kernel_xiaomi_sm8450/drivers/media
Laurent Pinchart 3944484005 media: renesas: vsp1: Fix _irqsave and _irq mix
[ Upstream commit 57edbbcf5258c378a9b9d0c80d33b03a010b22c8 ]

The histogram support mixes _irqsave and _irq, causing the following
smatch warning:

     drivers/media/platform/renesas/vsp1/vsp1_histo.c:153 histo_stop_streaming()
     warn: mixing irqsave and irq

The histo_stop_streaming() calls spin_lock_irqsave() followed by
wait_event_lock_irq(). The former hints that interrupts may be disabled
by the caller, while the latter reenables interrupts unconditionally.
This doesn't cause any real bug, as the function is always called with
interrupts enabled, but the pattern is still incorrect.

Fix the problem by using spin_lock_irq() instead of spin_lock_irqsave()
in histo_stop_streaming(). While at it, switch to spin_lock_irq() and
spin_lock() as appropriate elsewhere.

Fixes: 99362e3233 ("[media] v4l: vsp1: Add histogram support")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-renesas-soc/164d74ff-312c-468f-be64-afa7182cd2f4@moroto.mountain/
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-19 05:40:49 +02:00
..
cec media: cec: core: add adap_nb_transmit_canceled() callback 2024-06-16 13:32:30 +02:00
common media: v4l2-tpg: fix some memleaks in tpg_alloc 2024-03-26 18:21:55 -04:00
dvb-core media: dvbdev: Initialize sbuf 2024-07-05 09:12:50 +02:00
dvb-frontends media: dvb-frontends: tda10048: Fix integer overflow 2024-07-18 13:05:40 +02:00
firewire media: firewire: firedtv-avc: fix a buffer overflow in avc_ca_pmt() 2021-11-06 14:10:09 +01:00
i2c media: tc358743: register v4l2 async device only after successful setup 2024-03-26 18:21:55 -04:00
mc media: mc: mark the media devnode as registered from the, start 2024-06-16 13:32:33 +02:00
mmc media updates for v5.8-rc1 2020-06-03 20:59:38 -07:00
pci saa7134: Unchecked i2c_transfer function result fixed 2024-08-19 05:40:48 +02:00
platform media: renesas: vsp1: Fix _irqsave and _irq mix 2024-08-19 05:40:49 +02:00
radio media: radio-shark2: Avoid led_names truncations 2024-06-16 13:32:11 +02:00
rc media: imon: Fix race getting ictx->lock 2024-08-19 05:40:48 +02:00
spi media: cxd2880-spi: Fix a null pointer dereference on error handling path 2021-11-18 14:04:04 +01:00
test-drivers media: vivid: avoid integer overflow 2023-11-28 16:54:52 +00:00
tuners media: xc4000: Fix atomicity violation in xc4000_get_frequency 2024-04-13 12:58:03 +02:00
usb media: uvcvideo: Override default flags 2024-08-19 05:40:49 +02:00
v4l2-core media: v4l2-core: hold videodev_lock until dev reg, finishes 2024-06-16 13:32:33 +02:00
Kconfig media: correct MEDIA_TEST_SUPPORT help text 2022-01-27 10:54:29 +01:00
Makefile media: media/test_drivers: rename to test-drivers 2020-04-16 10:38:31 +02:00