From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Florian Fainelli <f.fainelli@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>,
"Luiz Angelo Daros de Luca" <luizluca@gmail.com>,
"Alvin Šipraga" <alsi@bang-olufsen.dk>,
"Madhuri Sripada" <madhuri.sripada@microchip.com>,
"Marcin Wojtas" <mw@semihalf.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Tobias Waldekranz" <tobias@waldekranz.com>,
"Arun Ramadoss" <arun.ramadoss@microchip.com>,
"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
"Jonathan Corbet" <corbet@lwn.net>
Subject: Re: [PATCH net 3/4] docs: net: dsa: update user MDIO bus documentation
Date: Sat, 9 Dec 2023 03:22:02 +0200 [thread overview]
Message-ID: <20231209012202.tiawvab6qkbxosou@skbuf> (raw)
In-Reply-To: <f4e08518-290d-492f-89ea-31fea9974abe@gmail.com>
On Fri, Dec 08, 2023 at 02:36:40PM -0800, Florian Fainelli wrote:
> On 12/8/23 11:35, Vladimir Oltean wrote:
> > diff --git a/Documentation/networking/dsa/dsa.rst b/Documentation/networking/dsa/dsa.rst
> > index 676c92136a0e..2cd91358421e 100644
> > --- a/Documentation/networking/dsa/dsa.rst
> > +++ b/Documentation/networking/dsa/dsa.rst
> > @@ -397,19 +397,41 @@ perspective::
> > User MDIO bus
> > -------------
> > -In order to be able to read to/from a switch PHY built into it, DSA creates an
> > -user MDIO bus which allows a specific switch driver to divert and intercept
> > -MDIO reads/writes towards specific PHY addresses. In most MDIO-connected
> > -switches, these functions would utilize direct or indirect PHY addressing mode
> > -to return standard MII registers from the switch builtin PHYs, allowing the PHY
> > -library and/or to return link status, link partner pages, auto-negotiation
> > -results, etc.
> > +The framework creates an MDIO bus for user ports (``ds->user_mii_bus``) when
> > +both methods ``ds->ops->phy_read()`` and ``ds->ops->phy_write()`` are present.
> > +However, this pointer may also be populated by the switch driver during the
> > +``ds->ops->setup()`` method, with an MDIO bus managed by the driver.
> > +
> > +Its role is to permit user ports to connect to a PHY (usually internal) when
> > +the more general ``phy-handle`` property is unavailable (either because the
> > +MDIO bus is missing from the OF description, or because probing uses
> > +``platform_data``).
> > +
> > +In most MDIO-connected switches, these functions would utilize direct or
> > +indirect PHY addressing mode to return standard MII registers from the switch
> > +builtin PHYs, allowing the PHY library and/or to return link status, link
> > +partner pages, auto-negotiation results, etc.
>
> The "and/or" did not read really well with the reset of the sentence, maybe
> just drop those two words?
Fun fact, this is the second sentence from the existing text, moved
as-is a bit further down. Git blame on it says:
77760e94928f ("Documentation: networking: add a DSA document")
I do have the slight feeling that the paragraph is pitching sliced
bread (sorry). I did want to remove it completely, but I also wanted to
preserve a phrase about the direct/indirect thing.
How about replacing it with this?
Typically, the user MDIO bus accesses internal PHYs indirectly, by
reading and writing to the MDIO controller registers located in the
switch address space. Sometimes, especially if the switch is controlled
over MDIO by the host, its internal PHYs may also be accessible on the
same MDIO bus as the switch IP, but at a different MDIO address. In that
case, a direct access method for the internal PHYs is to implement the
MDIO access operations as diversions towards the parent MDIO bus of the
switch, at different MDIO addresses.
Conceivably, the direct access method could be extended to also target
external PHYs situated on the same MDIO bus as the switch, or on a
different MDIO bus entirely, referenced through ``platform_data``.
next prev parent reply other threads:[~2023-12-09 1:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 19:35 [PATCH net 0/4] Add some history to the DSA documentation Vladimir Oltean
2023-12-08 19:35 ` [PATCH net 1/4] docs: net: dsa: document the tagger-owned storage mechanism Vladimir Oltean
2023-12-08 22:15 ` Linus Walleij
2023-12-08 22:32 ` Florian Fainelli
2023-12-10 13:37 ` Alvin Šipraga
2023-12-08 19:35 ` [PATCH net 2/4] docs: net: dsa: update platform_data documentation Vladimir Oltean
2023-12-08 22:19 ` Linus Walleij
2023-12-09 0:52 ` Vladimir Oltean
2023-12-08 22:33 ` Florian Fainelli
2023-12-10 13:37 ` Alvin Šipraga
2023-12-08 19:35 ` [PATCH net 3/4] docs: net: dsa: update user MDIO bus documentation Vladimir Oltean
2023-12-08 22:22 ` Linus Walleij
2023-12-08 22:36 ` Florian Fainelli
2023-12-09 1:22 ` Vladimir Oltean [this message]
2023-12-09 21:49 ` Linus Walleij
2023-12-10 13:48 ` Alvin Šipraga
2023-12-11 14:35 ` Vladimir Oltean
2023-12-13 5:30 ` Luiz Angelo Daros de Luca
2023-12-13 12:06 ` Vladimir Oltean
2023-12-08 19:35 ` [PATCH net 4/4] docs: net: dsa: replace TODO section with info about history and devel ideas Vladimir Oltean
2023-12-08 22:40 ` Linus Walleij
2023-12-08 23:03 ` Florian Fainelli
2023-12-09 1:58 ` Vladimir Oltean
2023-12-11 17:29 ` Florian Fainelli
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=20231209012202.tiawvab6qkbxosou@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=alsi@bang-olufsen.dk \
--cc=andrew@lunn.ch \
--cc=arun.ramadoss@microchip.com \
--cc=corbet@lwn.net \
--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=madhuri.sripada@microchip.com \
--cc=mw@semihalf.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=tobias@waldekranz.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