netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Baltieri <fabio.baltieri@gmail.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: nic_swsd@realtek.com, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Michael Zimmermann <sigmaepsilon92@gmail.com>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] r8169: add support for RTL8127ATF
Date: Sun, 23 Nov 2025 18:41:26 +0000	[thread overview]
Message-ID: <aSNVVoAOQHbleZFF@google.com> (raw)
In-Reply-To: <b012587a-2c38-4597-9af9-3ba723ba6cba@gmail.com>

Hi Heiner,

On Sun, Nov 23, 2025 at 04:58:23PM +0100, Heiner Kallweit wrote:
> This is a version with better integration with phylib, and with 10G support only.
> Maybe I simplified the PHY/Serdes initialization too much, we'll see.
> A difference to your version is that via ethtool you now can and have to set autoneg to off.
> 
> I'd appreciate if you could give it a try and provide a full dmesg log and output of "ethtool <if>".
> 
> Note: This patch applies on top of net-next and linux-next. However, if you apply it on top
> of some other recent kernel version, conflicts should be easy to resolve.

Thanks for the patch, ran some initial tests, I'm on Linus tree for
other reasons but applied 3dc2a17efc5f, 1479493c91fc, 28c0074fd4b7 and
the recent suspend fix, then your patch applies cleanly.

Here's ethtool output:

# ethtool eth1
Settings for eth1:
        Supported ports: [  ]
        Supported link modes:   10000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 10000Mb/s
        Duplex: Full
        Auto-negotiation: off
        master-slave status: master
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        MDI-X: Unknown
        Supports Wake-on: pumbg
        Wake-on: d
        Link detected: yes

The phy is identified correctly:

[ 1563.678133] Realtek SFP PHY Mode r8169-1-500:00: attached PHY driver (mii_bus:phy_addr=r8169-1-500:00, irq=MAC)

That said I've observed two issues with the current patch:

1. the link on the other end is flapping, I've seen this while working
on the original patch and seems to be due to the EEE settings, it is
addressed by:

@@ -2439,7 +2439,10 @@ static void rtl8125a_config_eee_mac(struct rtl8169_private *tp)

 static void rtl8125b_config_eee_mac(struct rtl8169_private *tp)
 {
-       r8168_mac_ocp_modify(tp, 0xe040, 0, BIT(1) | BIT(0));
+       if (tp->sfp_mode)
+               r8168_mac_ocp_modify(tp, 0xe040, BIT(1) | BIT(0), 0);
+       else
+               r8168_mac_ocp_modify(tp, 0xe040, 0, BIT(1) | BIT(0));
 }

 static void rtl_rar_exgmac_set(struct rtl8169_private *tp, const u8 *addr)


2. the link is lost after a module reload or after an ip link down and
up, the driver logs "Link is Down" and stays there until the cable is
unplugged and re-plugged. This seems to be addressed by the code that
was in rtl8127_sds_phy_reset(), re-adding that code fixes it:

@@ -2477,6 +2480,13 @@ static void r8127_init_sfp_10g(struct rtl8169_private *tp)
 {
        int val;

+       RTL_W8(tp, 0x2350, RTL_R8(tp, 0x2350) & ~BIT(0));
+       udelay(1);
+
+       RTL_W16(tp, 0x233a, 0x801f);
+       RTL_W8(tp, 0x2350, RTL_R8(tp, 0x2350) | BIT(0));
+       udelay(10);
+
        RTL_W16(tp, 0x233a, 0x801a);
        RTL_W16(tp, 0x233e, (RTL_R16(tp, 0x233e) & ~0x3003) | 0x1000);

Guess the phy needs a reset after all.

With these two applied it seems to be working fine, tested suspend as
well.

Would you integrate these two or want to try me something different?

  parent reply	other threads:[~2025-11-23 18:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 19:50 [PATCH v2] r8169: add support for RTL8127ATF Fabio Baltieri
2025-11-20 20:55 ` Heiner Kallweit
2025-11-21 20:28   ` Fabio Baltieri
2025-11-23 15:58     ` Heiner Kallweit
2025-11-23 16:26       ` Michael Zimmermann
2025-11-23 16:59         ` Heiner Kallweit
2025-11-23 18:41       ` Fabio Baltieri [this message]
2025-11-23 22:54         ` Heiner Kallweit
2025-11-24  0:00           ` Fabio Baltieri
2025-12-03 22:11             ` Fabio Baltieri
2025-12-04  6:32               ` Heiner Kallweit
2025-12-29  4:18           ` FUKAUMI Naoki

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=aSNVVoAOQHbleZFF@google.com \
    --to=fabio.baltieri@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=pabeni@redhat.com \
    --cc=sigmaepsilon92@gmail.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).