From: Vladimir Oltean <olteanv@gmail.com>
To: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: netdev@vger.kernel.org, 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, arinc.unal@arinc9.com, ansuelsmth@gmail.com
Subject: Re: [PATCH net-next v4 09/11] net: dsa: realtek: migrate user_mii_bus setup to realtek-dsa
Date: Mon, 29 Jan 2024 17:19:06 +0200 [thread overview]
Message-ID: <20240129151906.a6oeyh7qyq7c3ow4@skbuf> (raw)
In-Reply-To: <CAJq09z5KJE1D=gCd5WX_B26FxYN_eGn7LwENwNQZ0BSe7aDwOA@mail.gmail.com>
On Sun, Jan 28, 2024 at 11:49:42PM -0300, Luiz Angelo Daros de Luca wrote:
> Using mii_bus will also prevent an easy way for the driver to query
> those registers (although not used anymore after ds_switch_ops
> .phy_read/write are gone)
Exactly, there is no other remaining call to priv->ops->phy_read() and
priv->ops->phy_write(), so their prototypes can be tailored such that
they need no extra adapter.
> I guess the best approach is to append something that identifies the
> other mdio bus, for example ":user_mii". The result is something like
> this:
>
> mdio-bus:1d
> mdio-bus:1d:user_mii:00
> mdio-bus:1d:user_mii:01
> ...
>
> Or, for SMI:
>
> switch:user_mii:00
> switch:user_mii:01
> ...
This looks good.
>
> It is good enough for me as these switches have only one MDIO bus.
>
> We could also bring up some kind of a general suggestion for naming
> user_mii buses. In that case, we should be prepared for multiple mdio
> buses and the mdio node name+@unit (%pOFP) might be appropriate. We
> would get something like this:
>
> mdio-bus:1d:mdio:00
> mdio-bus:1d:mdio:01
>
> Or, for SMI:
>
> switch:mdio:00
> switch:mdio:01
>
> If there are multiple MDIO buses, it will be mdio@N (not tested).
>
> mdio-bus:1d:mdio@0:00
> mdio-bus:1d:mdio@0:01
> ...
> mdio-bus:1d:mdio@1:00
> mdio-bus:1d:mdio@1:01
> ...
SJA1110 has 2 MDIO buses and they are named:
snprintf(bus->id, MII_BUS_ID_SIZE, "%s-base-tx",
dev_name(priv->ds->dev));
snprintf(bus->id, MII_BUS_ID_SIZE, "%s-base-t1",
dev_name(priv->ds->dev));
which I think is more descriptive, because in its case, the indices in
"mdio@0" and "mdio@1" are arbitrary numbers.
I don't think we'll find a way to unify the naming convention across the
board. Let's use dev_name(dev) + "-some-driver-specific-qualifier" here,
and hopefully also as a convention from now on.
> I also considered %pOFf but it gives a more verbose device name
> without adding too much useful information:
>
> !ethernet@10100000!mdio-bus!switch1@29:00
> !ethernet@10100000!mdio-bus!switch1@29:01
> !ethernet@10100000!mdio-bus!switch1@29:02
>
> And I'm reluctant to add those "!" as they may not play nice with some
> non-ideal scripts reading sysfs. I would, at least, replace them with
> ":" .
I'm also not in love with the exclamation marks that the sysfs code has
to use, to replace the forward slashes that can't be represented in the
filesystem.
next prev parent reply other threads:[~2024-01-29 15:19 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 21:55 [PATCH net-next v4 00/11] net: dsa: realtek: variants to drivers, interfaces to a common module Luiz Angelo Daros de Luca
2024-01-23 21:55 ` [PATCH net-next v4 01/11] net: dsa: realtek: drop cleanup from realtek_ops Luiz Angelo Daros de Luca
2024-01-23 21:55 ` [PATCH net-next v4 02/11] net: dsa: realtek: introduce REALTEK_DSA namespace Luiz Angelo Daros de Luca
2024-01-25 10:02 ` Vladimir Oltean
2024-01-29 16:09 ` Florian Fainelli
2024-01-23 21:55 ` [PATCH net-next v4 03/11] net: dsa: realtek: convert variants into real drivers Luiz Angelo Daros de Luca
2024-01-24 19:19 ` Jakub Kicinski
2024-01-25 10:25 ` Vladimir Oltean
2024-01-28 23:34 ` Luiz Angelo Daros de Luca
2024-01-29 16:21 ` Vladimir Oltean
2024-01-23 21:55 ` [PATCH net-next v4 04/11] net: dsa: realtek: keep variant reference in realtek_priv Luiz Angelo Daros de Luca
2024-01-25 10:26 ` Vladimir Oltean
2024-01-29 16:10 ` Florian Fainelli
2024-01-29 17:36 ` Luiz Angelo Daros de Luca
2024-01-23 21:55 ` [PATCH net-next v4 05/11] net: dsa: realtek: common rtl83xx module Luiz Angelo Daros de Luca
2024-01-25 10:45 ` Vladimir Oltean
2024-01-29 0:09 ` Luiz Angelo Daros de Luca
2024-01-29 16:18 ` Vladimir Oltean
2024-01-26 23:19 ` kernel test robot
2024-01-23 21:55 ` [PATCH net-next v4 06/11] net: dsa: realtek: merge rtl83xx and interface modules into realtek-dsa Luiz Angelo Daros de Luca
2024-01-25 11:00 ` Vladimir Oltean
2024-01-29 16:13 ` Florian Fainelli
2024-01-23 21:55 ` [PATCH net-next v4 07/11] net: dsa: realtek: get internal MDIO node by name Luiz Angelo Daros de Luca
2024-01-29 16:11 ` Florian Fainelli
2024-01-23 21:56 ` [PATCH net-next v4 08/11] net: dsa: realtek: clean user_mii_bus setup Luiz Angelo Daros de Luca
2024-01-25 11:17 ` Vladimir Oltean
2024-01-29 2:12 ` Luiz Angelo Daros de Luca
2024-01-29 16:15 ` Vladimir Oltean
2024-01-29 16:22 ` Florian Fainelli
2024-01-29 16:43 ` Vladimir Oltean
2024-01-29 16:54 ` Florian Fainelli
2024-01-30 14:40 ` Arınç ÜNAL
2024-01-30 15:02 ` Andrew Lunn
2024-01-30 18:17 ` Luiz Angelo Daros de Luca
2024-01-23 21:56 ` [PATCH net-next v4 09/11] net: dsa: realtek: migrate user_mii_bus setup to realtek-dsa Luiz Angelo Daros de Luca
2024-01-25 16:05 ` Vladimir Oltean
2024-01-29 2:49 ` Luiz Angelo Daros de Luca
2024-01-29 15:19 ` Vladimir Oltean [this message]
2024-01-23 21:56 ` [PATCH net-next v4 10/11] net: dsa: realtek: use the same mii bus driver for both interfaces Luiz Angelo Daros de Luca
2024-01-23 21:56 ` [PATCH net-next v4 11/11] net: dsa: realtek: embed dsa_switch into realtek_priv 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=20240129151906.a6oeyh7qyq7c3ow4@skbuf \
--to=olteanv@gmail.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=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