netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>, "Andrew Lunn" <andrew@lunn.ch>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Alvin Šipraga" <alsi@bang-olufsen.dk>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Hauke Mehrtens" <hauke@hauke-m.de>,
	"Christian Marangi" <ansuelsmth@gmail.com>,
	"Arınç ÜNAL" <arinc.unal@arinc9.com>
Subject: Re: [PATCH net-next 05/10] net: dsa: qca8k: skip MDIO bus creation if its OF node has status = "disabled"
Date: Wed, 10 Jan 2024 18:35:51 +0200	[thread overview]
Message-ID: <20240110163551.ceemrjwfvavmodqi@skbuf> (raw)
In-Reply-To: <CAJq09z4--Ug+3FAmp=EimQ8HTQYOWOuVon-PUMGB5a1N=RPv4g@mail.gmail.com>

On Thu, Jan 04, 2024 at 11:19:20PM -0300, Luiz Angelo Daros de Luca wrote:
> Don't you still need to put the node that is not available? Just put
> it unconditionally whenever you exit this function after you get it.
> of_node_put() can handle even NULL.

You're right. I've prepared a patch to handle this case correctly.
I don't think it's worth sending to 'net' now that 'net-next' has
closed, because as you say below, it's quite possible that the
!of_device_is_available() code path is never exercised by existing
device trees. So the bug is like the tree that falls in the forest but
nobody hears it. I will submit the correction when net-next reopens,
together with Alvin's suggested "err" -> "ret" renaming.

> I'm not sure if this and other simple switches can be useful without a
> valid MDIO.

Will that always be the case? As implausible as this may sound, I've
received DSA questions from people using the sja1105 as a two-port
adapter between MII on the CPU side and RMII on the PHY side. It was the
cheapest way of adapting their SoC to RMII, using a switch as not even a
port multiplier. I see that AR8237 has 1x RGMII and 1x SerDes, so maybe
somebody would want to use it that way, and sidestep the internal PHYs?
I don't know.

> Anyway, wouldn't it be equivalent to having an empty mdio
> node? It looks like it would work as well but without a specific code
> path.

I guess you could also express this that way too. Although, in case it
matters, an 'empty node' has to pass schema validation (has to have all
required properties), and a disabled one doesn't.

The idea with this patch was to deliberately change the status = "disabled"
handling that the driver already had, to make things more consistent
across the board. Each driver binding has its own unique interpretation
of an absent MDIO OF node already. Some consider the OF node optional
and thus register it anyway, some say that absent means it's not needed.
But I think status = "disabled" should be an unambiguous way to specify
through DT that the hardware component is disabled. This is not how
qca8k was interpreting it prior to this change.

  reply	other threads:[~2024-01-10 16:35 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04 14:00 [PATCH net-next 00/10] ds->user_mii_bus cleanup (part 1) Vladimir Oltean
2024-01-04 14:00 ` [PATCH net-next 01/10] net: dsa: lantiq_gswip: delete irrelevant use of ds->phys_mii_mask Vladimir Oltean
2024-01-04 15:52   ` Alvin Šipraga
2024-01-04 17:07   ` Florian Fainelli
2024-01-04 14:00 ` [PATCH net-next 02/10] net: dsa: lantiq_gswip: use devres for internal MDIO bus, not ds->user_mii_bus Vladimir Oltean
2024-01-04 15:53   ` Alvin Šipraga
2024-01-04 17:36   ` Florian Fainelli
2024-01-05  2:43   ` Luiz Angelo Daros de Luca
2024-01-04 14:00 ` [PATCH net-next 03/10] net: dsa: lantiq_gswip: ignore MDIO buses disabled in OF Vladimir Oltean
2024-01-04 15:53   ` Alvin Šipraga
2024-01-04 17:36   ` Florian Fainelli
2024-01-04 14:00 ` [PATCH net-next 04/10] net: dsa: qca8k: put MDIO bus OF node on qca8k_mdio_register() failure Vladimir Oltean
2024-01-04 15:46   ` Alvin Šipraga
2024-01-04 17:20     ` Vladimir Oltean
2024-01-04 17:37   ` Florian Fainelli
2024-01-05  0:25   ` Luiz Angelo Daros de Luca
2024-01-04 14:00 ` [PATCH net-next 05/10] net: dsa: qca8k: skip MDIO bus creation if its OF node has status = "disabled" Vladimir Oltean
2024-01-04 15:44   ` Alvin Šipraga
2024-01-04 15:49     ` Vladimir Oltean
2024-01-04 16:04       ` Alvin Šipraga
2024-01-04 16:05   ` Alvin Šipraga
2024-01-04 17:38   ` Florian Fainelli
2024-01-05  2:19   ` Luiz Angelo Daros de Luca
2024-01-10 16:35     ` Vladimir Oltean [this message]
2024-01-04 14:00 ` [PATCH net-next 06/10] net: dsa: qca8k: assign ds->user_mii_bus only for the non-OF case Vladimir Oltean
2024-01-04 15:48   ` Alvin Šipraga
2024-01-04 17:35   ` Florian Fainelli
2024-01-05  2:35   ` Luiz Angelo Daros de Luca
2024-01-04 14:00 ` [PATCH net-next 07/10] net: dsa: qca8k: consolidate calls to a single devm_of_mdiobus_register() Vladimir Oltean
2024-01-04 15:49   ` Alvin Šipraga
2024-01-04 17:34   ` Florian Fainelli
2024-01-04 23:07   ` Christian Marangi
2024-01-05  2:26   ` Luiz Angelo Daros de Luca
2024-01-04 14:00 ` [PATCH net-next 08/10] net: dsa: qca8k: use "dev" consistently within qca8k_mdio_register() Vladimir Oltean
2024-01-04 15:50   ` Alvin Šipraga
2024-01-04 17:34   ` Florian Fainelli
2024-01-04 22:55   ` Christian Marangi
2024-01-05  2:21   ` Luiz Angelo Daros de Luca
2024-01-04 14:00 ` [PATCH net-next 09/10] net: dsa: bcm_sf2: stop assigning an OF node to the ds->user_mii_bus Vladimir Oltean
2024-01-04 15:59   ` Alvin Šipraga
2024-01-04 17:32   ` Florian Fainelli
2024-01-04 14:00 ` [PATCH net-next 10/10] net: dsa: bcm_sf2: drop priv->master_mii_dn Vladimir Oltean
2024-01-04 15:59   ` Alvin Šipraga
2024-01-04 17:32   ` Florian Fainelli
2024-01-05  2:48   ` Luiz Angelo Daros de Luca
2024-01-05 12:00 ` [PATCH net-next 00/10] ds->user_mii_bus cleanup (part 1) patchwork-bot+netdevbpf

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=20240110163551.ceemrjwfvavmodqi@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=arinc.unal@arinc9.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=hauke@hauke-m.de \
    --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).