From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39287257844 for ; Mon, 8 Dec 2025 02:29:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765160992; cv=none; b=KiHroaTplRIjp6AKI0sB9PInhCxxhvg8ZRsKmwz4GlOUYoyjecuBr4H+mUB/+lkd17Yba5vUpcSnNj2WvNUGJpFMjcBVdlQaQlnRxGJxV9a3ymazhOhXzI6d7YssMLOMVhY/hNG6O8Mu/zgwsOP57hU2Gibwb69VfdSxRX2JN44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765160992; c=relaxed/simple; bh=hzc8C19r7uH0dsdvAPpDbmQcPxhEeBMAJ7Ie42BTpJg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CggLo2pFCSjNh4frljKlJ41WJQqRXGTgLRctd/FAOpyfmxyzf9Hc3dbq7R99gQQjkpiWfSfOMQAEFE3FiGiF9+wj0N9yGupTR8ff5NryqKYqTUqAClr6gphHqwn4Dp0n5DNMUaSGk9rC+ERwSKBwSzHN7NeNv37GR1k8i4owDZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=FlnPPFmB; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=j76cw5Tg; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="FlnPPFmB"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="j76cw5Tg" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5B7MpBCQ3416185 for ; Mon, 8 Dec 2025 02:29:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Bmi1w9LBw44P51v6VUD3hZr1/SiIEf8YjqeuvDA6TzQ=; b=FlnPPFmB0TBzjFNC AQQTeuaGXqB+Dpl9mdDvUNRvbLvrEjPssBFwq3oDKIRatXk19ovX6u/EzboTPaEO RRnCLwbs2agAg/3FIs47HaSxOnRc7i5b2XjUcUDnvw7ro5as5S9ND+/c4wbyHrXJ nKJtZAHCeqoPykK2tXCslQMI9BBkW9hCsd1+lJqM5ODnnQbDAg9EqiJPCrtelBee A5gBAFfviWKLbeIGU8LWg9VTFLjpgMJj5cSuUA6PECInBOrggy79qIbY5GLlQm0r ZMyaIevV6V89wMr7KvCEeYa1kODHlgEq+ZgKEkHBSZRdCt6ARepxtzdUCFGqm93n Txoarg== Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4avcv8390s-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 08 Dec 2025 02:29:48 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-7b90740249dso6122961b3a.0 for ; Sun, 07 Dec 2025 18:29:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1765160988; x=1765765788; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Bmi1w9LBw44P51v6VUD3hZr1/SiIEf8YjqeuvDA6TzQ=; b=j76cw5TgD4TckWC9vqvGaKJA5La/y/OGdFj0G5guqPo8ybguxpRUu5w8+yMb4PoR41 sXZ2s+Y6nafovP40bmFxQ2HRIxVLaA1iNk4WBgsEIeF1JrbW4TyHC7m181Y+R9XMmFF5 Nvy7QlwmkaIkn7SgHgusM6W5bahH+YYqcxQRT3SLw5eWR6DXTr/9r4qfpIEJtGsAoru7 dGToXEKfHBNRyd7FPMQm41tlo1HELcBv4vaFtTjmuE98y8AsL6f+JHznv4MSqCR10T1b 5953SwZFWbyVd/AXjJRZRd1eswFc9ZC0xL/QRiLkz9JrYjGG7lsHaYGxrDlklR++Wcn/ eBfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765160988; x=1765765788; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Bmi1w9LBw44P51v6VUD3hZr1/SiIEf8YjqeuvDA6TzQ=; b=BgiKheyBhnIkpQxKvIyN6MS5ipR/khT+HgZxF7b/jdqX5rJgx8nS3mJdLw8yZrjoo3 WLGE54z76y5fgGFtr2hm0UJCcN3rwTfQj6Kkr1FOK6756Cxrers+0Ctc1ruXMC5w48v/ 69nJo130u5PWF+9bv3eqhsBZ++VhBTb4MufxCQzy6eLhasTSmSO/ihuU6HMH/D5PS6v3 5EyfOzh/w1pxaKr2AhXn7rBv2YpjOnmg899/T+n67Eb1N54yHDA2LhSbq9VfAN6PdVl3 lP+iLnntmSyTenO7Z9QqssAkIoWOR0ClMtNZXiUqIUM+yzTSkgIcAPUEn++OTZ3O4t3R Qogg== X-Forwarded-Encrypted: i=1; AJvYcCUek61U92sPbcgmr3Etq5l9DbtJgKZNYRZCYsg552erEBs4ZpscivdUJ+kc4jajtdGWnPTH/MPyCoiImfs=@vger.kernel.org X-Gm-Message-State: AOJu0YwO/YSEk1EfCoYY56Wevnnm4lNCxe8ZLbpz89ZmdVmx/h4JEsVQ VrxZwgV/zCIcixj3zInp6zWNo7GOfph6NHI1Y+N4qYapmBo8VtL0YIkTBIuTUYFe9/0UNlNDFGY liUvEefyKvud+zglnTJKgXSy2QF8WUWtHLSVZACFizohqzxE9v8kRxs+T/fO5bGXNLf0= X-Gm-Gg: ASbGncvua/M4AucZDf1wmksNvy1C2NM424uPA8NXXnAlrDQ4wTzaa90PnC9FJ1EeJMC zuG7r+fJDHoqHt7UNmhDjZp3Uj1lVVoP385nGun+gzUUWtvy2xKDdPGFdwvIf+nlbAe67ZwCWKC k8LPvCze+kI2A+vV9iYaAaMYmX6pFGVe8lvFvQJcinUziA28SY6sr+R0zEYcoRmiGTDLPYW4rKf q81Hqa0PBuSLTH/2fsc+dNFQV2V0J2u6hh+1IAW44iJVJcenUA0ZPevObUd3cdbtURyRV8e6Qrv b1tWddt4U6LoGQmAEqcYmJmBsjP4OiRSIN8AQWPEdqtXrhgw8nXR1xL5CdcteP3FxHFY3BuOKIh SIndJkwzRNut5NXlOlq9BVIW8KwqWeH5KqpR8WPtgGTWNTBhluGwFOy4dKQfjnk2cbfGcywmYtQ otNeY9mg== X-Received: by 2002:a05:6a00:12c6:b0:7e8:450c:61c5 with SMTP id d2e1a72fcca58-7e8c561fabdmr6053062b3a.53.1765160987604; Sun, 07 Dec 2025 18:29:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvFA5MAKIrZF6hTwwV49e2Ex0RmYD0kAZYHj4bWBKUpGSCC5rnpUZc4TaQgn6L+cw1qN12KA== X-Received: by 2002:a05:6a00:12c6:b0:7e8:450c:61c5 with SMTP id d2e1a72fcca58-7e8c561fabdmr6053038b3a.53.1765160987126; Sun, 07 Dec 2025 18:29:47 -0800 (PST) Received: from [10.133.33.217] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7e801c6a1fcsm6496521b3a.4.2025.12.07.18.29.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Dec 2025 18:29:46 -0800 (PST) Message-ID: <32bf8a1a-9e9b-438c-89c7-9fa0c88e9ca2@oss.qualcomm.com> Date: Mon, 8 Dec 2025 10:29:41 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] media: venus: vdec: fix error state assignment for zero bytesused To: Bryan O'Donoghue , Vikash Garodia , Dikshita Agarwal , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <3TiW-6pGFzHye29VWlJBXCdsteVQOc5LlAPyURHQMjIMusStSaLFbZE_dWv8B9GPFjM91n17iLSlulpcBpy4ow==@protonmail.internalid> <20251126-fix-error-state-v1-1-34f943a8b165@oss.qualcomm.com> <5516cc69-de15-44df-bfbf-8263e71c919a@kernel.org> Content-Language: en-US From: Renjiang Han In-Reply-To: <5516cc69-de15-44df-bfbf-8263e71c919a@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: rgBANv26z1Bi5aC9dnyOZdna0Zmatz4u X-Authority-Analysis: v=2.4 cv=KL9XzVFo c=1 sm=1 tr=0 ts=6936381c cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=Wn1kp30-KnWUW-RVUJoA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjA4MDAxOSBTYWx0ZWRfXzVKp3FSro+J2 47qyX96hU8WRjxTFFabl+STGqpYsDICSQgnpAUejSE9LpD3QG6GfynZE0HZ7W/0qpt0tjuq2wwV t+kcOjQd2kgtF4QAsfyOA4qcXa3AAsJyBIclpXkSiHQ4CBNWS4wUezA4gyNVg1+YGAbvrdbv38T 4NKd4KvYXByWfCpP+XBBlAgYWuSkagCTua2MlsuoKhCcXcrT56H9favmMbvrde9/N9Hx7BRcUCK 0XfrFPL9k2UtwsVNyi3U0loeMCsm2w/0Vds5K4FUEpwLeCjz+AhpMbpNu+jtCW3GStCEABBheMT /+hlpw8exWuSHcIHTgI5JDpCMt8/9LeAo5KJBPb8RdZafWGPq+bAsunxl8G3sccPwXT7ZOzh+fY vgaDiNDbwwFKNWuYkAP7Zc1jHR3JbQ== X-Proofpoint-GUID: rgBANv26z1Bi5aC9dnyOZdna0Zmatz4u X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-06_02,2025-12-04_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 impostorscore=0 spamscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 malwarescore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512080019 On 12/7/2025 7:56 AM, Bryan O'Donoghue wrote: > 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. sure, thanks for your comments. > >> >> Signed-off-by: Renjiang Han >> --- >> 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 >> > -- Best regards, Renjiang Han