[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJq09z70hfygcB5LL3Rp9GQ0180mTJauH6qVeAPqm1zO4HiAAQ@mail.gmail.com>
Date: Thu, 7 Dec 2023 23:46:46 -0300
From: Luiz Angelo Daros de Luca <luizluca@...il.com>
To: Vladimir Oltean <olteanv@...il.com>
Cc: Alvin Šipraga <ALSI@...g-olufsen.dk>,
Krzysztof Kozlowski <krzk@...nel.org>, "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, "andrew@...n.ch" <andrew@...n.ch>,
"f.fainelli@...il.com" <f.fainelli@...il.com>, "davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>, "kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>, "arinc.unal@...nc9.com" <arinc.unal@...nc9.com>
Subject: Re: [net-next 2/2] net: dsa: realtek: load switch variants on demand
> > We discussed something about that in the past:
> >
> > https://lkml.kernel.org/netdev/20220630200423.tieprdu5fpabflj7@bang-olufsen.dk/T/#m04e6cf7d0c1f18b02c2bf40266ada915b1f02f3d
> >
> > The code is able to handle only a single node and binding docs say it
> > should be named "mdio". The compatible string wasn't a requirement
> > since the beginning and I don't think it is worth it to rename the
> > compatible string. I suggest we simply switch to
> > of_get_child_by_name() and look for a node named "mdio". If that node
> > is not found, we can still look for the old compatible string
> > (backwards compatibility) and probably warn the "user" (targeting not
> > the end-user but the one creating the DT for a new device).
> >
> > I don't know how to handle the binding docs as the compatible string
> > is still a requirement for older kernel versions. Is it ok to update
> > the device-tree bindings docs in such a way it would break old
> > drivers? Or should we keep it there until the last LTS kernel
> > requiring it reaches EOL? As device-tree bindings docs should not
> > consider how the driver was implemented, I think it would be strange
> > to have a note like "required by kernel up to 6.x".
> >
> > Regards,
> >
> > Luiz
>
> And did you ever answer this question?
>
> "And why do you even need to remove the compatible string from the MDIO
> node, can't you just ignore it, does it bother you in any way?"
>
> I'm very confused as to what you're after.
The device-tree bindings should delineate the hardware characteristics
rather than specifying the implementation details of a particular
driver. The requirement of an "mdio" node with a compatible string
such as "realtek,smi-mdio" may be misleading, implying a potential
correlation between the host-switch interface (SMI, SPI, or MDIO) and
a specific user MDIO it describes. It's important to note that how we
describe the user mdio could vary for other future switch families,
but not with a distinct management interface.
I am currently conducting tests using the same user MDIO driver for
both realtek-smi and realtek-mdio. However, it's noteworthy that
unlike realtek-smi, the current user MDIO for realtek-mdio does not
require a compatible string; only a node named "mdio". Realtek-mdio is
presently utilizing the generic DSA user MDIO, but you mentioned it's
not considered a "core functionality." I assume this implies I
shouldn't depend on it. That's the reason for my switch to the
existing user MDIO driver from realtek-smi.
Regarding the absence of a compatible string for realtek-mdio, we have
a few options: introducing a new compatible string exclusively for
realtek-mdio, such as "realtek,mdio-mdio"; creating a new generic one
for both interfaces like "realtek,user-mdio" or "rtl836x-user-mdio";
or simply ignore the compatible string, as you suggested. However, if
I opt to ignore it, I presume I should retrieve that node solely based
on the node name. That's what I'm after. Is my understanding correct?
I'll post a new series that is still compatible both with old HW
descriptions and the device-tree bindings. In that way, I'll not touch
the docs. However, given that the compatible string is unnecessary to
describe the hardware, and after we modify the code to disregard it,
it is awkward for the binding documentation to request a compatible
string that serves no purpose. Shouldn't we consider updating this
requirement at some point?
Regards,
Luiz
Powered by blists - more mailing lists