lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1987899.tdWV9SEqCh@jeanmichel-ms7b89>
Date: Wed, 14 Jan 2026 18:29:19 +0100
From: Jean-Michel Hautbois <jeanmichel.hautbois@...eli.org>
To: Linus Walleij <linusw@...nel.org>
Cc: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>,
 Himanshu Bhavani <himanshu.bhavani@...iconsignals.io>,
 linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
 devicetree@...r.kernel.org
Subject:
 Re: [PATCH 2/2] dt-bindings: pinctrl: mcp23s08: Add multi-chip example

Hi Linus, Krzysztof,

Le mercredi 14 janvier 2026, 14:52:00 heure normale d’Europe centrale Linus 
Walleij a écrit :
> Hi Jean-Michel,
> 
> thanks for your patch!

Thanks for reviewing !

> 
> On Tue, Jan 13, 2026 at 3:29 PM Jean-Michel Hautbois via B4 Relay
> 
> <devnull+jeanmichel.hautbois.yoseli.org@...nel.org> wrote:
> > +  gpio-line-names: true
> 
> I have a bit of similar concerns as Krzysztof, this is unlimited.
> 
> This is actually:
> - 8 for microchip,mcp23008 and microchip,mcp23s08
> - 16 for microchip,mcp23017, microchip,mcp23018, microchip,mcp23s17
> and microchip,mcp23s18
> 
> (The "s" variants are just the SPI variants of the same chip...)
> 
> Make some fancy - if: clauses to decide the maxItems from the compatible.
> Don't hesitate to ask for help if this gets complicated, I get a panic
> every time I have to deal with it because of the whitespacing business.
> 

Indeed, I was probably a bit optimistic :-).
What about this:
 allOf:
   - $ref: /schemas/spi/spi-peripheral-props.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - microchip,mcp23s08
+              - microchip,mcp23008
+    then:
+      properties:
+        gpio-line-names:
+          maxItems: 32
+        pinmux:
+          properties:
+            pins:
+              maxItems: 32
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - microchip,mcp23s17
+              - microchip,mcp23s18
+              - microchip,mcp23017
+              - microchip,mcp23018
+    then:
+      properties:
+        gpio-line-names:
+          maxItems: 128
+        pinmux:
+          properties:
+            pins:
+              maxItems: 128
+

This would allow up to 4 chips to be on the same CS. But in the 
microchip,mcp23s17 datasheet, it says:
"Three Hardware Address Pins to Allow Up to Eight Devices On the Bus"

So, the maxItems could even be 256 for microchip,mcp23x17/18 family !

What do you think (sorry for the headache !) ?
Thanks,
JM

>  +            /*
> 
> > +             * Names assigned sequentially in address order.
> > +             * First 16 names for chip at address 0 (GPA0-7, GPB0-7).
> > +             * Next 16 names for chip at address 1 (GPA0-7, GPB0-7).
> > +             */
> > +            gpio-line-names =
> > +                "EXP0_GPA0", "EXP0_GPA1", "EXP0_GPA2", "EXP0_GPA3",
> > +                "EXP0_GPA4", "EXP0_GPA5", "EXP0_GPA6", "EXP0_GPA7",
> > +                "EXP0_GPB0", "EXP0_GPB1", "EXP0_GPB2", "EXP0_GPB3",
> > +                "EXP0_GPB4", "EXP0_GPB5", "EXP0_GPB6", "EXP0_GPB7",
> > +                "EXP1_GPA0", "EXP1_GPA1", "EXP1_GPA2", "EXP1_GPA3",
> > +                "EXP1_GPA4", "EXP1_GPA5", "EXP1_GPA6", "EXP1_GPA7",
> > +                "EXP1_GPB0", "EXP1_GPB1", "EXP1_GPB2", "EXP1_GPB3",
> > +                "EXP1_GPB4", "EXP1_GPB5", "EXP1_GPB6", "EXP1_GPB7";
> 
> So we get this, and we already have this (from the example):
> 
>             gpiopullups: pinmux {
>                 pins = "gpio0", "gpio1", "gpio2", "gpio3",
>                        "gpio4", "gpio5", "gpio6", "gpio7",
>                        "gpio8", "gpio9", "gpio10", "gpio11",
>                        "gpio12", "gpio13", "gpio14", "gpio15";
>                 bias-pull-up;
>             };
> 
> This is wild, we need some constraints I think.
> 
> Whatever we come up with to limit the number of items in gpio-line-names
> should also be applied to the "pins" list in the pinmux node.



> Yours,
> Linus Walleij





Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