From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CEA16CD5BAC for ; Thu, 21 May 2026 12:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rtuMtKxTvldVrMvwKt/08X/UgsXqDWcYvcyA0oc9IfY=; b=3HZO+LaDCw90c3Dwul/HrNrTNu AbglOCUupq/BCOlV/C/g2f0RgGyz9yko2xfFlnyTgcGa//CPA1F4A4RH+xBWrYCIfXzOmF2Zi7jR6 euMvFB7goditr5KmhiQmFB7eOT3WmRIFSH+zXl8CDFMatyTSWPEYIUo3r+Z9bbCpEU92b6xRm4+Li O3Lk8PXm6A/yWPbh2kxAD7DK2OsRhVGJ5uJZkAl7tsSXoRB8aQ7YoRzNA73kpL7oUSlR1rtkjOTiX 1ttshTH9JykrgQybPGUKZIbMJj+THHLK4iTTdzZxJDEDiBxlUvTwA6eEsdd5sz22uocicrik2OTix NnRl/jFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wQ2le-00000007l2x-1qFU; Thu, 21 May 2026 12:44:50 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wQ2la-00000007l1k-0JGQ for linux-arm-kernel@lists.infradead.org; Thu, 21 May 2026 12:44:47 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1wQ2lJ-0000Zz-Iy; Thu, 21 May 2026 14:44:29 +0200 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wQ2lH-0016dC-2c; Thu, 21 May 2026 14:44:28 +0200 Received: from mtr by pty.whiteo.stw.pengutronix.de with local (Exim 4.98.2) (envelope-from ) id 1wQ2lI-00000004VX3-121G; Thu, 21 May 2026 14:44:28 +0200 Date: Thu, 21 May 2026 14:44:28 +0200 From: Michael Tretter To: Sven =?utf-8?Q?P=C3=BCschel?= Cc: Jacob Chen , Ezequiel Garcia , Mauro Carvalho Chehab , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Hans Verkuil , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de, nicolas@ndufresne.ca, sebastian.reichel@collabora.com, p.zabel@pengutronix.de, Nicolas Dufresne Subject: Re: [PATCH v7 06/28] media: rockchip: rga: fix too small buffer size Message-ID: Mail-Followup-To: Michael Tretter , Sven =?utf-8?Q?P=C3=BCschel?= , Jacob Chen , Ezequiel Garcia , Mauro Carvalho Chehab , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Hans Verkuil , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kernel@pengutronix.de, nicolas@ndufresne.ca, sebastian.reichel@collabora.com, p.zabel@pengutronix.de, Nicolas Dufresne References: <20260521-spu-rga3-v7-0-3f33e8c7145f@pengutronix.de> <20260521-spu-rga3-v7-6-3f33e8c7145f@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260521-spu-rga3-v7-6-3f33e8c7145f@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: m.tretter@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260521_054446_112856_E548BA93 X-CRM114-Status: GOOD ( 21.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 21 May 2026 00:44:11 +0200, Sven Püschel wrote: > Fix the command buffer size being only a quarter of the actual size. > The RGA_CMDBUF_SIZE macro was potentially intended to specify the length > of the cmdbuf u32 array pointer. But as it's used to specify the size of > the allocation, which is counted in bytes. Therefore adjust the macro > size to bytes as it better matches the variable name and adjust it's > users accordingly. > > As the command buffer is relatively small, it probably didn't caused > an issue due to being smaller than a single page. > > Fixes: f7e7b48e6d79 ("[media] rockchip/rga: v4l2 m2m support") > Reviewed-by: Nicolas Dufresne > Signed-off-by: Sven Püschel > > --- > > Flagged by Sashiko: > https://sashiko.dev/#/patchset/20260325-spu-rga3-v4-0-e90ec1c61354%40pengutronix.de?part=10 > --- > drivers/media/platform/rockchip/rga/rga-hw.c | 2 +- > drivers/media/platform/rockchip/rga/rga-hw.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/rockchip/rga/rga-hw.c b/drivers/media/platform/rockchip/rga/rga-hw.c > index 43ed742a16492..d1618bb247501 100644 > --- a/drivers/media/platform/rockchip/rga/rga-hw.c > +++ b/drivers/media/platform/rockchip/rga/rga-hw.c > @@ -414,7 +414,7 @@ static void rga_cmd_set(struct rga_ctx *ctx, > { > struct rockchip_rga *rga = ctx->rga; > > - memset(rga->cmdbuf_virt, 0, RGA_CMDBUF_SIZE * 4); > + memset(rga->cmdbuf_virt, 0, RGA_CMDBUF_SIZE); Maybe use rga->hw->cmdbuf_size instead of RGA_CMDBUF_SIZE to really be in sync with the allocation. Anyway: Reviewed-by: Michael Tretter > > rga_cmd_set_src_addr(ctx, src->dma_desc_pa); > /* > diff --git a/drivers/media/platform/rockchip/rga/rga-hw.h b/drivers/media/platform/rockchip/rga/rga-hw.h > index cc6bd7f5b0300..2b8537a5fd0d7 100644 > --- a/drivers/media/platform/rockchip/rga/rga-hw.h > +++ b/drivers/media/platform/rockchip/rga/rga-hw.h > @@ -6,7 +6,7 @@ > #ifndef __RGA_HW_H__ > #define __RGA_HW_H__ > > -#define RGA_CMDBUF_SIZE 0x20 > +#define RGA_CMDBUF_SIZE 0x80 > > /* Hardware limits */ > #define MAX_WIDTH 8192 > > -- > 2.54.0 > >