Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp217581rwb; Tue, 25 Jul 2023 14:45:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlGYJg/Tbmp+AlnHyMpq2uGb8RXCOU8Pm7/aeydOoNCE2O4Z6Ulexv8BzlLqyGKAYFtZdaBu X-Received: by 2002:a17:906:1c5:b0:99b:65fa:fc2b with SMTP id 5-20020a17090601c500b0099b65fafc2bmr83507ejj.35.1690321526620; Tue, 25 Jul 2023 14:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690321526; cv=none; d=google.com; s=arc-20160816; b=p7otDBE6t2YfMedpEJVsbN5LFdZ67BKh9p7s1oZxVtJeiEvZzIlDUeel6zao8m0syr sTOyc3hcD5mUUqGAP2plHCD6+nOWmx9TzjItJGK+rLuMXpcXBdecnsMZ6LRGMagH6f3D mlvd6k9+nDErXVeYb+/LJsFeWh50V22ZXHhbiSN9QJSpqsnMODGW4+ctVEL/B7P7fBnC KhRn4igoptjcxR+uWoHZ99V6jUZl1O/QVFzzBDMjPKJO6icwuliJoY6B0qcu+FKbBASh 8nIy3EJEQz8u2KLX2/IiG19QEGaUyp+m6augKe/ihMMy0osS9UZLRMck+JTpeteYItco zotg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2BVWzhm385pmpQxclrdIFUUD3T4d2Dvi7eurxunpAts=; fh=UtQWV4/uRMB7x21x9Rs2AnkYdzIMek175ZhNxwYniaw=; b=KcBzq7ZikI8FyusdGGL3njaqUjnRAmhizwOkHjzG7nlmlRvwxjZ1X+WUHARnVcgu/5 v+oqrt2dBOG4OeqZGgewZ3rDWw7GIKNpPH+IDXq+iBgR7s/bImS+ugGMpMErDZZ+cSnt 8kDbHCclRhMvn49AROSoxYien3qIWmUDdkcctcsTXSmulECT3SUfINAORJvCx8rV67r/ 6/TtgtR+UrIpZ4OPNAntMMZ/yRTRkeeJyneZhZHOwbbsWt3h4QM21VMBwvFwijJXFCa9 rcTg0pGu53YJYQkdYIpNLlB3gcBvPQIC911DMQChhBQF/b/UKvCraRaovCtWkA96PlAa 5CPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=it21CKyA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a170906590a00b00993a68a3af6si8090714ejq.511.2023.07.25.14.45.02; Tue, 25 Jul 2023 14:45:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=it21CKyA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229871AbjGYUom (ORCPT + 99 others); Tue, 25 Jul 2023 16:44:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231209AbjGYUoh (ORCPT ); Tue, 25 Jul 2023 16:44:37 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A6C22125; Tue, 25 Jul 2023 13:44:15 -0700 (PDT) Received: from notapiano (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 65EAE6606EEE; Tue, 25 Jul 2023 21:44:12 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1690317854; bh=l0QdiZLVFikXd6djh9oMfl+C2ChjeqPpqf7ac5R2fis=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=it21CKyA7WekFPItXvp7zTV3pDdq7MTw11C+d6Is0wunsHAzgQejIaLMW1dys51cx +OfSQ7YlmutsGoj53fpg/NrFVhxHMK34h8dJBprpBewiLkzYVFrv6FL44P9pehWXUq KoxEtTIKIkHDt3tmM0EjxGGmrDM8b0etKHAWFyHf3oGkbKQ9l9p4IruVoUCtDavvbm jPSTj2Yx2jLAbDstlibyw3qu+WxzlZfaw5oHtFeOZnQ63BAP1cB7zdy7PD5VoRIIOS SR16Wuo4/DxpM8rSzTNHgsZsewEfLoGqqDYAfNuaB4Wmnru+cRqQ43MTGyLOFFsHJj o8FxFs63Pw7UA== Date: Tue, 25 Jul 2023 16:44:08 -0400 From: =?utf-8?B?TsOtY29sYXMgRi4gUi4gQS4=?= Prado To: Hans Verkuil Cc: AngeloGioacchino Del Regno , kernel@collabora.com, Andrew-CT Chen , Mauro Carvalho Chehab , Tiffany Lin , Yunfei Dong , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger Subject: Re: [PATCH v5 5/7] media: mediatek: vcodec: Read HW active status from syscon Message-ID: References: <20230630151436.155586-1-nfraprado@collabora.com> <20230630151436.155586-6-nfraprado@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 25, 2023 at 12:15:03PM +0200, Hans Verkuil wrote: > Hi Nicolas, > > On 30/06/2023 17:14, N?colas F. R. A. Prado wrote: > > Remove the requirement of a VDEC_SYS reg iospace for both MT8173 and > > MT8183. To achieve that, rely on a vdecsys syscon to be passed through > > the DT, and use it to directly read the VDEC_HW_ACTIVE bit during IRQ > > handling to check whether the HW is active. Also update the VP8 stateful > > decoder to use the syscon, if present, for writes to VDEC_SYS. > > > > The old behavior is still present when reg-names aren't supplied, as > > to keep backward compatibility. > > > > Signed-off-by: N?colas F. R. A. Prado > > > > --- > > > > Changes in v5: > > - Added explicit linux/bitfield.h include for FIELD_GET(), following > > 0day report > > > > Changes in v4: > > - Added new helper and updated VP8 stateful decoder to use it, so the > > syscon can also be used by mt8173 > > - Made handling cleaner > > - Reworded commit > > > > Changes in v3: > > - Switched handling of VDEC_HW_ACTIVE to use a syscon instead of the > > 'active' clock > > - Reworded commit > > - Removed changes to subdev part of driver, since they aren't used by > > MT8183 > > > > .../mediatek/vcodec/mtk_vcodec_dec_drv.c | 77 ++++++++++++++++--- > > .../platform/mediatek/vcodec/mtk_vcodec_drv.h | 1 + > > .../mediatek/vcodec/mtk_vcodec_util.c | 15 ++++ > > .../mediatek/vcodec/mtk_vcodec_util.h | 2 + > > .../mediatek/vcodec/vdec/vdec_vp8_if.c | 10 +-- > > 5 files changed, 87 insertions(+), 18 deletions(-) > > This patch introduced this new smatch error: > > drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c:143 mtk_vcodec_get_reg_bases() error: buffer overflow 'mtk_dec_reg_names' 11 <= 11 > > I think it is due to: > > if (reg_num <= 0 || reg_num > NUM_MAX_VDEC_REG_BASE) { > > in mtk_vcodec_get_reg_bases(): the '>' should probably be '>='. > > Can you post a follow-up patch fixing this? Hi Hans, sorry about that, and thanks for noticing it. I've just sent the fix: https://lore.kernel.org/all/20230725204043.569799-1-nfraprado@collabora.com Thanks, N?colas