All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: rcar-vin: Return unused buffers correctly
Date: Sat, 21 Nov 2026 09:38:08 +0100	[thread overview]
Message-ID: <20261121083808.GC3363038@ragnatech.se> (raw)
In-Reply-To: <avrXFz3LNGShIT1K@zed>

Hi Jacopo,

Thanks for your review.

On 2026-11-16 11:21:36 +0100, Jacopo Mondi wrote:
> Hi Niklas
> 
> On Fri, Aug 28, 2026 at 12:37:44PM +0200, Niklas Söderlund wrote:
> > Unused VB2 buffers should be returned with state DONE not ERROR when
> > stopping.
> 
> Indeed
> 
> I think this is worth a fixes tag
> 
> I'll add, if you agree:
> 
> Fixes: 63a71dd813e2 ("media: rcar-vin: Break out hardware start and stop to new methods")
> Cc: stable@vger.kernel.org
> 
> Not 100% sure what commit to use in the Fixes tag as unused buffers
> were returned in ERROR state before that commit, possibily from the
> very first commit that introduced the driver

If a fixes tag is needed I indeed think it needs be be back to when the 
driver was added. But is it worth the churn? I will leave it out for 
now.

> 
> >
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > ---
> >  drivers/media/platform/renesas/rcar-vin/rcar-dma.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c
> > index 73cda0e2d45a..f3003dd61890 100644
> > --- a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c
> > +++ b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c
> > @@ -1449,7 +1449,7 @@ static void rvin_stop_streaming_vq(struct vb2_queue *vq)
> >  	dma_free_coherent(vin->dev, vin->format.sizeimage, vin->scratch,
> >  			  vin->scratch_phys);
> >
> > -	return_unused_buffers(vin, VB2_BUF_STATE_ERROR);
> > +	return_unused_buffers(vin, VB2_BUF_STATE_DONE);
> 
> Does the same apply to buffers queued to the hardware and not
> processed released in rvin_stop_streaming() ?
> 
> 	/* Return unprocessed buffers from hardware. */
> 	for (unsigned int i = 0; i < HW_BUFFER_NUM; i++) {
> 		if (vin->buf_hw[i].buffer)
> 			vb2_buffer_done(&vin->buf_hw[i].buffer->vb2_buf,
> 					VB2_BUF_STATE_ERROR);
> 	}

Indeed it should.

> 
> (nit: there is a stray empty line after this loop, if this hunk needs
> to be patches as well, it might be a good occasion to remove it as
> well)

Nice catch, this in itself is worth a respin ;-)

> 
> Thanks
>    j
> 
> 
> >  }
> >
> >  static const struct vb2_ops rvin_qops = {
> >
> > ---
> > base-commit: 4900cad020c0580dfb1be27776ff10a4ef110cfa
> > change-id: 20260828-vin-fix-vb2-28e1bb24a618
> >
> > Best regards,
> > --
> > Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> >
> >

-- 
Kind Regards,
Niklas Söderlund

      reply	other threads:[~2026-11-21  8:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 10:37 [PATCH] media: rcar-vin: Return unused buffers correctly Niklas Söderlund
2026-11-16 10:21 ` Jacopo Mondi
2026-11-21  8:38   ` Niklas Söderlund [this message]

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=20261121083808.GC3363038@ragnatech.se \
    --to=niklas.soderlund+renesas@ragnatech.se \
    --cc=geert+renesas@glider.be \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mchehab@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.