devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs: dt: writing-bindings: Document node name ABI and simple-mfd
@ 2025-08-18 13:25 Krzysztof Kozlowski
  2025-08-20 22:24 ` Rob Herring (Arm)
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-18 13:25 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, devicetree,
	linux-kernel
  Cc: Krzysztof Kozlowski

Document established Devicetree bindings maintainers review practice:

1. Device node names should not be treated as an ABI, unless for
   children of a device when documented.
   There were many patches posted using of_find_node_by_name() or
   of_node_name_eq() for accessing siblings or completely different
   nodes.  These cases were introducing undocumented ABI, so they are
   discouraged.

2. 'simple-mfd' means children do not depend on parent device resources.
   'simple-bus' is so simple, that even 'reg' properties are not
   applicable.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/writing-bindings.rst | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/writing-bindings.rst b/Documentation/devicetree/bindings/writing-bindings.rst
index f8e0293a7c06..667816dd7d50 100644
--- a/Documentation/devicetree/bindings/writing-bindings.rst
+++ b/Documentation/devicetree/bindings/writing-bindings.rst
@@ -31,10 +31,19 @@ Overall design
   devices only need child nodes when the child nodes have their own DT
   resources. A single node can be multiple providers (e.g. clocks and resets).
 
+- DON'T treat device node names as a stable ABI, but instead use phandles or
+  compatibles to find sibling devices. Exception: sub-nodes of given device
+  could be treated as ABI, if explicitly documented in the bindings.
+
 - DON'T use 'syscon' alone without a specific compatible string. A 'syscon'
   hardware block should have a compatible string unique enough to infer the
   register layout of the entire block (at a minimum).
 
+- DON'T use 'simple-mfd' compatible for non-trivial devices, where children
+  depend on some resources from the parent. Similarly, 'simple-bus' should not
+  be used for complex buses and even 'regs' property means device is not
+  a simple bus.
+
 
 Properties
 ==========
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] docs: dt: writing-bindings: Document node name ABI and simple-mfd
  2025-08-18 13:25 [PATCH] docs: dt: writing-bindings: Document node name ABI and simple-mfd Krzysztof Kozlowski
@ 2025-08-20 22:24 ` Rob Herring (Arm)
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring (Arm) @ 2025-08-20 22:24 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Krzysztof Kozlowski, devicetree, Conor Dooley, linux-kernel


On Mon, 18 Aug 2025 15:25:35 +0200, Krzysztof Kozlowski wrote:
> Document established Devicetree bindings maintainers review practice:
> 
> 1. Device node names should not be treated as an ABI, unless for
>    children of a device when documented.
>    There were many patches posted using of_find_node_by_name() or
>    of_node_name_eq() for accessing siblings or completely different
>    nodes.  These cases were introducing undocumented ABI, so they are
>    discouraged.
> 
> 2. 'simple-mfd' means children do not depend on parent device resources.
>    'simple-bus' is so simple, that even 'reg' properties are not
>    applicable.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/writing-bindings.rst | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 

Applied, thanks!


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-20 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 13:25 [PATCH] docs: dt: writing-bindings: Document node name ABI and simple-mfd Krzysztof Kozlowski
2025-08-20 22:24 ` Rob Herring (Arm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).