public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Emil Schulz Ostergaard <jensemil.schulzostergaard@microchip.com>
To: Christian Marangi <ansuelsmth@gmail.com>,
	Conor Dooley <conor@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>, <UNGLinuxDriver@microchip.com>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Woojung Huh <woojung.huh@microchip.com>,
	"Russell King" <linux@armlinux.org.uk>,
	Steen Hegelund <Steen.Hegelund@microchip.com>,
	Daniel Machon <daniel.machon@microchip.com>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH net-next 2/8] dt-bindings: net: lan9645x: add LAN9645X switch bindings
Date: Tue, 24 Mar 2026 11:31:47 +0100	[thread overview]
Message-ID: <a0947e239b006cf7c2a3e64057bd2fcd6edb836e.camel@microchip.com> (raw)
In-Reply-To: <69bae055.050a0220.3719be.bf31@mx.google.com>

On Wed, 2026-03-18 at 18:26 +0100, Christian Marangi wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Wed, Mar 18, 2026 at 05:20:03PM +0000, Conor Dooley wrote:
> > On Wed, Mar 18, 2026 at 05:18:42PM +0000, Conor Dooley wrote:
> > > Christian,
> > > 
> > > On Wed, Mar 18, 2026 at 03:19:20PM +0100, Jens Emil Schulz Ostergaard wrote:
> > > > Hi Conor,
> > > > 
> > > > On Fri, 2026-03-06 at 15:20 +0000, Conor Dooley wrote:
> > > > > On Fri, Mar 06, 2026 at 04:08:01PM +0100, Jens Emil Schulz Ostergaard wrote:
> > > > > > On Thu, 2026-03-05 at 18:31 +0000, Conor Dooley wrote:
> > > > > > > On Thu, Mar 05, 2026 at 01:57:37PM +0100, Jens Emil Schulz Ostergaard wrote:
> > > > > > > > On Tue, 2026-03-03 at 19:04 +0000, Conor Dooley wrote:
> > > > > > > > > On Tue, Mar 03, 2026 at 03:18:45PM +0100, Andrew Lunn wrote:
> > > > > > > > > > > +        properties:
> > > > > > > > > > > +          microchip,led-drive-mode:
> > > > > > > > > > > +            $ref: /schemas/types.yaml#/definitions/uint32
> > > > > > > > > > > +            description: |
> > > > > > > > > > > +              Set the LED drive mode for the copper PHY associated with
> > > > > > > > > > > +              this port.
> > > > > > > > > > > +
> > > > > > > > > > > +                0 - LED1 and LED2 in open-drain mode
> > > > > > > > > > > +                1 - LED1 in active drive mode (can be used for single-LED
> > > > > > > > > > > +                    configurations requiring active drive)
> > > > > > > > > > > +                2 - Reserved
> > > > > > > > > > > +                3 - LED1 and LED2 in active drive mode
> > > > > > > > > > > +            minimum: 0
> > > > > > > > > > > +            maximum: 3
> > > > > > > > > > 
> > > > > > > > > > I doubt the DT Maintainers will accept that. This looks a lot like a
> > > > > > > > > > value you write into a register. How are active drive and open-drain
> > > > > > > > > > described in other DT bindings? Is there something you can reuse?
> > > > > > > > > 
> > > > > > > > > I had a quick look and I didn't see anything really that stood out to me
> > > > > > > > > that would be a drop-in replacement.
> > > > > > > > > I also tried looking in the datasheet for more information on these
> > > > > > > > > modes, but I couldn't see anything obvious. For example, there were zero
> > > > > > > > > hits for "drain" in either LAN9645xS or LAN9645xF datasheets.
> > > > > > > > > 
> > > > > > > > > That said, yea you're right about DT maintainer feelings about it.
> > > > > > > > > There's a couple things I could suggest, but I'd like to know about what
> > > > > > > > > mode 1 means for LED2 first. If there's actually nothing similar, what
> > > > > > > > > about representing each led with a child node and having open-drain be
> > > > > > > > > the default with a property in the child for active-drive?
> > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > For 1, what happens to LED2? Not used at all?
> > > > > > > > 
> > > > > > > > In mode 1 LED2 will be open-drain. This mode only makes sense if you have
> > > > > > > > just 1 LED. With two LEDs mode 0 or mode 3 should be used.
> > > > > > > 
> > > > > > > Could we then have child nodes for each led, and have a property in each
> > > > > > > that sets the mode to either open-drain or active-drive? Or am I just
> > > > > > > inserting complexity by asking for that?
> > > > > > 
> > > > > > I think it sounds sensible, I will add this.
> > > > > 
> > > > > 
> > > > > You don't need a property for each, just make one mode the default (prob
> > > > > open-drain given it's the 0 setting, but whatever is default out of
> > > > > reset for the part) and have the property for the other mode. Just
> > > > > some bool property like "microchip,active-drive" or whatever.
> > > > 
> > > > 
> > > > Based on your feedback I went with this under port properties:
> > > > 
> > > >           leds:
> > > >             patternProperties:
> > > >               '^led@[a-f0-9]+$':
> > > >                 $ref: /schemas/leds/common.yaml#
> > > > 
> > > >                 properties:
> > > >                   reg:
> > > >                     maxItems: 1
> > > > 
> > > >                   microchip,active-drive:
> > > >                     type: boolean
> > > >                     description:
> > > >                       Set the LED output to active drive mode. The default
> > > >                       is open-drain.
> > > > 
> > > >                 required:
> > > >                   - reg
> > > > 
> > > >                 unevaluatedProperties: false
> > > > 
> > > > and then the example has
> > > > 
> > > >           port@1 {
> > > >             reg = <1>;
> > > >             phy-mode = "gmii";
> > > >             phy-handle = <&cuphy1>;
> > > > 
> > > >             leds {
> > > >               #address-cells = <1>;
> > > >               #size-cells = <0>;
> > > > 
> > > >               led@0 {
> > > >                 reg = <0>;
> > > >                 microchip,active-drive;
> > > >               };
> > > > 
> > > >               led@1 {
> > > >                 reg = <1>;
> > > >                 microchip,active-drive;
> > > >               };
> > > >             };
> > > >           }
> > > > 
> > > > However, this does not pass dt_binding_check because we pull in $ref: dsa-port.yaml,
> > > > which pulls in ethernet-controller.yaml.
> > > > 
> > > > I believe the 'unevaluatedProperties: false' on LED nodes in ethernet-controller.yaml
> > > > prevents downstream bindings from adding vendor-specific LED properties.
> > > > 
> > > > Is the right move removing unevaluatedProperties: false from the LED node in
> > > > ethernet-controller.yaml, or is there a preferred way to extend per-port LEDs?
> > > 
> > > The addition looks recent enough, should probably ask Christian why it
> > > was done this way and if removing it makes sense. Christian?
> > > 
> > 
> > Ah shit, I autopiloted into sending. Actually +CC Christian this time.
> 
> Hi, give me some time to experiment... AFAIK with my limited info on DT,
> 
> unevaluatedProperties permits to add vendor property as long as they are
> well defined. If the dt_binding_check is failing, then it's probably
> because unevaluatedProperties is finding that in the expected LED node
> there is extra stuff in the SCHEMA example.
> 
> But give me some time to experiment with some other SCHEMA.
> 
> --
>         Ansuel


