From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 D1C0D3FD14C for ; Thu, 21 May 2026 12:44:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779367499; cv=none; b=O7T/EY6oLXOZJjnjR2iTI5UygO2O2OXTEnwpG7F/uuH3TYB/EpGTIinyf9Ef9Gh1kynxDVqCUmhEMlqG2vF8eHP8JJEEJvOaUond96/l/c3pg2amOgNEY2Ffqr34gPSb0GMnekTdu3rI47rUOhaE7lzUu889W/ed3uuNy3PxaY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779367499; c=relaxed/simple; bh=ov7JLvS1G5cn82ppFLalJ5lDsVjdGH/kFEJR2a9m+ro=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OjT76+24HfKcE6X0WOzRORflM6LNuhXLeEHQuwRILr+i4JvywQRo3B23r9j+CjEZVzENaU+O2WYauYYOEVMh9L9BavVRUkkVS+ThQTpJYo5vpCO61euu7y9vWfyG88hur9EYSf/7mm5Fp7URqVd8jGjb5q1jJZDxzGbMmurPx0Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: devicetree@vger.kernel.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 > >