Re: [PATCH v2] media: rcar-vin: Return unused buffers correctly
From: Jacopo Mondi
Date: Sun Nov 22 2026 - 13:26:08 EST
Hi Niklas
On Sat, Nov 21, 2026 at 12:54:59PM +0100, Niklas Söderlund wrote:
> Unused VB2 buffers should be returned with state DONE not ERROR when
> stopping.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
Reviewed-by: Jacopo Mondi <jacopo.mondi@xxxxxxxxxxxxxxxx>
I'll take it as you don't consider a Fixes required. This however
count as a bug to me as it doesn't respect the expected API behaviour.
Am I too concerned ?
> ---
> Changes in v2:
> - Link to v1: https://patch.msgid.link/20260828-vin-fix-vb2-v1-1-97eb1f4f75c9@xxxxxxxxxxxx
> ---
> * Changes since v1
> - Fix unused buffers returned in rvin_stop_streaming() too.
> ---
> drivers/media/platform/renesas/rcar-vin/rcar-dma.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c
> index 5e515d16c164..d3d1af47f8b1 100644
> --- a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c
> +++ b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c
> @@ -1434,7 +1434,7 @@ void rvin_stop_streaming(struct rvin_dev *vin)
> 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);
> + VB2_BUF_STATE_DONE);
> }
>
> }
> @@ -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);
> }
>
> static const struct vb2_ops rvin_qops = {
>
> ---
> base-commit: aa0f4c41d4870a18e65772a1817af16427200371
> change-id: 20260828-vin-fix-vb2-28e1bb24a618
>
> Best regards,
> --
> Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
>