From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.137 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796292659; b=sqfIp5BpkBo7+JSTtcIWxpclAjxKuIF228yqCfdXeUXeR4UiZhCp50WYZ+ZEgMc2BhIE j7qMHR2Q/UIPtXfJ5i21331Cpq2MGiKZXO1oQBY+QCtUr1bn60WKzlHkwMKtSxrrF+V/s ASs5Ga8rZMR+r+LODIGlESiWFNTA2UKJFQJJx2IYvaKRqGXDTCgJ8awqFEqOAR7l1bb0R z4cfx4CZYnKo0yqbkNs9abFnjIaJzwNMWSXcgImAvvfNfRp+F7rRWfa60TTD0isqIHQaJ WxYnRsond9cJL7SaqUkSEmuw4htdcI8E4tniGg2OlAdxn6JtVFUTIifwQWIXAEyZZ1Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796292659; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer: MIME-Version:X-ThreadId:Date:From:To:Cc:Message-Id:In-Reply-To: References:Subject:Content-Type:Content-Transfer-Encoding; bh=7rm2iUd3grzJRjb5DczauqhHqGckhshPlZzLdCxcgXo=; b=IDGC3DB60i8QA7uy69aXZU+7QaxuQm5Qf++XQyFK2bxjpbbVrtWyqW+df4/+UCn/ODr/ hDAnTVh6eD8dV0rSGAZi2feYL1q4ZsL+CPp9xTMRCP7JA8WPNJ/7lwe6b+RnLKT4i597o TxnUQAx8JdVd4YW8oHo4Nusbz3zNJSFG8ngviXi2S1JmuQX5YbsVMu6B1dscEFMytwrJJ LmvdHUx9JH0GT09hN5ik7wkM6MHMc8igmA/S6J8TihV58epWUtlWJeZqH4Urzwt0vzT8e iQRDzdbiqS/57I/gCMtxrlwN4rz12Cfmv2AGtKni9yEbUAB6HoBinnjRo4bemtNxrcA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=glider.be; spf=pass smtp.mailfrom=glider.be; dkim=pass header.d=glider.be header.i=@glider.be header.a=rsa-sha256 header.s=fm1 header.b="JnZYwq/7"; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=RvUq4R5X; arc=none smtp.remote-ip=103.168.172.137 Received: from flow-a2-smtp.messagingengine.com (flow-a2-smtp.messagingengine.com [103.168.172.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE399606A339 for ; Thu, 3 Dec 2026 10:10:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DE399606A339 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=glider.be Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=glider.be header.i=@glider.be header.a=rsa-sha256 header.s=fm1 header.b=JnZYwq/7; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=RvUq4R5X Received: from ams-compute-02.internal (ams-compute-02.internal [10.64.2.62]) by mailflow.phl.internal (Postfix) with ESMTP id 092121380365 for ; Thu, 3 Dec 2026 05:10:57 -0500 (EST) Received: from ams-imap-13 ([10.64.2.33]) by ams-compute-02.internal (MEProxy); Thu, 03 Dec 2026 05:10:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=glider.be; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1796292648; x=1796296248; bh=7rm2iUd3grzJRjb5DczauqhHqGckhshPlZzLdCxcgXo=; b= JnZYwq/7mmLWv80UF/mggOiatWzFWz2OZJv4JN90T0b9kTig3ZKrMund/e7xIfw0 /dslxUoROkJP6sg0hd5VyPE4Dy729+tJ/2epo6b2qjvVnHe9B+k688Y9QPBERKOf mzlPtv39P/4e6lUSoMeFfiGhR2zuO4jaumgbva8PX73JcEUfJYS1WK3MuWihNxde yURQJKll1ATbPZ3Aqrxvh0ChgKKfwwzltTzVWQ9eSjG0qSrRibCiIDVzC//ElkQG dTePUofJrWV4+9o5GmTMdzqojkMZ2sF8QqlYG1zxJJWNE2G1mFY1xtqapvIR9ARK brLj3FEeSfLnYjMyZ6sk/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1796292648; x= 1796296248; bh=7rm2iUd3grzJRjb5DczauqhHqGckhshPlZzLdCxcgXo=; b=R vUq4R5XSloxPhQaqKS+hkb2WR0pjO0JXuvNwlb2lu8ovgEj+HNgtku8eZHljGId9 APyuLVQ5x/H4VyzV5EHUwrkpF+sQy35mC4bYElD1ul1zRoML6ARo/dGrVkvbQljF AwPhtzPoK8E4pjlItI0SK3uqnvDm9oX8qckeBNGzsc2e2NU1HD7U6zUS7Gyz7ZGC IthRl3VsoWyQEWLjCsi9Eiot8G9YFIEekNQOVuTs4/1aRNIAYjxnoQH/o1SIcyYo xsKzTIrMCdGjQoaPQw54Tt5oZbPtDaOYyQ5uCbvXebocFqqsOtuhtiVJIeisQ7An gs6rMCzsSgILr7/0bAa6w== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=glider.be a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796292648; d=glider.be; mf=PGdlZXJ0K3JlbmVzYXNAZ2xpZGVyLmJlPg==; rt=PGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc+; s=fm1:rsa-sha256:LKFMmCZIg6RSY1Foeqfk8nSx2V7ep1BAUri5IQRXBgqEyJV vdP0j4vbytlK2DexwmYZ+k0v9FtChow45FRjaz2pyTkSdC2CwJt5KCmNakEP559Y xToI/nUWMzzrBt4OFp6PWHOtcqnSOQ7j/HPfEHgERTHWaArs/oNPPOItEKcGmZYf SAwXKMZP2lEPkLmKp4pWeu71XzfenslQOoudTytT+9knBstFIajSbeYALgNjaKOd cWJwgSgVdk/NTUKmm3apSuYhOnUIgz3QitOeF4sLImpGtKpYZgEjUVSeYfO2Ixn6 8xOPnl5XOSgOu7NiI0ekmTQRQtjOIR6f9pznH5Q==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-transfer-encoding,content-type,date,feedback-id, from,in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:S0tlcR/+RKToHqfQ0IQrLQvxFGYK9uO0Mfx8OFY+k+U=:NBUdfJMeZsyA3+BKi4LT+FcioEKNwR4iOvG5PECPxmM=; X-ME-Sender: X-ME-Proxy-Cause: dmFkZTGiZYoR1OQATK5BZ0C5CAabVnyFZo1UEqaP5UMwhq2BaIGnSYLDCCShplsaoEfxvy nNEFh9mlGHs2m65w/QK9PgZv3cmG2dL+IERAf/F9/x4Xg4+Cm9Vj5xqlvjjvssUghvE46J 4nrFzqwYEjgNZmxWmr0hf8cVDAqR5BBwYQfGzGi+oBSt6drBj/JspTiRLKV+QB0rmdmjBr /w74gGPbK5m9ez2RfnYlMTz0JUkS9m/iXl+qIq6EUsbQSvDUklG3138kLuyk8Gcag0+I0a R77HK0uiCkMayoNfxQPWcfw9z0DJQlFu8zC5jHViDh7eBHL9eFMEqvhLjNsfSUEvQgEINK v9WDpqm74Di72Y9UiOwvbB7FW+cIW8EKEva9yACiViy1s74DfZIJK53VLrNviKZ97it4ar t3HKspNU6Z6925BfXgayXwt77LoAkzGCJHOee/zQTvyB5eU7wNw/f8S4Uma2uHhDvv2jqZ Skw30x1yKhXiSqPICi4EUJW0vscpUhR6QMq4I1cw4paYDBtNMY9SbowJHD4H9hdHc51ebi MiZTK4wtXFaRyNtiCPd1NJkjdmUBPsiszQHIQfTeqP8R0kOY1skFbp54yWX/8yR7VRuOAk B74Gv8abc3FEmT2adSDndsMjxxdU3fAnOpgQVMdSPfuk0WunmVKBk7O8nHag X-ME-Proxy: Feedback-ID: ia0f84a9e:Fastmail Received: by mailuser.ams.internal (Postfix, from userid 501) id C281BF800A1; Thu, 3 Dec 2026 05:10:41 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-ThreadId: A0rh6Rf3VJ9w Date: Thu, 03 Dec 2026 11:10:21 +0100 From: "Geert Uytterhoeven" To: "Diogo Ivo" Cc: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, "claudiu beznea" , "Wolfram Sang" , "Tommaso Merciai" , "Alexandre Belloni" , "Frank Li" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Magnus Damm" , "Stephen Boyd" , "Brian Masney" , "Jerome Brunet" , "Linus Walleij" Message-Id: <91df9c96-b023-4717-a476-e500034ec9ea@app.fastmail.com> In-Reply-To: <5689301f-f7b0-43ce-9555-22faa7af965d@renesas.com> References: <20261026-divo-ssgrlpcsrc-2966-i3c-v2-0-2e76b87209bb@renesas.com> <20261026-divo-ssgrlpcsrc-2966-i3c-v2-5-2e76b87209bb@renesas.com> <121cc552-86b6-40de-ba9d-0ae40f8a1ed2@tuxon.dev> <5689301f-f7b0-43ce-9555-22faa7af965d@renesas.com> Subject: Re: [PATCH v2 5/7] pinctrl: renesas: rzg2l: Split SoC-specific masks in struct rzg2l_register_masks Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Diogo, Thanks for your patch! On Fri, Nov 27, 2026, at 15:03, Diogo Ivo wrote: > On 11/27/2026 10:16 AM, claudiu beznea wrote: >> On 10/26/26 13:35, Diogo Ivo wrote: >>> struct rzg2l_register_masks declares the masks of the OTHER_POC regi= ster >>> of RZ/G3L and of the I3C_SET_POC register of RZ/G3S in two branches = of an >>> anonymous union. As both branches share the same storage, initializi= ng=20 >>> both >>> other_poc_pvdd1833_oth_awo_poc and i3c_set_poc on RZ/G3L would have = the >>> designated initializers override each other, ending up with the=20 >>> I3C_SET_POC >>> value in the PVDD1833_OTH_AWO_POC mask. >>> >>> Split the union into a common area, for masks shared by multiple SoC= s,=20 >>> and >>> per-SoC areas: the RZ/G3S and RZ/G3L I3C_SET_POC mask moves to the c= ommon >>> area, and the RZ/G3L OTHER_POC masks stay in a dedicated RZ/G3L area= .=20 >>> This >>> way every mask gets its own member, >>=20 >> > and new SoCs can be described by> adding their own struct >>> (possibly inside a union). >>=20 >> That may be missed by the next person adding it... > > Ack, that is a good point. I will add it to v2 if Geert is ok with thi= s=20 > approach. > >>> >>> The existing RZ/G3S data only initializes i3c_set_poc, so it is not >>> affected by this change. >>> >>> Signed-off-by: Diogo Ivo >>> --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c >>> +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c >>> @@ -278,18 +278,14 @@ struct rzg2l_register_offsets { >>> =C2=A0=C2=A0 * @i3c_set_poc: I3C_SET_POC mask >>> =C2=A0=C2=A0 */ >>> =C2=A0 struct rzg2l_register_masks { >>> -=C2=A0=C2=A0=C2=A0 union { >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* RZ/G3L masks */ >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct { >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = u8 other_poc_pvdd1833_oth_awo_poc; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = u8 other_poc_pvdd1833_oth_iso_poc; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = u8 other_poc_wdtovf_n_poc; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }; >>> - >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* RZ/G3S masks */ >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct { >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = u8 i3c_set_poc; >>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }; >>> +=C2=A0=C2=A0=C2=A0 /* Masks common to multiple SoCs */ >>> +=C2=A0=C2=A0=C2=A0 u8 i3c_set_poc; /* RZ/G3S, RZ/G3L */ >>=20 >> I would drop the names of the SoCs close to the i3c_set_poc. That hav= e=20 >> the opportunity to grow over time. As Geert considers better. > > Ok, I will wait for feedback here then but I am ok with dropping the S= oC=20 > names. Agreed. >>> + >>> +=C2=A0=C2=A0=C2=A0 /* RZ/G3L masks */ >>> +=C2=A0=C2=A0=C2=A0 struct { >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 u8 other_poc_pvdd1833_ot= h_awo_poc; >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 u8 other_poc_pvdd1833_ot= h_iso_poc; >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 u8 other_poc_wdtovf_n_po= c; >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }; >>=20 >> OK, we can drop the union but the next SoC addition may be: >>=20 >> /* New SoC masks */ >> struct { >> =C2=A0=C2=A0=C2=A0=C2=A0u8 x; >> =C2=A0=C2=A0=C2=A0=C2=A0u8 y; >> }; >>=20 >> If we want to keep the initial form we may need to pay attention. >>=20 >> Patch is OK for me, just with the mention that we need to pay attenti= on=20 >> if we want to keep, for the future, the approach before this patch. > > Ok, then if Geert is ok with removing the union for now and possibly=20 > reviving it later I will state this clearly in the commit message. All of this looks rather fragile and suboptimal to me. The union avoids wasting space. However, as soon as a member is needed on more than one SoC, you have to move it to the common area, and it starts wasting space again for all the SoCs that don't need it. Of course that is just about the data: you are still wasting space for the code that handles data you don't need. As the waste of data is only a few bytes per SoC, does it matter that much? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m= 68k.org In personal conversations with technical people, I call myself a hacker.= But when I'm talking to journalists I just say "programmer" or something lik= e that. -- Linus Tor= valds