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=1796292658; b=aKDSEJUaoKgVkx5RBMbWBz98NRgTT4c11qgHFquUYLHy6dyQGBCB79gXNxzBDJe5Nbxr rSYDfFeGkqsWhQ8neH9O59O6diDdWydSXECL93JbM4PwLBCjnLdB8OjHNVqEU77/8iPCJ 4Z0kHKHvNkiT6FUMgSAfOc23nSfG847jdgE02IrwzXYTA73rYG9E0svjcGMrTm8mdHpDV wRgiNgX+fxjN7W9RKOaMJrKxmTH0WMRYe2Xwh4rf+Q1JVx36mFMy+jN4zhONsfrGz8wPK wxFLUFAvjKEObmk4I9yIGoss7D5dQTj4G0GqxdD+N+j0JTE499YRmS7YwjA0s6em7LA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796292658; 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=HGnKvnvIojduYcLe1jf8RTr6CA00Kha+LNGnING5vM9GGLPZA+urv+PrBnV/PbZkf+uH zGPOq2MpsLBupbLNMk4YDx74DmMWNkE/PLhLr4cVM/WIBQFfKpTrwZ31KDCnMJ6wNASzg KHVH0n692jSVb2fZYwD3+e6gRKu8gFT/owAGwRG2tuqkBwNZ7eM6a46PYpUlFvBPXt7NK v9CNisVpxEjMpgTKtXbUMoAgEg5cOBABsZE9LW0hEOeATjIrQTJwF/PRZXPxY4x6x70rW pDWTeye2VN+Oo0yZJKUOjYQZo0S77GvjfA/L/ez3S7LFrkxxzBwxNgEXzg7BwjDinRQ== 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) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB7E0606A332 for ; Thu, 3 Dec 2026 10:10:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EB7E0606A332 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 9AB5B1380373 for ; Thu, 3 Dec 2026 05:10:56 -0500 (EST) Received: from ams-imap-13 ([10.64.2.33]) by ams-compute-02.internal (MEProxy); Thu, 03 Dec 2026 05:10:56 -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=PGRldmljZXRyZWVAdmdlci5rZXJuZWwub3JnPg==; s=fm1:rsa-sha256:SM+pIqyrkRFYeVFNKyHQv/fCDsI9sXMCSFSHL8NOgeVCAUF V41ooNdRqxXS4/1MvZHBrqQq/d39q4zF/wJRS0UbtwrTj3C4dstX71p0WLbKbipo pNMO4HZEVlh4f1heRB0iCgHQOImw/lFYgzuj5zK0MoszuOkbPnFljiwR24AGPr0r 9C9hrDsuMnzxEhWMeINWfiK8H3uGrifcOias/kGpgM4tyhV4TxkN7GAmP7WWOPCP BtLP1/l04137XARmRaN00LzngqZChMr0Aaoqd845OUiaw9yqrpEhqhvsEAsnDtR4 FXFOALRcEi6+TAVVd5BvhmIlM5iz1AO3PpzZEWg==; 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: devicetree@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