Linux-Media Archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Cc: linux-media@vger.kernel.org,
	Dan Carpenter <dan.carpenter@linaro.org>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] media: renesas: vsp1: Fix _irqsave and _irq mix
Date: Tue, 7 May 2024 22:30:17 +0300	[thread overview]
Message-ID: <20240507193017.GA2012@pendragon.ideasonboard.com> (raw)
In-Reply-To: <8b532593-1e06-2378-280c-47951ad51453@gmail.com>

On Tue, May 07, 2024 at 11:11:25AM +0300, Sergei Shtylyov wrote:
> 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? :-)

Oops :-) I'll fix it, but will likely not send a new version if that's
the only issue.

> > 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/
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> >  .../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

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2024-05-07 19:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-05 17:45 [PATCH] media: renesas: vsp1: Fix _irqsave and _irq mix Laurent Pinchart
2024-05-07  8:11 ` Sergei Shtylyov
2024-05-07 19:30   ` Laurent Pinchart [this message]
2024-05-07 13:52 ` Kieran Bingham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240507193017.GA2012@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dan.carpenter@linaro.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=sergei.shtylyov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).