Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: linus.walleij@linaro.org, alsi@bang-olufsen.dk, andrew@lunn.ch,
	f.fainelli@gmail.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	arinc.unal@arinc9.com
Subject: Re: [PATCH net-next v2 5/7] net: dsa: realtek: Migrate user_mii_bus setup to realtek-dsa
Date: Sat, 23 Dec 2023 00:09:55 +0200	[thread overview]
Message-ID: <20231222220955.77j7nmvhbelv2t7a@skbuf> (raw)
In-Reply-To: <CAJq09z5zN86auxMOtfUOqSj9XzU-Vs8_=7UzfY-d=-N9dgAPyA@mail.gmail.com>

On Fri, Dec 22, 2023 at 05:03:38PM -0300, Luiz Angelo Daros de Luca wrote:
> > Having the MDIO bus described in OF, but no phy-handle to its children
> > is a semantically broken device tree, we should make no effort whatsoever
> > to support it.
> 
> OK. I was trying to keep exactly that setup working.

Which setup exactly?

> Should I keep the check and bail out with an error like:
> 
> +       dsa_switch_for_each_user_port(dp, ds) {
> +               phy_node = of_parse_phandle(dp->dn, "phy-handle", 0);
> +               of_node_put(phy_node);
> +               if (phy_node)
> +                       continue;
> +               dev_err(priv->dev,
> +                       "'%s' is missing phy-handle",
> +                       dp->name);
> +               return -EINVAL;
> +       }
> 
> or should I simply let it break silently? The device-tree writers
> might like some feedback if they are doing it wrong. I guess neither
> DSA nor MDIO bus will say a thing about the missing phy-handle.

FWIW, it will not break silently, but like this (very easy to test, no need to guess):

[    7.196687] mscc_felix 0000:00:00.5 swp3 (uninitialized): failed to connect to PHY: -ENODEV
[    7.205168] mscc_felix 0000:00:00.5 swp3 (uninitialized): error -19 setting up PHY for tree 0, switch 0, port 3

If you have no other decision to make in the driver based on the
presence/absence of "phy-handle", it doesn't make much sense to bloat
the driver with dubious logic just to get an arguably prettier error.
I'm saying "dubious" because my understanding is that rtl8365mb "extint"
ports can also serve as user ports, and can additionally be fixed-links.
But arbitrary logic like this breaks that.

The cost/benefit ratio does not seem too favorable for this addition.

  reply	other threads:[~2023-12-22 22:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20  4:24 [PATCH net-next v2 0/7] net: dsa: realtek: variants to drivers, interfaces to a common module Luiz Angelo Daros de Luca
2023-12-20  4:24 ` [PATCH net-next v2 1/7] net: dsa: realtek: drop cleanup from realtek_ops Luiz Angelo Daros de Luca
2023-12-20 13:57   ` Alvin Šipraga
2023-12-21 17:04     ` Vladimir Oltean
2023-12-21 20:05       ` Alvin Šipraga
2023-12-22 22:32         ` Luiz Angelo Daros de Luca
2023-12-20  4:24 ` [PATCH net-next v2 2/7] net: dsa: realtek: convert variants into real drivers Luiz Angelo Daros de Luca
2023-12-21 17:08   ` Vladimir Oltean
2023-12-20  4:24 ` [PATCH net-next v2 3/7] net: dsa: realtek: common realtek-dsa module Luiz Angelo Daros de Luca
2023-12-20 10:40   ` Alvin Šipraga
2023-12-20 15:50     ` Alvin Šipraga
2023-12-21  3:25       ` Luiz Angelo Daros de Luca
2023-12-21  3:11     ` Luiz Angelo Daros de Luca
2023-12-20  4:24 ` [PATCH net-next v2 4/7] net: dsa: realtek: merge common and interface modules into realtek-dsa Luiz Angelo Daros de Luca
2023-12-20  4:24 ` [PATCH net-next v2 5/7] net: dsa: realtek: Migrate user_mii_bus setup to realtek-dsa Luiz Angelo Daros de Luca
2023-12-20  4:51   ` Luiz Angelo Daros de Luca
2023-12-21 17:47     ` Vladimir Oltean
2023-12-21 18:34       ` Arınç ÜNAL
2023-12-22 10:48         ` Vladimir Oltean
2023-12-22 11:13           ` Alvin Šipraga
2023-12-22 17:04             ` Arınç ÜNAL
2023-12-22 20:28               ` Luiz Angelo Daros de Luca
2023-12-22 20:59                 ` Arınç ÜNAL
2023-12-22 16:56           ` Arınç ÜNAL
2024-01-03 18:44             ` Vladimir Oltean
2024-01-05 18:43               ` Arınç ÜNAL
2023-12-22 20:03       ` Luiz Angelo Daros de Luca
2023-12-22 22:09         ` Vladimir Oltean [this message]
2023-12-22 22:12           ` Luiz Angelo Daros de Luca
2023-12-20 13:17   ` Alvin Šipraga
2023-12-21  3:03     ` Luiz Angelo Daros de Luca
2023-12-20  4:24 ` [PATCH net-next v2 6/7] net: dsa: realtek: embed dsa_switch into realtek_priv Luiz Angelo Daros de Luca
2023-12-20  4:24 ` [PATCH net-next v2 7/7] Revert "net: dsa: OF-ware slave_mii_bus" Luiz Angelo Daros de Luca
2023-12-20 13:19   ` Alvin Šipraga
2023-12-21  3:45     ` Luiz Angelo Daros de Luca
2023-12-21  0:41   ` kernel test robot
2023-12-21 15:21 ` [PATCH net-next v2 0/7] net: dsa: realtek: variants to drivers, interfaces to a common module Vladimir Oltean
2023-12-22 21:32   ` Luiz Angelo Daros de Luca

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=20231222220955.77j7nmvhbelv2t7a@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=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