From: Andrew Lunn <andrew@lunn.ch>
To: Yibo Dong <dong100@mucse.com>
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
yaojun@mucse.com
Subject: Re: [PATCH net-next v2 2/5] net: rnpgbe: Report link settings through ethtool
Date: Tue, 17 Nov 2026 14:21:46 +0100 [thread overview]
Message-ID: <edd0589c-1a48-44a6-ad15-b9133ee4f751@lunn.ch> (raw)
In-Reply-To: <72676011073A7040+20261117025526.GA214154@nic-Precision-5820-Tower>
On Tue, Nov 17, 2026 at 10:55:26AM +0800, Yibo Dong wrote:
> On Tue, Nov 17, 2026 at 02:54:45AM +0100, Andrew Lunn wrote:
> > On Tue, Nov 17, 2026 at 09:49:02AM +0800, Yibo Dong wrote:
> > > On Mon, Nov 16, 2026 at 02:18:28PM +0100, Andrew Lunn wrote:
> > > > > link, speed, duplex and mdix are updated asynchronously by
> > > > > the mailbox event handler, outside RTNL. link_lock protects these updates
> > > > > and provides a consistent snapshot in the getter.
> > > >
> > > > O.K, thanks for the explanation.
> > > >
> > > > I removed too much context, so i cannot see here. What about
> > > > lp_advertising? That also comes from the firmware, reported on link up
> > > > when autoneg completes.
> > > >
> > > The firmware manages autonegotiation and reports the negotiated speed
> > > and duplex through mailbox link events. However, the current mailbox
> > > interface does not expose the link partner's advertisement bitmap.
> > >
> > > Therefore, lp_advertising is currently left zero to indicate that this
> > > information is unknown to the driver.
> > >
> > > If reporting lp_advertising is must, we would need to add a new
> > > firmware mailbox command to retrieve the link partner's advertisement,
> > > or add lp_advertising to link-event mbx alongwith link, speed and
> > > duplex.
> >
> > It is not a must, but it is useful.
> >
> > Or you can just throw away your firmware, expose the MDIO bus, and let
> > phylink drive the hardware. Less code, less bugs, more functionality
> > for free.
> The GMAC provides MDIO register access, so exposing an MDIO bus is
> technically possible. However, the firmware currently manages the PHY,
> and its interface does not provide a PHY ownership handover mechanism.
> Introducing host-side PHY management would require coordinated firmware
> and driver changes to avoid independently configuring the same PHY.
>
> In addition, on this SoC, the firmware configures MDI/MDI-X through
> AXI-mapped control registers driving the PHY's pi_force_mdix_en and
> pi_force_mdix_mode inputs. This control path is outside the PHY's MDIO
> register interface.
>
> The firmware also supports link management before the host driver is
> loaded and while the host is shut down, including wake-up handling.
> On OCP platforms, it supports preserving the PHY link across driver
> reloads and host shutdown. These capabilities are already implemented
> in firmware, although driver support for them is not included in this
> series. Any future ownership handover would need to preserve them.
>
> Would it be acceptable for this series to retain the firmware-managed
> PHY design without registering an MDIO bus, and leave lp_advertising
> zero for now? If a mailbox command is added to expose the link partner's
> advertisement, we can populate lp_advertising in a follow-up patch.
You have not implemented anything special, other systems offer the
same features, using phylink. However, it is fine to implement it all
your own, rather than reuse existing software. SoC devices tend to
make use of Linux to do all this, and PCIe devices tend to reinvent
the wheel and do it in firmware. We are happy either way.
Andrew
next prev parent reply other threads:[~2026-11-17 13:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 3:09 [PATCH net-next v2 0/5] net: rnpgbe: Add basic management and statistics Dong Yibo
2026-11-16 3:10 ` [PATCH net-next v2 1/5] net: rnpgbe: Add basic ethtool support Dong Yibo
2026-11-16 3:10 ` [PATCH net-next v2 2/5] net: rnpgbe: Report link settings through ethtool Dong Yibo
2026-11-16 4:19 ` Andrew Lunn
2026-11-16 4:47 ` Yibo Dong
2026-11-16 13:18 ` Andrew Lunn
2026-11-17 1:49 ` Yibo Dong
2026-11-17 1:54 ` Andrew Lunn
2026-11-17 2:55 ` Yibo Dong
2026-11-17 13:21 ` Andrew Lunn [this message]
2026-11-18 1:17 ` Yibo Dong
2026-11-19 15:09 ` netdev-bot+sashiko
2026-11-16 3:10 ` [PATCH net-next v2 3/5] net: rnpgbe: Support copper link configuration Dong Yibo
2026-11-19 15:09 ` netdev-bot+sashiko
2026-11-16 3:10 ` [PATCH net-next v2 4/5] net: rnpgbe: Allow changing the primary MAC address Dong Yibo
2026-11-16 3:10 ` [PATCH net-next v2 5/5] net: rnpgbe: Add hardware and queue statistics Dong Yibo
2026-11-19 15:09 ` netdev-bot+sashiko
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=edd0589c-1a48-44a6-ad15-b9133ee4f751@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dong100@mucse.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yaojun@mucse.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
all inboxes | Powered by JetHome®