Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp135495lqe; Thu, 4 Apr 2024 01:53:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVrrjC2IqUjzhyus6w7dnoQwrXxXY3cx758aLwT3FnFiNYjXQB4g4fYvCUVNaCUkcucSBMFs7xavdUsgOvBVWpjpSji3T/YNNTYnSgTqA== X-Google-Smtp-Source: AGHT+IFv3Y7jHEVytbsGlnVgpvgBBSwzv/NKoIYyVbfZe/6TFRks13Tnqyw4MaZdTC2NurOPouFl X-Received: by 2002:a17:903:32c3:b0:1de:eddc:9f9a with SMTP id i3-20020a17090332c300b001deeddc9f9amr2136418plr.53.1712220815530; Thu, 04 Apr 2024 01:53:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712220815; cv=pass; d=google.com; s=arc-20160816; b=p9VIe1WetkC8oZ6LShi4KRTvfcipJ4vZesBB50POkcH4HN+HpNNOmfblqUlmoDZrh5 zE3jCgT0Ih6eSoOM7P3cQUaGglLJrQ6CjTQ9Fb4jydCyIu19pBkn7+3RPFtk8o821TV2 oW7V6LSInI6wzL6iovRQXKEOFXA+ZBKqVlL3iBv9YQAItMhmOq2hXEelxDnsCVzIEbyS H2Azo3nZ4mjcQm/lowtnfU4lqKtFU8pJSVszQSSrQMKKIJe+yunB/L8DN4TMUlHdPGPg I7UL0JNqeV9WCxyl2YCMjmSkVqcL0TxJ+R/kDfL8rETW/ZIsSGgmXo7POmdUryKwR1kj 6f5A== 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=MGA13cAnkY6mPpbzSMgevDLYB9+Tr41gsznS2L+gZR4=; fh=mg8r/OeCAOMqQf+ug3RDcWArZbbE+dFRn6ObXd4Snns=; b=v8Hk2w0jWD0jlKR1pLplR0h5KJQiUnOczAjPTFA+1m/BFxi3KK7w9yd4xH2eHKgPqC G8h4NvKQbjb3W0zP9AY1nS5oc7to+caZd6SbJcOY2xvDUMgUB8AnYemA6NXTlykGWFRH hMMscw8jQoGe4Orvf6/qPC3fAWgcxCPAMAsRXxwa9yYGCEEagZXNFdS3Qwm6Q0ok6uC0 MdOBadnVZOokbLroKkSzTOeNi7Pi0czOI8+X6MN0hEcGlrxQ2E51zR3wcmQiUYUXPv7i 3N9lX7fp+QNPqzr4zNr57T5lgQCkPGflQF4G0uEt3KSu2o59WOYov8AlQjkPslCQWiRx Cq8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-131120-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131120-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m8-20020a170902db0800b001e2834a58a4si833211plx.331.2024.04.04.01.53.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 01:53:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131120-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-131120-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131120-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 0A32AB28FB9 for ; Thu, 4 Apr 2024 08:41:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B50771B25; Thu, 4 Apr 2024 08:40:50 +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 6A9576027D; Thu, 4 Apr 2024 08:40:49 +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=1712220049; cv=none; b=cy5eZn6pyYvu1LBEuBmHCynKM44Xvzp6Ni7ZXIoFpNOaPOOxoJ9kzfkr7Nfe74ORpphU278Qhi/fbUvvGv2JvTi4WP9tOhFug66qNFLpE+P429MRnITvpImrWuHTEAdqfMdUHZIO7oMRXYyAAN6DRIroGn40CztCt61GGy8wjd4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712220049; c=relaxed/simple; bh=wn7xtsjaTkXfKIzw5gjpPwLITNNhyQ7OfsOpriiQNiY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rkrpu4sauoCffvnZeJUto/zSm9RP3IH6wPJihpqHRFcy0R3FCMCh1QEXHc13xhuo2ecfW2TcU1hIfgj7qe2Y5mec+ZhfuygHBHlJffFfyHHKwmIFl/5tPEM80rgI+w1JI6de3bKfTiZ4gswqWaohGjbB8mzq4/+xTXBD96e6+DM= 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 AC91EC433C7; Thu, 4 Apr 2024 08:40:46 +0000 (UTC) Message-ID: <1caa6a4c-d4c1-474a-abf2-63384dba3cbb@xs4all.nl> Date: Thu, 4 Apr 2024 10:40:44 +0200 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 Hi Nini, This patch has now been merged in mainline as commit ce5d241c3ad45 ("media: cec: core: remove length check of Timer Status"). To get this into older kernels please post this patch to stable@vger.kernel.org, CC the linux-media mailinglist, and mention the mainline commit that I provided above. Also mention that this patch applies to 5.10 and up. You can mention that the patch applies to 5.4 and 4.19 as well after removing the '/core' directory from the pathnames. Since you are the author of the patch, you should be the one to post the patch. Regards, Hans 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. > > 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: