All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: "Alvin Šipraga" <ALSI@bang-olufsen.dk>,
	"open list:NETWORKING DRIVERS" <netdev@vger.kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"Arınç ÜNAL" <arinc.unal@arinc9.com>
Subject: Re: [PATCH net-next RFC 0/3] net: dsa: realtek: drop custom slave MII
Date: Wed, 6 Jul 2022 18:29:23 +0300	[thread overview]
Message-ID: <20220706152923.mhc7vw7xkr7xkot4@skbuf> (raw)
In-Reply-To: <CAJq09z6iX9s75Y2G46V_CEMiAk2PSGW6fF4t4QSPbjEXgs1iTQ@mail.gmail.com>

On Thu, Jun 30, 2022 at 02:05:39PM -0300, Luiz Angelo Daros de Luca wrote:
> > Hi Luiz,
> >
> > On Wed, Jun 29, 2022 at 01:43:45PM -0300, Luiz Angelo Daros de Luca wrote:
> > > This RFC patch series cleans realtek-smi custom slave mii bus. Since
> > > fe7324b932, dsa generic code provides everything needed for
> > > realtek-smi driver. For extra caution, this series should be applied
> > > in two steps: the first 2 patches introduce the new code path that
> > > uses dsa generic code. It will show a warning message if the tree
> > > contains deprecated references. It will still fall back to the old
> > > code path if an "mdio"
> > > is not found.
> >
> > In principle I like your changes, but I'm not sure if what you are doing
> > is allowed, since DT is ABI. The fact that you have to split this into
> > two steps, with the first step warning about old "incompatible" DTs
> > (your point 3 below) before the second step breaks that compatibility,
> > suggests that you are aware that you could be breaking old DTs.
> 
> Thanks Alvin for your review. Yes, that is a good question for the ML.
> I don't know at what level we can break compatibility (DT and driver).
> That's why it is a RFC.

DT bindings are only extended in backwards-compatible ways. Only in the
case where you can prove that there is no DT user of a certain binding,
and that none should appear either, is when you can consider breaking
the backward compatibility. The idea here is that old DT blobs may live
forever and be provided by fixed firmware such as U-Boot, you can't
really force anyone to update them.

> > I'm not going to argue with you if you say "but the node with compatible
> > realtek,smi-mdio was also called mdio in the bindings, so it shouldn't
> > break old DTs", which is a valid point. But if that is your rationale,
> > then there's no need to split the series at all, right?
> 
> The DT requires "realtek,smi-mdio" but also mentions the "mdio" name,
> not a generic name as "mdioX". If we agree that the name "mdio" is
> already required by the DT bindings, it is the driver implementation
> that is not compliant. Even if we are not violating the DT bindings,
> we are changing the driver behavior. That's why I suggested the
> transition process. I do believe that it would be very, very rare to
> name that mdio as anything other than "mdio" and even the driver
> itself is too fresh to be widespread. In a non-RFC series, I would
> also drop the "realtek,smi-mdio" compatible string from the bindings
> (as it is back compatible).

Technically the MDIO node should be named "mdio", at least that's what
Documentation/devicetree/bindings/net/mdio.yaml says, that it should be
"mdio" or "mdio@something". And since the #address-cells of the DSA
switch OF node itself (parent of MDIO node) is 0, it can't really be
"mdio@something", so that leaves us with "mdio".

However I don't think there is any validation for the node name.

> > If you want to avoid that debate, what you could do instead is add a
> > const char *slave_mii_compatible; member to struct dsa_switch, and try
> > searching in dsa_switch_setup() for a child node with that compatible if
> > the lookup of a node named "mdio" fails. I don't know if this would help
> > you do the same thing with other drivers.
> 
> The DSA change to accept "mdio" was an improvement to avoid adding a
> custom slave mdio when you already have a single mdio and just need to
> point to a DT node. Adding compatible strings for that situation does
> not make much sense as a compatible string is not necessary when you
> are already restricting your case to a single mdio. For more complex
> setups, you still need to create your own slave mdio implementation.
> Some drivers already depend on the "mdio" name and this series is also
> a suggestion for them to try their drivers dropping their custom slave
> mdio implementations.

I think we are going down a slippery slope here. DSA providing generic
code to register an MDIO bus is not something I'd consider core
functionality, and I don't consider any duplication of concerns or logic
if drivers register their own MDIO buses.

Here you are effectively proposing to gratuitously break the DT binding,
the obvious question is, what is there to even gain from this?

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?

  parent reply	other threads:[~2022-07-06 15:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29  3:54 [PATCH net-next RFC 0/3] net: dsa: realtek: drop custom slave MII Luiz Angelo Daros de Luca
2022-06-29  3:54 ` [PATCH net-next RFC 1/3] net: dsa: realtek: rename switch_ops to its usage, not users Luiz Angelo Daros de Luca
2022-06-29  3:54 ` [PATCH net-next RFC 2/3] net: dsa: realtek: deprecate custom slave mii Luiz Angelo Daros de Luca
2022-06-29  3:54 ` [PATCH net-next RFC 3/3] net: dsa: realtek: remove deprecated " Luiz Angelo Daros de Luca
2022-06-29 12:30 ` [PATCH net-next RFC 0/3] net: dsa: realtek: drop custom slave MII Arınç ÜNAL
2022-06-29 16:49   ` Luiz Angelo Daros de Luca
2022-06-29 16:43 ` Luiz Angelo Daros de Luca
2022-06-29 18:14   ` Alvin Šipraga
2022-06-29 18:31     ` Alvin Šipraga
2022-06-30 17:05     ` Luiz Angelo Daros de Luca
2022-06-30 20:04       ` Alvin Šipraga
2022-07-06 15:29       ` Vladimir Oltean [this message]
2022-07-07  8:45         ` Linus Walleij

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=20220706152923.mhc7vw7xkr7xkot4@skbuf \
    --to=olteanv@gmail.com \
    --cc=ALSI@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=arinc.unal@arinc9.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=luizluca@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=vivien.didelot@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.