From mboxrd@z Thu Jan 1 00:00:00 1970 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 350F4EEA8; Sun, 17 Aug 2025 07:41:29 +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=1755416490; cv=none; b=FeEGTJo4EHZVPmCYDxWarVyApCFNXCiGzq4SoQt7vEUL+wdotzdWy++3dQu/VZ+Jr54JMK2690lpk8WZhcN+lEPaxGaq9/ostsaWiaACB1divwU4fqJgfcsDbC4lkl3Uv1gR/lXSR6ftiR31QvvgBHzMmX/75qtL7YfEF7fBhEU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755416490; c=relaxed/simple; bh=ZgDLxmEnnxsb+eXkicpW9/APIJQWDK7vOOfuyjgVd3s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dVhw/0rvX4chIQB3oFDDlWdY6N4DBAT6JRTMBu1FvFk0GJSVPQOps2lW0ErUHiXs3PhcYZZ1zJcwrgbYBmSUgt4RwkOj5tu1rEIJBMpI5sEDDIqgGXI1kRJheSIqbxCjzskCWv2X2OZSpTu71HbiDgQ6SYcqDqSw/xKTfbi3qsA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZGinFA0y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZGinFA0y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2271CC4CEEB; Sun, 17 Aug 2025 07:41:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755416489; bh=ZgDLxmEnnxsb+eXkicpW9/APIJQWDK7vOOfuyjgVd3s=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ZGinFA0yLKubQM5H6PoAN4KxfrWUPXjnRYF39jYxJ5WWI1x3m0NBExwCicrERkhGr TLYNhT0frrXlGVUY70Caa2j5pu8BRk+b/fMt7WlV3P4pVWETg+AQTkLwSr9IcE9dgK yRFAR3KlmtxKup1Mt0EqN8ZNcwX3Cw/H9Asl0ukp5oS+i3PmeFkpR7Ry4hLHYpvLJd AUpSHkaMa2sb3Aa+qlFOrwj9CZU3M8vTXzfMJIJ3qPPkg8KWzDlV+oyUgdCAV2x60F 9I71bcBL3bM5m040W7HtIfONtl5k1B7n3A9o1HMMix9P5WARK7mXPi+QL/O3Ri2xw5 NH2NgzeCe77Vw== Message-ID: <3ff4b3f9-cc8d-4044-b2eb-33010d8951c0@kernel.org> Date: Sun, 17 Aug 2025 09:41:24 +0200 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/7] dt-bindings: Add support for export-symbols node To: Ayush Singh , Herve Codina , David Gibson , Rob Herring Cc: Andrew Davis , Geert Uytterhoeven , Krzysztof Kozlowski , Conor Dooley , Arnd Bergmann , Greg Kroah-Hartman , Saravana Kannan , devicetree@vger.kernel.org, devicetree-compiler@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli , Thomas Petazzoni References: <20250430125154.195498-1-herve.codina@bootlin.com> <20250430125154.195498-2-herve.codina@bootlin.com> <0770a47e-fd2f-4b6f-9a9a-b0d539ace30c@kernel.org> <20250528185740.4bf91bef@bootlin.com> <49e1e1fc-412d-4334-8337-16e352a34788@kernel.org> <20250618113232.6d237208@bootlin.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@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Kmvl3VBHIsBv0oDcsQWXqY+NaFahT0lRPjYtrTa1v3tem/ JoFzZ4B0p27K+qQCF2R96hVvuEyjzBmdq2esyE6zIqftdo4MOJho8uctOiWbwNNq2U9pPWmu 4vXVFBYIGmpyNPYzRm0QPwARAQABwsF8BBgBCgAmAhsMFiEEm9B+DgxR+NWWd7dUG5NDfTtB YpsFAmgXUF8FCRaWWyoACgkQG5NDfTtBYptO0w//dlXJs5/42hAXKsk+PDg3wyEFb4NpyA1v qmx7SfAzk9Hf6lWwU1O6AbqNMbh6PjEwadKUk1m04S7EjdQLsj/MBSgoQtCT3MDmWUUtHZd5 RYIPnPq3WVB47GtuO6/u375tsxhtf7vt95QSYJwCB+ZUgo4T+FV4hquZ4AsRkbgavtIzQisg Dgv76tnEv3YHV8Jn9mi/Bu0FURF+5kpdMfgo1sq6RXNQ//TVf8yFgRtTUdXxW/qHjlYURrm2 H4kutobVEIxiyu6m05q3e9eZB/TaMMNVORx+1kM3j7f0rwtEYUFzY1ygQfpcMDPl7pRYoJjB dSsm0ZuzDaCwaxg2t8hqQJBzJCezTOIkjHUsWAK+tEbU4Z4SnNpCyM3fBqsgYdJxjyC/tWVT AQ18NRLtPw7tK1rdcwCl0GFQHwSwk5pDpz1NH40e6lU+NcXSeiqkDDRkHlftKPV/dV+lQXiu jWt87ecuHlpL3uuQ0ZZNWqHgZoQLXoqC2ZV5KrtKWb/jyiFX/sxSrodALf0zf+tfHv0FZWT2 zHjUqd0t4njD/UOsuIMOQn4Ig0SdivYPfZukb5cdasKJukG1NOpbW7yRNivaCnfZz6dTawXw XRIV/KDsHQiyVxKvN73bThKhONkcX2LWuD928tAR6XMM2G5ovxLe09vuOzzfTWQDsm++9UKF a/A= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 18/06/2025 11:54, Ayush Singh wrote: > > On 6/18/25 15:02, Herve Codina wrote: >> Hi Krzysztof, >> >> On Wed, 4 Jun 2025 20:35:51 +0200 >> Krzysztof Kozlowski wrote: >> >> ... >> >>>> Symbols are exported only when an overlay is applied on the node where the >>>> export-symbols node is available. Those symbols are visible only from the >>>> overlay applied. Symbols exported thanks to export-symbols are not global >>>> to the all device-tree (it is not __symbols__) but local to a node. >>>> >>>> If an overlay is applied at connector1 node, it can use the 'connector' >>>> symbols and thanks to export-symbols, the 'connector' symbol will be >>>> resolved to foo_connector. >>>> >>>> If the overlay is applied at connector2 node, the 'connector' symbol is then >>>> resolved to bar_connector. >>> OK, this explains a lot. Unless I missed it, would be nice to include it >>> in binding description. >> Sure, I will add something in the next iteration. >> >> ... >> >>>>>> +patternProperties: >>>>>> + "^[a-zA-Z_]?[a-zA-Z0-9_]*$": >>>>> This messes up with coding style which I would prefer keep intact. >>>>> Basically these properties will be using label style. >>>> Yes, those properties remap phandles. >>>> >>>> Their names are the name of the label used from the overlay and their >>>> values are the phandle mapped. >>>> >>>> You already have this kind properties using label style in __symbols__, >>>> __fixups__, __local_fixups__ nodes. >>> I have them in DTB, but I don't have these in DTS. The exported-symbols >>> would be in the DTS and that is what coding style is about. >>> >> I think export-symbols has to be in DTS. >> Maybe it could be described in an other way in order to avoid the coding style >> issue you reported. >> >> Hardware: >> i2c0 from SoC --------- connector 1, I2C A signals >> i2c1 from SoC --------- connector 1, I2C B signals >> >> connector1 { >> export-symbols { >> i2c_a = <&i2c0>; >> i2c_b = <&i2c1>; >> }; >> }; >> >> In order to avoid the coding style issue, this could be replace >> with: >> connector1 { >> export-symbols { >> symbol-names = "i2c_a", "i2c_b"; >> symbols = <&i2c0>, <&i2c1>; >> }; >> }; >> >> Krzysztof, Rob, do you think this could be accepted ? >> >> Ayush, David, do you thing this could be easily implemented in fdtoverlay ? >> >> Best regards, >> Hervé >> > > Well, it is possible. > > However, on connectors like pb2 header, there will be 50-100 export > symbols. So it will start becoming difficult to maintain. And the first syntax solves this how? I don't see the practical difference. > > Additionally, the further away we move from __symbols__ style, the more > difficult the implementation will become since we can currently very > easily piggy-back on __symbols__ resolution implementation. I care more how I read DTS, so complexity in dtc is less important to me than consistent DTS style. Best regards, Krzysztof