linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bod@kernel.org>
To: Renjiang Han <renjiang.han@oss.qualcomm.com>,
	Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
	Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: venus: vdec: fix error state assignment for zero bytesused
Date: Sat, 6 Dec 2025 23:56:32 +0000	[thread overview]
Message-ID: <5516cc69-de15-44df-bfbf-8263e71c919a@kernel.org> (raw)
In-Reply-To: <20251126-fix-error-state-v1-1-34f943a8b165@oss.qualcomm.com>

On 26/11/2025 04:23, Renjiang Han wrote:
> Previously, the check for zero bytesused and the assignment of error
> state was performed outside the V4L2_BUF_FLAG_LAST branch, which could
> incorrectly set the error state during drain operations. 

This deserves more elaboration.

Instead of saying previously - talk about what it currently does and the 
precise circumstances under which it goes wrong. Try to make the 
description as plain and concise as possible.

This patch
> moves the zero-bytesused check inside the 'else' branch, ensuring that
> the error state is only set for non-EOS buffers with zero payload.
> 
> Additionally, the patch keeps the rest of the buffer state handling
> logic unchanged, including handling of HFI_BUFFERFLAG_DATACORRUPT and
> HFI_BUFFERFLAG_DROP_FRAME.

I don't think you need to tell us what's not touched in your commit log.

- Tell us what is wrong directly and plainly.
   Include how the bug you are fixing can come about i.e. under what
   circumstances we would see the error.

- Then tell us how you've fixed it.

- And include a Fixes: tag please.
   Since this is a bug fix you are proposing, it needs to be backported.

> 
> Signed-off-by: Renjiang Han <renjiang.han@oss.qualcomm.com>
> ---
> This patch refines the error state assignment logic in the Venus vdec
> driver for Qualcomm platforms. Specifically, it ensures that the buffer
> state is only set to VB2_BUF_STATE_ERROR for non-EOS capture buffers
> with zero bytesused, preventing false error reporting during drain
> operations.
> ---
>   drivers/media/platform/qcom/venus/vdec.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 4a6641fdffcf79705893be58c7ec5cf485e2fab9..d0bd2d86a31f9a18cb68b08ba66affdf8fc5092d 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -1440,10 +1440,10 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type,
>   				inst->drain_active = false;
>   				inst->codec_state = VENUS_DEC_STATE_STOPPED;
>   			}
> +		} else {
> +			if (!bytesused)
> +				state = VB2_BUF_STATE_ERROR;
>   		}
> -
> -		if (!bytesused)
> -			state = VB2_BUF_STATE_ERROR;
>   	} else {
>   		vbuf->sequence = inst->sequence_out++;
>   	}
> 
> ---
> base-commit: 663d0d1af3faefe673cabf4b6b077149a87ad71f
> change-id: 20251126-fix-error-state-24183a8538cd
> 
> Best regards,
> --
> Renjiang Han <renjiang.han@oss.qualcomm.com>
> 


  reply	other threads:[~2025-12-06 23:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3TiW-6pGFzHye29VWlJBXCdsteVQOc5LlAPyURHQMjIMusStSaLFbZE_dWv8B9GPFjM91n17iLSlulpcBpy4ow==@protonmail.internalid>
2025-11-26  4:23 ` [PATCH] media: venus: vdec: fix error state assignment for zero bytesused Renjiang Han
2025-12-06 23:56   ` Bryan O'Donoghue [this message]
2025-12-08  2:29     ` Renjiang Han

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=5516cc69-de15-44df-bfbf-8263e71c919a@kernel.org \
    --to=bod@kernel.org \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=renjiang.han@oss.qualcomm.com \
    --cc=vikash.garodia@oss.qualcomm.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 NNTP newsgroup(s).