Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp304187rdb; Mon, 22 Jan 2024 23:10:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IG60sMTHynpMU9kWpyyhcYlQ5KbT72zTSsgIwoHVZoZ8f91VX9sQtDGbf2wd3/l82waVvRs X-Received: by 2002:ac2:5201:0:b0:50e:b384:3d11 with SMTP id a1-20020ac25201000000b0050eb3843d11mr2041069lfl.104.1705993836964; Mon, 22 Jan 2024 23:10:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705993836; cv=pass; d=google.com; s=arc-20160816; b=vEjt2MtWkRJUxV9gu0PbXriW3YeEuXxD0wECdNDuaSCLJXT9XpvJNsYmiT2utIqSQ7 pg0+B4VwgsH4se1gw+mHTlkf8YTCSxqtGHIK7SmCRIvgzbv3q0sGwjH5p8hrAXKbXFvU spzI4Arog9AN4DtwkjLCaKbE7cMrfUW6zdTAEU0zd/QIquWAmFl7kjkJ6Yiy6E2CE/Gm NonMDXuyGRqI53RVsN5ZAikS3pX8j8X20yaxwzf258dsLhmq7FThDlPibb1Bp3icGj2g W0G8MMtr9n0XH2If077donSsGfsHb5iFa49eQsE+6y4I2LiFayugDTWF6+7goxvNchNk waKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=iph8BTYF/kWobFY9sfWTkoVzKyeEvD0PJuuhdpyGKcE=; fh=AbKq8jievKtT1LJw5l/iKePlinte7AtlREzE+bQ+IWs=; b=ag98ttvEBUBVKPz0M82ZFZT/IFqP8GzyLzfzgRmQcZrGIEbb9RyaHfgB8r9nXXME+N jNWJJ2FXNzkHSOMiIQZ8fVpsAn5K64yZsh7JwtT+1HmLs1HTgMa5/683XiVgajI66qml UvQ7IlLa2hPnVxBU+YwOUN8BloB3OVecdKCQAQ8V3cdrm1T3Cu4YV1IYZYa75HMhCwpI BehTUsDXirp7+0mbGNqEr6/D4pu+FD+qSgbpuWHotpDuF3sXCtPSfN6IP+bgIq+76NHW kZC4v1Fc/GzJw4thZ2Pkrln31BYVHvHtR4ZzdJR0EnTNLFcyldknO3728h0wake00IQq wQfg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-34813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34813-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y1-20020a17090668c100b00a2c176a9b0dsi11626383ejr.134.2024.01.22.23.10.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 23:10:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-34813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34813-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id B177A1F25299 for ; Tue, 23 Jan 2024 07:10:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B30D5524DA; Tue, 23 Jan 2024 07:10:20 +0000 (UTC) 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 C0C5651C2A for ; Tue, 23 Jan 2024 07:10:17 +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=1705993820; cv=none; b=Mc4I08+yB8hzdNHpD/lJfXCrG8i5II9SkP9nzxTUQbCYVpmGem938NIkw6ndbatRvFdfnhFAI2Jf/bRxFTRbsGeZJUD5ypOUID6afJJ0XLctjqZt0A1E02iTvHB2UcqSP4kAauZDTqnfKnkDvEB6sLtaj/MU4QzHh01OqpEkU1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705993820; c=relaxed/simple; bh=32ZqCuQ4/QKleRINyVHRGBKT/W3OXQ6ZsS8lsWSJXP0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sau/driIhg4rxOlsYRGj02QPeSHb5Oi1a1EaM7YWMCFo0pwpDj1+V4C554x7mcS665X8k5B/IVLX1H/O/lf2bqxEc4sqCTC6lcBcum8YQUaYIRcsq3qFPr+X0XCapX/AJuknkmdU7Sxodt/qAkgAl6eUB970GgfMXN1w4OSQUwE= 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 esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rSAuv-0001zL-2o; Tue, 23 Jan 2024 08:09:53 +0100 Received: from [2a0a:edc0:2:b01:1d::c0] (helo=ptx.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSAut-001mCz-VU; Tue, 23 Jan 2024 08:09:51 +0100 Received: from sha by ptx.whiteo.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1rSAut-001KLj-SN; Tue, 23 Jan 2024 08:09:51 +0100 Date: Tue, 23 Jan 2024 08:09:51 +0100 From: Sascha Hauer To: Peng Fan Cc: "Peng Fan (OSS)" , Jassi Brar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Aisheng Dong , Shawn Guo , Pengutronix Kernel Team , Fabio Estevam , dl-linux-imx , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v2 2/3] mailbox: imx: get RR/TR registers num from Parameter register Message-ID: <20240123070951.GA93665@pengutronix.de> References: <20240122-imx-mailbox-v2-0-7b3c80333b92@nxp.com> <20240122-imx-mailbox-v2-2-7b3c80333b92@nxp.com> <20240122090330.GR4700@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Tue, Jan 23, 2024 at 01:42:03AM +0000, Peng Fan wrote: > Hi Sascha, > > > Subject: Re: [PATCH v2 2/3] mailbox: imx: get RR/TR registers num from > > Parameter register > > > > Hi Peng, > > [snip] > > > > > }; > > > > > > enum imx_mu_type { > > > @@ -264,18 +267,17 @@ static int imx_mu_generic_rxdb(struct > > > imx_mu_priv *priv, static int imx_mu_specific_tx(struct imx_mu_priv > > > *priv, struct imx_mu_con_priv *cp, void *data) { > > > u32 *arg = data; > > > + u32 num_tr = priv->num_tr; > > > int i, ret; > > > u32 xsr; > > > - u32 size, max_size, num_tr; > > > + u32 size, max_size; > > > > > > if (priv->dcfg->type & IMX_MU_V2_S4) { > > > size = ((struct imx_s4_rpc_msg_max *)data)->hdr.size; > > > max_size = sizeof(struct imx_s4_rpc_msg_max); > > > - num_tr = 8; > > > > This change looks unexpected here. num_tr used to be 8 here and now > > becomes 4 at maximum. Was this a bug? If yes, this deserves a separate > > patch with an explanation what was wrong here. > > Sorry, I could not follow you here. > The num_tr is switch to use priv->num_tr now. It is not changed to 4 at > maximum, it is just use priv->num_tr to avoid hardcoding it to 8. > As of now, all platforms has IMX_MU_V2_S4 are using 8, and > the hardware register num is 8, except i.MX95 V2X MU using 4. I was confused by the warning you introduced: > > > + if (priv->num_rr > 4 || priv->num_tr > 4) { > > > + WARN_ONCE(true, "%s not support TR/RR larger than 4\n", > > __func__); > > > + return; > > > + } It will trigger when priv->num_tr is read as 8, so I assumed it is 4 at maximum. Indeed just the check is wrong and you might haven't notice the warning during testing. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |