Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2357533rdb; Mon, 5 Feb 2024 04:18:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkjqE1wCpMhGu80XM59G2+ohf1A+QfU+5sHUwWw6l6iH0PQ3WrCdOviScnSTwqJ2CuWA71 X-Received: by 2002:a17:902:8495:b0:1d9:2a26:d4fa with SMTP id c21-20020a170902849500b001d92a26d4famr13121009plo.50.1707135508582; Mon, 05 Feb 2024 04:18:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707135508; cv=pass; d=google.com; s=arc-20160816; b=s8/VXlVNP0en3pfBk7+yA6gXTC+/3DXtiYaIx9Zkcj5Sw+G9WeqHkGTr1fkQ5KDda1 XdsRt08jjBQcXbF3h/6ZqdYKPjCAXx+okPJcmMRy8Np1rmjU9CvoX62F6tU39jQ6Jya5 eutbeqsHHznhDqwRNdn/Zz4u3ECDNyorPdZuHtQqS/DqpmAdJw4xhVpps2L388DbyeBV 7RBTdn6YbylmIijYGyECqwQ/G+QPfVWlE4v/pa7m22lXjnm4m0dYMgxOPJvozVxATT2T F8z8WxZ/r2Hd+EwZaOLXxRk2cUhnHFiWWd2/ny76SGtM4EQ2M8ciq/MEqGmKtdjjxNLN eLxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=EyMfTzarMsn+VMC2pMy5sw7PNp4pvfoaeBDxyAfKiXQ=; fh=t1EcfO8sU77oRQ2A+C7cbiHzIbFe1xOp7fHpZRhNfNs=; b=HnWQKSmUl1BPEEf0wm4W707aHypzcjIzpqcsmyHpjzlJW8speNjVSjJrTawbwDdGNs kv9ppuNRFr+cEOPG0Wg30/FQpx3iiZ/UMDv/vY5DIf+iyMtn2TYmrg7pGVx+Tjm+46k3 SnR0ObWxOJu+8SRStnZe8LdN9QrdHn832nT7sia3YryT3DdADeSiBADB1qMurgyzSd1K XacET0KSK1NSAF7ffaWstWAVmq+wslcC1pD6GwNubY+2OW7+Nc+N6prN/woNISVFrDm6 BhbaOgksDYTjCDKoLZvKhV7OZGERTEI8tD9jYdMuLXhB0K6BOtcd3ojZUvJnu1qHGVD9 h43Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-52539-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52539-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl X-Forwarded-Encrypted: i=1; AJvYcCUwcRQsomLDn5ZLv9ZwV33zct7fd1q9bHc8w1gbwFk04rSi0bAXns4x3Nd6HZBCG91hcEFRCLTZhZEDoVoH8NdZlNo5w9LtwrqMO1TttA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b5-20020a170902d30500b001d9a63012d9si2334280plc.11.2024.02.05.04.18.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 04:18:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52539-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-52539-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52539-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D184DB27CA3 for ; Mon, 5 Feb 2024 12:01:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E34201B80A; Mon, 5 Feb 2024 12:00:10 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6535A1A5BA; Mon, 5 Feb 2024 12:00:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707134410; cv=none; b=GRA8mBW1zJa5v7377Nv/IiqMMM3Y1HwQlfAZnDH8cTfV3RhEZvQf1SY9LPxFGVEXkHULuBcI4CcZ6DGaGsCZhzk27qH7PkmSMtgcwQh42NkU567311iTFlB5ALoloq69TMk8TDSEyiGPxgx3f5nC1/GxteM+lAZvy4xVL2RuOnY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707134410; c=relaxed/simple; bh=srmUkqDwM3l+DNKrojuZuVgjMzoYMNUPRcJviySaKCg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Bvl+dj2tK9blq5H0eT5X2u7L95qssyp5p7nFW/T1Nwq3OUHAgWI2yG936PUHLLqji7XpLZn4lhCPbLIAYnKQDqmNQ3w5IzAyWs1KV16aIfsCWx3T5jbN5Jh/AIk7/05FE17dfWbQsefM1ylgdk0j1LlPWP1dnrT+/il13gBOBrQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A3C6C433C7; Mon, 5 Feb 2024 12:00:07 +0000 (UTC) Message-ID: <8a4447ba-d4ac-40ac-9d6b-796db37f3100@xs4all.nl> Date: Mon, 5 Feb 2024 13:00:05 +0100 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: cec: core: remove length check of Timer Status Content-Language: en-US, nl To: nini.song@mediatek.com Cc: ci.wu@mediatek.com, mchehab@kernel.org, nicolas@fjasle.eu, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , AngeloGioacchino Del Regno , Jani Nikula , linux-kernel@vger.kernel.org References: <20240125132850.10430-1-nini.song@mediatek.com> From: Hans Verkuil In-Reply-To: <20240125132850.10430-1-nini.song@mediatek.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 25/01/2024 14:28, nini.song@mediatek.com wrote: > From: "nini.song" > > The valid_la is used to check the length requirements, > including special cases of Timer Status. If the length is > shorter than 5, that means no Duration Available is returned, > the message will be forced to be invalid. > > However, the description of Duration Available in the spec > is that this parameter may be returned when these cases, or > that it can be optionally return when these cases. The key > words in the spec description are flexible choices. Good catch, the spec indeed says 'may', so dropping the check in this patch is the correct thing to do. It's merged in our staging tree and it will appear in v6.9. Regards, Hans > > Remove the special length check of Timer Status to fit the > spec which is not compulsory about that. > > Signed-off-by: Nini Song > --- > drivers/media/cec/core/cec-adap.c | 14 -------------- > 1 file changed, 14 deletions(-) > > diff --git a/drivers/media/cec/core/cec-adap.c b/drivers/media/cec/core/cec-adap.c > index 5741adf09a2e..559a172ebc6c 100644 > --- a/drivers/media/cec/core/cec-adap.c > +++ b/drivers/media/cec/core/cec-adap.c > @@ -1151,20 +1151,6 @@ void cec_received_msg_ts(struct cec_adapter *adap, > if (valid_la && min_len) { > /* These messages have special length requirements */ > switch (cmd) { > - case CEC_MSG_TIMER_STATUS: > - if (msg->msg[2] & 0x10) { > - switch (msg->msg[2] & 0xf) { > - case CEC_OP_PROG_INFO_NOT_ENOUGH_SPACE: > - case CEC_OP_PROG_INFO_MIGHT_NOT_BE_ENOUGH_SPACE: > - if (msg->len < 5) > - valid_la = false; > - break; > - } > - } else if ((msg->msg[2] & 0xf) == CEC_OP_PROG_ERROR_DUPLICATE) { > - if (msg->len < 5) > - valid_la = false; > - } > - break; > case CEC_MSG_RECORD_ON: > switch (msg->msg[2]) { > case CEC_OP_RECORD_SRC_OWN: