public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Fabio Baltieri <fabio.baltieri@gmail.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Daniel Golle <daniel@makrotopia.org>,
	Andrew Lunn <andrew@lunn.ch>, Andrew Lunn <andrew+netdev@lunn.ch>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Michael Klein <michael@fossekall.de>,
	Realtek linux nic maintainers <nic_swsd@realtek.com>,
	Aleksander Jan Bajkowski <olek2@wp.pl>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 1/2] net: phy: realtek: add PHY driver for RTL8127ATF
Date: Fri, 9 Jan 2026 09:43:50 +0000	[thread overview]
Message-ID: <aWDN1m3vI5YUiOee@google.com> (raw)
In-Reply-To: <fa9657f8-ec42-4476-bf4c-37db7b58ecac@gmail.com>

On Fri, Jan 09, 2026 at 08:36:10AM +0100, Heiner Kallweit wrote:
> On 1/8/2026 11:56 PM, Daniel Golle wrote:
> > On Thu, Jan 08, 2026 at 09:27:06PM +0100, Heiner Kallweit wrote:
> >> RTL8127ATF supports a SFP+ port for fiber modules (10GBASE-SR/LR/ER/ZR and
> >> DAC). The list of supported modes was provided by Realtek. According to the
> >> r8127 vendor driver also 1G modules are supported, but this needs some more
> >> complexity in the driver, and only 10G mode has been tested so far.
> >> Therefore mainline support will be limited to 10G for now.
> >> The SFP port signals are hidden in the chip IP and driven by firmware.
> >> Therefore mainline SFP support can't be used here.
> >> This PHY driver is used by the RTL8127ATF support in r8169.
> >> RTL8127ATF reports the same PHY ID as the TP version. Therefore use a dummy
> >> PHY ID.  This PHY driver is used by the RTL8127ATF support in r8169.
> >>
> >> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> >> ---
> >>  MAINTAINERS                            |  1 +
> >>  drivers/net/phy/realtek/realtek_main.c | 54 ++++++++++++++++++++++++++
> >>  include/linux/realtek_phy.h            |  7 ++++
> >>  3 files changed, 62 insertions(+)
> >>  create mode 100644 include/linux/realtek_phy.h
> >>
> >> diff --git a/MAINTAINERS b/MAINTAINERS
> >> index 765ad2daa21..6ede656b009 100644
> >> --- a/MAINTAINERS
> >> +++ b/MAINTAINERS
> >> @@ -9416,6 +9416,7 @@ F:	include/linux/phy_link_topology.h
> >>  F:	include/linux/phylib_stubs.h
> >>  F:	include/linux/platform_data/mdio-bcm-unimac.h
> >>  F:	include/linux/platform_data/mdio-gpio.h
> >> +F:	include/linux/realtek_phy.h
> >>  F:	include/trace/events/mdio.h
> >>  F:	include/uapi/linux/mdio.h
> >>  F:	include/uapi/linux/mii.h
> >> diff --git a/drivers/net/phy/realtek/realtek_main.c b/drivers/net/phy/realtek/realtek_main.c
> >> index eb5b540ada0..b57ef0ce15a 100644
> >> --- a/drivers/net/phy/realtek/realtek_main.c
> >> +++ b/drivers/net/phy/realtek/realtek_main.c
> >> @@ -16,6 +16,7 @@
> >>  #include <linux/module.h>
> >>  #include <linux/delay.h>
> >>  #include <linux/clk.h>
> >> +#include <linux/realtek_phy.h>
> >>  #include <linux/string_choices.h>
> >>  
> >>  #include "../phylib.h"
> >> @@ -2100,6 +2101,45 @@ static irqreturn_t rtl8221b_handle_interrupt(struct phy_device *phydev)
> >>  	return IRQ_HANDLED;
> >>  }
> >>  
> >> +static int rtlgen_sfp_get_features(struct phy_device *phydev)
> >> +{
> >> +	linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
> >> +			 phydev->supported);
> >> +
> >> +	/* set default mode */
> >> +	phydev->speed = SPEED_10000;
> >> +	phydev->duplex = DUPLEX_FULL;
> >> +
> >> +	phydev->port = PORT_FIBRE;
> >> +
> >> +	return 0;
> >> +}
> >> +
> >> +static int rtlgen_sfp_read_status(struct phy_device *phydev)
> >> +{
> >> +	int val, err;
> >> +
> >> +	err = genphy_update_link(phydev);
> >> +	if (err)
> >> +		return err;
> >> +
> >> +	if (!phydev->link)
> >> +		return 0;
> >> +
> >> +	val = rtlgen_read_vend2(phydev, RTL_VND2_PHYSR);
> > 
> > This should be the same as
> > phy_read(phydev, MII_RESV2); /* on page 0 */
> > Please try.
> > 
> 
> In case of an integrated PHY a phy_read() effectively is translated
> into a rtlgen_read_vend2(). So technically there's no benefit.
> 
> I don't have hw with RTL8127ATF, but maybe Fabio can test.

Yeah I tried it right away, just replaced the call and then added both
and logged the values, turned the interface down and up, they seem to be
returning the same value. Let me know if you want me to test some
condition in particular.

  reply	other threads:[~2026-01-09  9:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-08 20:25 [PATCH net-next 0/2] r8169: add support for RTL8127ATF (10G Fiber SFP) Heiner Kallweit
2026-01-08 20:27 ` [PATCH net-next 1/2] net: phy: realtek: add PHY driver for RTL8127ATF Heiner Kallweit
2026-01-08 22:56   ` Daniel Golle
2026-01-08 23:20     ` Fabio Baltieri
2026-01-09  1:26       ` Daniel Golle
2026-01-09 11:10         ` Heiner Kallweit
2026-01-10 14:59         ` Heiner Kallweit
2026-01-09  7:36     ` Heiner Kallweit
2026-01-09  9:43       ` Fabio Baltieri [this message]
2026-01-09  1:28   ` Jakub Kicinski
2026-01-09 11:18     ` Heiner Kallweit
2026-01-10 17:23     ` Heiner Kallweit
2026-01-10 18:57       ` Jakub Kicinski
2026-01-10 19:00         ` Jakub Kicinski
2026-01-10 20:40           ` Heiner Kallweit
2026-01-08 20:28 ` [PATCH net-next 2/2] r8169: add support for RTL8127ATF (Fiber SFP) Heiner Kallweit
2026-01-08 23:19   ` Fabio Baltieri

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=aWDN1m3vI5YUiOee@google.com \
    --to=fabio.baltieri@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=michael@fossekall.de \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=olek2@wp.pl \
    --cc=pabeni@redhat.com \
    --cc=vladimir.oltean@nxp.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