* [PATCH] spi: dt-bindings: Relax node name suffixes again
@ 2026-09-16 15:18 Geert Uytterhoeven
2026-09-18 20:00 ` Rob Herring
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2026-09-16 15:18 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Marek Vasut
Cc: linux-spi, devicetree, linux-renesas-soc, Geert Uytterhoeven,
kernel test robot
From: Geert Uytterhoeven <geert+renesas@glider.be>
An SPI bus node name can have either a unit address, or a suffix.
Commit c4fb6880edc15866 ("spi: dt-bindings: restrict node name
suffixes") restricted these suffixes to decimal numbers.
However, SPI bus node names with suffixes are typically used for
board-level bit-banged SPI busses ("spi-gpio"), which live at the root
of the device tree. Limiting their node names to numbers is prone to
conflicts, and may cause silent overwrites, especially when a stack of
sub-boards or expansion boards is involved.
Hence relax node name suffixes to alphanumerical characters, so users
can write more descriptive SPI bus names, which are less prone to
conflicts.
While at it, reject empty unit addresses.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202609150228.Nh4nZzbQ-lkp@intel.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Other subsystems (regulator, i2c) had similar issues, and numbered
regulators caused conflicts before, see e.g. commit 45f5d5a9e34d3fe4
("arm64: dts: renesas: r8a77995: draak: Fix backlight regulator name").
---
Documentation/devicetree/bindings/spi/spi-controller.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml
index 3b8e990e30c4789a..4d817f9e23a5e0b5 100644
--- a/Documentation/devicetree/bindings/spi/spi-controller.yaml
+++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml
@@ -17,7 +17,7 @@ description: |
properties:
$nodename:
- pattern: "^spi(@.*|-([0-9]|[1-9][0-9]+))?$"
+ pattern: "^spi(@.+|-[0-9a-z-]+)?$"
"#address-cells":
enum: [0, 1]
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] spi: dt-bindings: Relax node name suffixes again 2026-09-16 15:18 [PATCH] spi: dt-bindings: Relax node name suffixes again Geert Uytterhoeven @ 2026-09-18 20:00 ` Rob Herring 2026-09-21 7:25 ` Geert Uytterhoeven 0 siblings, 1 reply; 3+ messages in thread From: Rob Herring @ 2026-09-18 20:00 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Mark Brown, Krzysztof Kozlowski, Conor Dooley, Marek Vasut, linux-spi, devicetree, linux-renesas-soc, Geert Uytterhoeven, kernel test robot On Wed, Sep 16, 2026 at 05:18:27PM +0200, Geert Uytterhoeven wrote: > From: Geert Uytterhoeven <geert+renesas@glider.be> > > An SPI bus node name can have either a unit address, or a suffix. > Commit c4fb6880edc15866 ("spi: dt-bindings: restrict node name > suffixes") restricted these suffixes to decimal numbers. > However, SPI bus node names with suffixes are typically used for > board-level bit-banged SPI busses ("spi-gpio"), which live at the root > of the device tree. Limiting their node names to numbers is prone to > conflicts, and may cause silent overwrites, especially when a stack of > sub-boards or expansion boards is involved. How is that commit an issue 3 years later? I've commented on the case which I guess prompted this patch. BTW, "spi-gpio" or "i2c-gpio" are not good names because you can have more than 1 instance. > > Hence relax node name suffixes to alphanumerical characters, so users > can write more descriptive SPI bus names, which are less prone to > conflicts. > > While at it, reject empty unit addresses. > > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202609150228.Nh4nZzbQ-lkp@intel.com > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > --- > Other subsystems (regulator, i2c) had similar issues, and numbered > regulators caused conflicts before, see e.g. commit 45f5d5a9e34d3fe4 > ("arm64: dts: renesas: r8a77995: draak: Fix backlight regulator name"). I2C was a case of "too many to fix". Maybe time to revisit that. Regulator binding is a unicorn and not a bus. I really want standard names for buses given that's the only way to identify them generically. Rob ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: dt-bindings: Relax node name suffixes again 2026-09-18 20:00 ` Rob Herring @ 2026-09-21 7:25 ` Geert Uytterhoeven 0 siblings, 0 replies; 3+ messages in thread From: Geert Uytterhoeven @ 2026-09-21 7:25 UTC (permalink / raw) To: Rob Herring Cc: Mark Brown, Krzysztof Kozlowski, Conor Dooley, Marek Vasut, linux-spi, devicetree, linux-renesas-soc, Geert Uytterhoeven, kernel test robot Hi Rob, On Fri, 18 Sept 2026 at 22:00, Rob Herring <robh@kernel.org> wrote: > On Wed, Sep 16, 2026 at 05:18:27PM +0200, Geert Uytterhoeven wrote: > > From: Geert Uytterhoeven <geert+renesas@glider.be> > > > > An SPI bus node name can have either a unit address, or a suffix. > > Commit c4fb6880edc15866 ("spi: dt-bindings: restrict node name > > suffixes") restricted these suffixes to decimal numbers. > > However, SPI bus node names with suffixes are typically used for > > board-level bit-banged SPI busses ("spi-gpio"), which live at the root > > of the device tree. Limiting their node names to numbers is prone to > > conflicts, and may cause silent overwrites, especially when a stack of > > sub-boards or expansion boards is involved. > > How is that commit an issue 3 years later? Because no one cared about avoiding future conflicts and/or no one noticed any conflicts? > I've commented on the case which I guess prompted this patch. Yeah, "spi-ws-2ch-canfd" referred in the Closes-tag below. > BTW, "spi-gpio" or "i2c-gpio" are not good names because you can have > more than 1 instance. Yes they are bad names for node names. I was referring to the compatible value; sorry if that wasn't clear. > > Hence relax node name suffixes to alphanumerical characters, so users > > can write more descriptive SPI bus names, which are less prone to > > conflicts. > > > > While at it, reject empty unit addresses. > > > > Reported-by: kernel test robot <lkp@intel.com> > > Closes: https://lore.kernel.org/oe-kbuild-all/202609150228.Nh4nZzbQ-lkp@intel.com > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > > --- > > Other subsystems (regulator, i2c) had similar issues, and numbered > > regulators caused conflicts before, see e.g. commit 45f5d5a9e34d3fe4 > > ("arm64: dts: renesas: r8a77995: draak: Fix backlight regulator name"). > > I2C was a case of "too many to fix". Maybe time to revisit that. > Regulator binding is a unicorn and not a bus. I really want standard > names for buses given that's the only way to identify them generically. Aren't "spi-gpio" or "i2c-gpio" (compatible :-) nodes unicorn buses? ;-) The issue is that they all live at the root node. How do you name them in a conflictless way using numerical suffixes? - On the SoM: spi-1, - On the SoM carrier: spi-2, spi-3, - On the expansion board (hat): spi-4? What if your carrier board supports more than one SoM model, with a different number of spi-gpio buses? Oh, let's start at 10 on the carrier, and 20 on the hat, like we used to number our lines in CBM BASIC V2 before Simon's BASIC gave us RENUMBER ;-) What if you have multiple hats, each with their own spi-gpio buses? Hence node names like "spi-ws-2ch-canfd" make sense, IMO. When the WIP connector design is finished, and provides separate name spaces for the subboard in a board stack, we can revisit, perhaps... Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.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 like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-21 7:25 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-09-16 15:18 [PATCH] spi: dt-bindings: Relax node name suffixes again Geert Uytterhoeven 2026-09-18 20:00 ` Rob Herring 2026-09-21 7:25 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox