]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: renesas: vsp1: Fix _irqsave and _irq mix
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 5 May 2024 17:22:27 +0000 (20:22 +0300)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 19 Jun 2024 16:43:09 +0000 (19:43 +0300)
commit57edbbcf5258c378a9b9d0c80d33b03a010b22c8
tree0556ac6d5ce94f0e503640968cc0668144df5a67
parent65f3594366eb303680eae97b935fa0fc90cb7ccc
media: renesas: vsp1: Fix _irqsave and _irq mix

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: 99362e32332b ("[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>
drivers/media/platform/renesas/vsp1/vsp1_histo.c