From: Vladimir Oltean <olteanv@gmail.com>
To: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: "Alvin Šipraga" <ALSI@bang-olufsen.dk>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"andrew@lunn.ch" <andrew@lunn.ch>,
"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"arinc.unal@arinc9.com" <arinc.unal@arinc9.com>
Subject: Re: [net-next 2/2] net: dsa: realtek: load switch variants on demand
Date: Mon, 11 Dec 2023 20:01:01 +0200 [thread overview]
Message-ID: <20231211180101.twpcepmdivsi7ymn@skbuf> (raw)
In-Reply-To: <CAJq09z70hfygcB5LL3Rp9GQ0180mTJauH6qVeAPqm1zO4HiAAQ@mail.gmail.com> <CAJq09z70hfygcB5LL3Rp9GQ0180mTJauH6qVeAPqm1zO4HiAAQ@mail.gmail.com>
On Thu, Dec 07, 2023 at 11:46:46PM -0300, Luiz Angelo Daros de Luca wrote:
> 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.
Agree, "realtek,smi-mdio" is not a great compatible string. But it is an
established compatible string.
> 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";
The naming choice really looks like the secondary problem here.
But what about "realtek,rtl8365mb-mdio" and "realtek,rtl8366rb-mdio" as
a secondary compatible string for SMI, and primary compatible string for
MDIO-connected switches?
> 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?
You could do that. There's a very high chance that the node was named
"mdio". The schema says it should be called "mdio", _and_ be compatible
with realtek,smi-mdio. If anyone comes and complains (very unlikely),
just say "hey, even Documentation/devicetree/bindings/net/dsa/realtek-smi.txt
said you should name the node 'mdio'"!
> 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
Not everything that is in the device tree has to be used. It is a
description of the hardware, not a rigid set of instructions for what
the OS has to do. The OS still does whatever it wants based on that info.
You can ask anyone about this. See Thomas Petazzoni's slides as just one
example.
https://elinux.org/images/f/f9/Petazzoni-device-tree-dummies_0.pdf
| The Device Tree is really a hardware description language.
| It should describe the hardware layout, and how it works.
| But it should not describe which particular hardware configuration you’re interested in.
| As an example:
| You may describe in the DT whether a particular piece of hardware supports DMA or not.
| But you may not describe in the DT if you want to use DMA or not.
It's a really weak argument for recommending users to remove the compatible
string, thereby deliberately breaking ABI compatibility in one direction,
to literally _no_ benefit.
Compatible strings for MDIO controllers are, in essence, not strange.
They are independent devices which could reasonably be bound to their
own drivers. I don't see what's awkward about this.
next prev parent reply other threads:[~2023-12-11 18:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-17 23:49 [net-next 0/2] net: dsa: realtek: Introduce realtek_common, load variants on demand Luiz Angelo Daros de Luca
2023-11-17 23:50 ` [net-next 1/2] net: dsa: realtek: create realtek-common Luiz Angelo Daros de Luca
2023-11-19 12:13 ` Vladimir Oltean
2023-11-19 12:20 ` Vladimir Oltean
2023-11-17 23:50 ` [net-next 2/2] net: dsa: realtek: load switch variants on demand Luiz Angelo Daros de Luca
2023-11-19 12:19 ` Vladimir Oltean
2023-11-20 9:20 ` Krzysztof Kozlowski
2023-11-20 13:48 ` Vladimir Oltean
2023-11-20 14:07 ` Krzysztof Kozlowski
2023-11-21 14:40 ` Luiz Angelo Daros de Luca
2023-11-21 22:15 ` Krzysztof Kozlowski
2023-11-21 22:35 ` Krzysztof Kozlowski
2023-11-22 22:44 ` Luiz Angelo Daros de Luca
2023-11-23 2:05 ` Alvin Šipraga
2023-11-27 22:24 ` Luiz Angelo Daros de Luca
2023-12-07 17:02 ` Vladimir Oltean
2023-12-07 20:22 ` Luiz Angelo Daros de Luca
2023-12-07 17:19 ` Vladimir Oltean
2023-12-07 19:50 ` Luiz Angelo Daros de Luca
2023-12-07 22:31 ` Vladimir Oltean
2023-12-08 2:46 ` Luiz Angelo Daros de Luca
2023-12-11 18:01 ` Vladimir Oltean [this message]
2023-11-25 7:10 ` Dan Carpenter
2023-11-17 23:57 ` [net-next 0/2] net: dsa: realtek: Introduce realtek_common, load " Luiz Angelo Daros de Luca
2023-11-18 0:44 ` Jakub Kicinski
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=20231211180101.twpcepmdivsi7ymn@skbuf \
--to=olteanv@gmail.com \
--cc=ALSI@bang-olufsen.dk \
--cc=andrew@lunn.ch \
--cc=arinc.unal@arinc9.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=krzk@kernel.org \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=luizluca@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).