Re: [PATCH net-next v2 3/3] net: phy: dp83822: Add support for changing the MAC termination

From: Rob Herring
Date: Fri Apr 11 2025 - 11:05:24 EST


On Tue, Apr 08, 2025 at 07:18:31PM +0200, Dimitri Fedrau wrote:
> On Tue, Apr 08, 2025 at 03:28:32PM +0200, Andrew Lunn wrote:
> > On Tue, Apr 08, 2025 at 01:01:17PM +0000, Fedrau Dimitri (LED) wrote:
> > > -----Ursprüngliche Nachricht-----
> > > Von: Andrew Lunn <andrew@xxxxxxx>
> > > Gesendet: Dienstag, 8. April 2025 14:47
> > > An: Fedrau Dimitri (LED) <dimitri.fedrau@xxxxxxxxxxxx>
> > > Cc: Heiner Kallweit <hkallweit1@xxxxxxxxx>; Russell King <linux@xxxxxxxxxxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; Rob Herring <robh@xxxxxxxxxx>; Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>; Conor Dooley <conor+dt@xxxxxxxxxx>; Florian Fainelli <f.fainelli@xxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; devicetree@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Dimitri Fedrau <dima.fedrau@xxxxxxxxx>
> > > Betreff: Re: [PATCH net-next v2 3/3] net: phy: dp83822: Add support for changing the MAC termination
> > >
> > > > > +static const u32 mac_termination[] = {
> > > > > + 99, 91, 84, 78, 73, 69, 65, 61, 58, 55, 53, 50, 48, 46, 44, 43,
> > > >
> > > > Please add this list to the binding.
> > >
> > > Add this list to "ti,dp83822.yaml" ?
> >
> > Yes please. Ideally we want the DT validation tools to pick up invalid
> > values before they reach the kernel.
> >
> Ok, but then I would have to add "mac-termination-ohms" property to
> "ti,dp83822.yaml" as well together with the allowed values ? Ending up in
> some sort of duplication, because the property is already defined in
> "ethernet-phy.yaml". Is this the right way to do it ?

It is not duplication because you are adding constraints. I was thinking
the definition in ethernet-phy.yaml should have some logical limit. Say
200 ohms as termination resistance is typically 10s of ohms.

Seems like a long list to define to me, but if the driver is going to
reject unknown values it makes sense. You could also make the driver
just pick the closest match rather than require an exact match.
Resistance values are nominal anyways.

Rob