Hi, I will just remove the LED handling from this series, and handle it in a
different series, once this is settled.

Thanks,
Emil

  reply	other threads:[~2026-03-24 10:32 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 12:22 [PATCH net-next 0/8] net: dsa: add DSA support for the LAN9645x switch chip family Jens Emil Schulz Østergaard
2026-03-03 12:22 ` [PATCH net-next 1/8] net: dsa: add tag driver for LAN9645X Jens Emil Schulz Østergaard
2026-03-03 14:13   ` Andrew Lunn
2026-03-03 15:58     ` Jens Emil Schulz Ostergaard
2026-03-04 15:14       ` Andrew Lunn
2026-03-05 12:59         ` Jens Emil Schulz Ostergaard
2026-03-03 16:11   ` Vladimir Oltean
2026-03-05 13:53     ` Jens Emil Schulz Ostergaard
2026-03-04 15:23   ` Andrew Lunn
2026-03-05 13:01     ` Jens Emil Schulz Ostergaard
2026-03-03 12:22 ` [PATCH net-next 2/8] dt-bindings: net: lan9645x: add LAN9645X switch bindings Jens Emil Schulz Østergaard
2026-03-03 13:22   ` Vladimir Oltean
2026-03-03 16:00     ` Jens Emil Schulz Ostergaard
2026-03-03 14:18   ` Andrew Lunn
2026-03-03 19:04     ` Conor Dooley
2026-03-04 15:57       ` Jens Emil Schulz Ostergaard
2026-03-05 12:57       ` Jens Emil Schulz Ostergaard
2026-03-05 18:31         ` Conor Dooley
2026-03-06 15:08           ` Jens Emil Schulz Ostergaard
2026-03-06 15:20             ` Conor Dooley
2026-03-18 14:19               ` Jens Emil Schulz Ostergaard
2026-03-18 17:18                 ` Conor Dooley
2026-03-18 17:20                   ` Conor Dooley
2026-03-18 17:26                     ` Christian Marangi
2026-03-24 10:31                       ` Jens Emil Schulz Ostergaard [this message]
2026-03-04 15:55     ` Jens Emil Schulz Ostergaard
2026-03-03 18:49   ` Conor Dooley
2026-03-04 15:58     ` Jens Emil Schulz Ostergaard
2026-03-03 18:56   ` Conor Dooley
2026-03-04 16:10     ` Jens Emil Schulz Ostergaard
2026-03-04 16:14       ` Vladimir Oltean
2026-03-04 19:06         ` Conor Dooley
2026-03-05 13:08           ` Jens Emil Schulz Ostergaard
2026-03-03 12:22 ` [PATCH net-next 3/8] net: dsa: lan9645x: add autogenerated register macros Jens Emil Schulz Østergaard
2026-03-03 12:22 ` [PATCH net-next 4/8] net: dsa: lan9645x: add basic dsa driver for LAN9645X Jens Emil Schulz Østergaard
2026-03-03 14:15   ` Vladimir Oltean
2026-03-04 14:37     ` Jens Emil Schulz Ostergaard
2026-03-04 15:58   ` Russell King (Oracle)
2026-03-05 14:24     ` Jens Emil Schulz Ostergaard
2026-03-05 14:58       ` Andrew Lunn
2026-03-05 15:10         ` Vladimir Oltean
2026-03-05 16:54         ` Alexander Stein
2026-03-05 17:37           ` Andrew Lunn
2026-03-06 15:03             ` Jens Emil Schulz Ostergaard
2026-03-06 16:33               ` Andrew Lunn
2026-03-09 12:01                 ` Jens Emil Schulz Ostergaard
2026-03-06 14:22         ` Russell King (Oracle)
2026-03-06 21:03           ` Jakub Kicinski
2026-03-03 12:22 ` [PATCH net-next 5/8] net: dsa: lan9645x: add bridge support Jens Emil Schulz Østergaard
2026-03-03 14:20   ` Vladimir Oltean
2026-03-03 16:08     ` Jens Emil Schulz Ostergaard
2026-03-03 16:17       ` Vladimir Oltean
2026-03-05 13:14         ` Jens Emil Schulz Ostergaard
2026-03-03 14:51   ` Vladimir Oltean
2026-03-09 12:09     ` Jens Emil Schulz Ostergaard
2026-03-03 12:22 ` [PATCH net-next 6/8] net: dsa: lan9645x: add vlan support Jens Emil Schulz Østergaard
2026-03-03 14:59   ` Vladimir Oltean
2026-03-04 14:40     ` Jens Emil Schulz Ostergaard
2026-03-04 14:52       ` Vladimir Oltean
2026-03-03 12:22 ` [PATCH net-next 7/8] net: dsa: lan9645x: add mac table integration Jens Emil Schulz Østergaard
2026-03-03 15:27   ` Vladimir Oltean
2026-03-04 15:23     ` Jens Emil Schulz Ostergaard
2026-03-04 15:34       ` Andrew Lunn
2026-03-05 13:17         ` Jens Emil Schulz Ostergaard
2026-03-03 12:22 ` [PATCH net-next 8/8] net: dsa: lan9645x: add port statistics Jens Emil Schulz Østergaard
2026-03-03 16:01   ` Vladimir Oltean
2026-03-03 20:21     ` Andrew Lunn
2026-03-04 15:51       ` Jens Emil Schulz Ostergaard
2026-03-04 15:50     ` Jens Emil Schulz Ostergaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a0947e239b006cf7c2a3e64057bd2fcd6edb836e.camel@microchip.com \
    --to=jensemil.schulzostergaard@microchip.com \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=daniel.machon@microchip.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=woojung.huh@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox