Re: [PATCH] r8169: add support for RTL8127ATF

From: Michael Zimmermann

Date: Wed Nov 19 2025 - 02:00:12 EST


On Tue, Nov 18, 2025 at 11:01 PM Fabio Baltieri
<fabio.baltieri@xxxxxxxxx> wrote:
>
> On Tue, Nov 18, 2025 at 10:31:54PM +0100, Michael Zimmermann wrote:
> > One thing the out-of-tree driver does, which your patch doesn't do, is
> > disabling eee when in fiber mode. I'd suggest something like this:
> > @@ -845,7 +860,8 @@ static bool rtl_supports_eee(struct rtl8169_private *tp)
> > {
> > return tp->mac_version >= RTL_GIGA_MAC_VER_34 &&
> > tp->mac_version != RTL_GIGA_MAC_VER_37 &&
> > - tp->mac_version != RTL_GIGA_MAC_VER_39;
> > + tp->mac_version != RTL_GIGA_MAC_VER_39 &&
> > + !tp->fiber_enabled;
> > }
>
> Heya, don't I have exactly that diff in the patch? The second chunk
>
> @@ -842,7 +843,8 @@ static bool rtl_supports_eee(struct rtl8169_private *tp)
> {
> return tp->mac_version >= RTL_GIGA_MAC_VER_34 &&
> tp->mac_version != RTL_GIGA_MAC_VER_37 &&
> - tp->mac_version != RTL_GIGA_MAC_VER_39;
> + tp->mac_version != RTL_GIGA_MAC_VER_39 &&
> + !tp->fiber_mode;
> }

You're right, no idea how I missed that, sorry.

I've also done some testing with the out-of-tree driver:
- (my normal setup) a DAC between the rt8127 and a 10G switch works just fine.
- RJ45 10G modules on both sides works fine, but HwFiberModeVer stays
at 1 even after reloading the driver.
- RJ45 1G modules on both sides works after "ethtool -s enp1s0 speed
1000 duplex full autoneg on", but you have to do that while connected
via 10G because that driver is buggy and returns EINVAL otherwise.
HwFiberModeVer was 1 as well after reloading the driver.

What this means is that the fiber mode is always enabled on these
cards, which makes sense given that the out-of-tree driver only reads
it once when loading the driver. I guess it's either a hardware
variant, configured in the factory or detected using a pin of the
chip.
It also means that it doesn't matter to the linux driver what's
actually connected beyond the speed you want to use since - as others
have said before - this seems to be fully handled on the NIC.

Michael