Received: by 2002:ab2:5182:0:b0:1f4:61d5:3ad4 with SMTP id x2csp41461lqi; Fri, 5 Apr 2024 09:13:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRfVfjrTwVNhday0BDoBK7LPp/a6TaxIjGKYKul/DU+QwMhCUMCPXa51X99cAxFimGzNmSVYWtbyJMRFdbMICZS3ZFgfv96iALvmW/Og== X-Google-Smtp-Source: AGHT+IFMOuvfY6q9ud24Ycph28g7v6OIlfNy4rliSPJNZiNEs/vRWtXiLnyhR3y8HbgQaBLYIFeH X-Received: by 2002:a05:620a:3710:b0:78b:d153:2c69 with SMTP id de16-20020a05620a371000b0078bd1532c69mr2505187qkb.24.1712333632377; Fri, 05 Apr 2024 09:13:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712333632; cv=pass; d=google.com; s=arc-20160816; b=U28Ocgrapsvb2YPa6ux3fDQ8gkVbABgaFwdw2EP2ffzh1CX1ps79FGxgvzOxv9D3LJ 8BL2+pbulCh9ZXwSnU87fsl/o/EkxNX/zD2LUhCuWUCAwMPJjj9CaKc1gqVGVIgonPlL Od4InvJjMYYCI1dLT0toHqg2uwGs6jPjAFLMYqoY87eS43r0lGPIwueoxMPKGr1Xjpws ruQ75lLk5vazWmKeYzxB2k7+Z+aidohf5CIw+i8SZJxau0d8SHpCw/OlaXRd2xAwDgPj WpDbnDjVobkQavMnVXBQ7kt0Me+b0QDgiZx2IRfOMH7YmU8wR2Wxsq2mcrdqAqrUFZtO N9vA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5FuW79ExhVaYHqCiZlpo/Zq84Y3dUcBVOYo1OkPc05Y=; fh=6uTCXvLC0IXfuW0gC+9h1kWLE/9X2mJHnBq7NQtjSXk=; b=OdqcEWyKncAdBoe43tQaRrvsxxv2dSckDN0ywWow37R1ypySQ5XtIUVZD6AebBffHC uKE4fdnPD3/HhS3K8mil/qYJF4nmX7moSFnpQJuBWrQR2aKM4kv+ICn6FmtjLB2WSZ3f N3fdZ3TUh/+5wO7Q/ho/x1WN6XAl1nGSZauKCg++XHzxLI+QIIcaiIXjcIXAavXaq0YG bUVG6O7BlsaMD1H/RilufO4EpJESq/pqH8KdDCd59+RTv4QMbInnq21ekEDTC+het2ab bI5UXdvzh111Ugfl2RAq5c0/hlZ6csoOTFP101HgRZ4msu73xyB4EQ4nFhAzPPd7PlXN Xihw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SrsDaaZJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u29-20020a05620a085d00b0078a09c39c36si2027369qku.526.2024.04.05.09.13.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 09:13:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SrsDaaZJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 114651C20CBE for ; Fri, 5 Apr 2024 16:13:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BA58171083; Fri, 5 Apr 2024 16:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SrsDaaZJ" 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 224CF16FF58; Fri, 5 Apr 2024 16:13:42 +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=1712333623; cv=none; b=qjt6b/mQ//b6qx/XjDrPhhzLQzoCv+zKqajzGRcG9is7ZI/lSCz0vNjzHf80lDKvm546ncRlQ1SCaTr35moogsNJ5b12ZbyBz9Xgl0ySdPN0L9S3OXEA6DsDH9RjZ0oaJchSP8yb3t2RU6ypkGtq9IkfZvg/ZKkgEX2jrFFlLXg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712333623; c=relaxed/simple; bh=Q8DxPoGFwNt1vwUx+kL+4TrG1ntiPpirQuVvn+D6NKU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mGK9MBj9ADxY6ZN9IfsjTzaQZHpFq+Wc0lbghaQ6Z1fS4wP6/ZpGh4ec0HDifAAhaq6oK50hC+Xv1Rc8UIsHB5jsQay9UlLUWZKF1V1bi9dDQpqpHGfqhoQJBMmIfTlLNMN/VxN6sGlytwFyp0352bjRae8o9Am6QAiMHGyjwAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SrsDaaZJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDCE2C433F1; Fri, 5 Apr 2024 16:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712333622; bh=Q8DxPoGFwNt1vwUx+kL+4TrG1ntiPpirQuVvn+D6NKU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SrsDaaZJEZNam0u270Lqu6ITF3tmsHbfl5xJzBiMP+xzKqRg3dW9jJzcFcKtlTeuf /gwDGmvJJfEDAvIO0XBmb0KytS7+b/X3C9wPmxFqGEC3ddumLytl9WB1gewdhH+O1C X11MjfDn9ssOtSnJXJF4G3ysSkWpqBEIHH6VCRWXr/qVbQmYFTqbYYp1iYGAW4EEml ffaZdaGxwhRAZ7i3eiY1ArIdlfsmCZOES1t8uQifZbRKvsRClf4qLKK3ivwhFYQn/Q t/ZsB8JXwcSbDWZuUB1Wua9pSKwuayucxVll6yPrdUTZGdVQdzWuR3qfdLtWOJtCR3 PgS/O2g3G1BtA== Date: Fri, 5 Apr 2024 17:13:37 +0100 From: Conor Dooley To: Jason-JH Lin =?utf-8?B?KOael+edv+elpSk=?= Cc: "linux-kernel@vger.kernel.org" , "linux-mediatek@lists.infradead.org" , Houlong Wei =?utf-8?B?KOmtj+WOmum+mSk=?= , "devicetree@vger.kernel.org" , Shawn Sung =?utf-8?B?KOWui+WtneismSk=?= , CK Hu =?utf-8?B?KOiDoeS/iuWFiSk=?= , "conor+dt@kernel.org" , "robh@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "krzysztof.kozlowski+dt@linaro.org" , "matthias.bgg@gmail.com" , "jassisinghbrar@gmail.com" , "angelogioacchino.delregno@collabora.com" Subject: Re: [PATCH v5 02/10] dt-bindings: mailbox: Add mboxes property for CMDQ secure driver Message-ID: <20240405-remindful-galley-2dee9eec4f34@spud> References: <20240403102602.32155-1-shawn.sung@mediatek.com> <20240403102602.32155-3-shawn.sung@mediatek.com> <20240403-conflict-detest-717b4175a00c@spud> <9b9707a4a0e285a12741fe4140680ad2578d8d2b.camel@mediatek.com> <20240404-lankiness-devouring-d4d012b22cb9@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Q/1d7/5euK6JVvYU" Content-Disposition: inline In-Reply-To: --Q/1d7/5euK6JVvYU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 05, 2024 at 02:33:14PM +0000, Jason-JH Lin (=E6=9E=97=E7=9D=BF= =E7=A5=A5) wrote: > On Thu, 2024-04-04 at 15:52 +0100, Conor Dooley wrote: > > On Thu, Apr 04, 2024 at 04:31:06AM +0000, Jason-JH Lin (=E6=9E=97=E7=9D= =BF=E7=A5=A5) wrote: > > > Hi Conor, > > >=20 > > > Thanks for the reviews. > > >=20 > > > On Wed, 2024-04-03 at 16:46 +0100, Conor Dooley wrote: > > > > On Wed, Apr 03, 2024 at 06:25:54PM +0800, Shawn Sung wrote: > > > > > From: "Jason-JH.Lin" > > > > >=20 > > > > > Add mboxes to define a GCE loopping thread as a secure irq > > > > > handler. > > > > > This property is only required if CMDQ secure driver is > > > > > supported. > > > > >=20 > > > > > Signed-off-by: Jason-JH.Lin > > > > > Signed-off-by: Hsiao Chien Sung > > > > > --- > > > > > .../bindings/mailbox/mediatek,gce-mailbox.yaml | 10 > > > > > ++++++++++ > > > > > 1 file changed, 10 insertions(+) > > > > >=20 > > > > > diff --git > > > > > a/Documentation/devicetree/bindings/mailbox/mediatek,gce- > > > > > mailbox.yaml > > > > > b/Documentation/devicetree/bindings/mailbox/mediatek,gce- > > > > > mailbox.yaml > > > > > index cef9d76013985..c0d80cc770899 100644 > > > > > --- a/Documentation/devicetree/bindings/mailbox/mediatek,gce- > > > > > mailbox.yaml > > > > > +++ b/Documentation/devicetree/bindings/mailbox/mediatek,gce- > > > > > mailbox.yaml > > > > > @@ -49,6 +49,16 @@ properties: > > > > > items: > > > > > - const: gce > > > > > =20 > > > > > + mediatek,gce-events: > > > > > + description: > > > > > + The event id which is mapping to the specific hardware > > > > > event > > > > > signal > > > > > + to gce. The event id is defined in the gce header > > > > > + include/dt-bindings/gce/-gce.h of each chips. > > > >=20 > > > > Missing any info here about when this should be used, hint - you > > > > have > > > > it > > > > in the commit message. > > > >=20 > > > > > + $ref: /schemas/types.yaml#/definitions/uint32-arrayi > > > >=20 > > > > Why is the ID used by the CMDQ service not fixed for each SoC? > > > >=20 > > >=20 > > > I forgot to sync with Shawn about this: > > > https://lore.kernel.org/all/20240124011459.12204-1-jason- > > > jh.lin@mediatek.com > > >=20 > > > I'll fix it at the next version. > >=20 > > When I say "fixed" I don't mean "this is wrong, please fix it", I > > mean > > "why is the value not static for a particular SoC". This needs to be > > explained in the patch (and the description for the event here needs > > to > > explain what the gce-mailbox is reserving an event for). > >=20 > Oh, I see. Thanks for noticing me. >=20 > We do want to reserve a static event ID for gce-mailbox to different > SoCs. There are 2 mainly reasons to why we set it in DTS: > 1. There are 1024 events IDs for GCE to use to execute instructions in > the specific event happened. These events could be signaled by HW or SW > and their value would be different in different SoC because of HW event > IDs distribution range from 0 to 1023. > If we set a static event ID: 855 for mt8188, it might be conflict the > event ID original set in mt8195. That's not a problem, we have compatibles for this purpose. > 2. If we defined the event ID in DTS, we might know how many SW or HW > event IDs are used. > If someone wants to use a new event ID for a new feature, they could > find out the used event IDs in DTS easily and avoid the event ID > conflicting. Are the event IDs not documented in the reference manual for the SoC in question? Or in documentation for the secure world for these devices? A DTS should not be the authoritive source for this information for developers. Additionally, the driver could very easily detect if someone does happen to put in the reserved ID. That could be generically useful (IOW, check all of them for re-use) if the ID are to not allowed to be shared. > The reason why we define a event ID is we want to get a SW signal from > secure world. We design a GCE looping thread in gce-mailbox driver to > wait for the GCE execute done event for each cmdq secure packets from > secure world. This sort of information needs to be in the commit message, but I don't think this property is needed at all since it seems to be something detectable from the compatible. --Q/1d7/5euK6JVvYU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZhAjMQAKCRB4tDGHoIJi 0g9NAPsHTqr3FpCqnixCtTXtxW69Xrc2gEnNIQPw1BJYSwFYigD/dCkJ0WhN+ox9 Bo19dT70y5DIOhKbgSd1tK3mieXUxgo= =/DXl -----END PGP SIGNATURE----- --Q/1d7/5euK6JVvYU--