Re: [PATCH] media: renesas: vsp1: Fix _irqsave and _irq mix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/5/24 8:45 PM, Laurent Pinchart wrote:

> 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 in correct.

   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@xxxxxxxxxx>
> Closes: https://lore.kernel.org/linux-renesas-soc/164d74ff-312c-468f-be64-afa7182cd2f4@moroto.mountain/
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>
> ---
>  .../media/platform/renesas/vsp1/vsp1_histo.c  | 20 ++++++++-----------
>  1 file changed, 8 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_histo.c b/drivers/media/platform/renesas/vsp1/vsp1_histo.c
> index 71155282ca11..cd1c8778662e 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_histo.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_histo.c
[...]

MBR, Sergey




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux