net: phy: realtek: Clear MDIO_AN_10GBT_CTRL_ADV10G bit
Subsystems (4)
PATCH v2 1/1 net: phy: realtek: Clear MDIO_AN_10GBT_CTRL_ADV10G bit
On RTL8127A connected to a link partner that advertises 10000baseT speed cannot be changed to anything other than 10000baseT as 10GbE is always advertised regardless of any setting. Fix this by clearing MDIO_AN_10GBT_CTRL_ADV10G bit in rtl822x_config_aneg()'s call to phy_modify_mmd_changed().
---
v2: Patch formalities (rebase, tree name, tags, ccs)
drivers/net/phy/realtek/realtek_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/phy/realtek/realtek_main.c +2 -1
@@ -1802,7 +1802,8 @@ static int rtl822x_config_aneg(struct phy_device *phydev) ret =phy_modify_mmd_changed (phydev,MDIO_MMD_VEND2 ,RTL_MDIO_AN_10GBT_CTRL ,MDIO_AN_10GBT_CTRL_ADV2_5G | -MDIO_AN_10GBT_CTRL_ADV5G , adv); +MDIO_AN_10GBT_CTRL_ADV5G | +MDIO_AN_10GBT_CTRL_ADV10G , adv);if (ret <0 )return ret; }
Signature · 1 line
2.54.0
Quoted 3 lines
Von: Jan Klos <[email protected]>
Gesendet: Samstag, 20. Juni 2026 03:20
Betreff: [PATCH net v2] net: phy: realtek: ClearMDIO_AN_10GBT_CTRL_ADV10G
bit
Quoted 6 lines
On RTL8127A connected to a link partner that advertises 10000baseT speed cannot be changed to anything other than 10000baseT as 10GbE is always advertised regardless of any setting. Fix this by clearing
MDIO_AN_10GBT_CTRL_ADV10Gbit in rtl822x_config_aneg()'s call tophy_modify_mmd_changed().
As you are enhancing the mask, shouldn't this be "... by respecting ..."?
Markus
Quoted 12 lines · Markus Stockhausen
Quoted 4 lines
Von: Jan Klos <[email protected]>
Gesendet: Samstag, 20. Juni 2026 03:20
Betreff: [PATCH net v2] net: phy: realtek: ClearMDIO_AN_10GBT_CTRL_ADV10Gbit
Quoted 6 lines
On RTL8127A connected to a link partner that advertises 10000baseT speed cannot be changed to anything other than 10000baseT as 10GbE is always advertised regardless of any setting. Fix this by clearing
MDIO_AN_10GBT_CTRL_ADV10Gbit in rtl822x_config_aneg()'s call tophy_modify_mmd_changed().
Quoted 4 lines
As you are enhancing the mask, shouldn't this be "... by respecting ..."?
Markus
I don't think so, in (__)phy_modify_mmd_changed() the mask is really used to clear MMD register bits from old register value before setting new bits in set:
* @mask: bit mask of bits to clear
* @set: new value of bits set in mask to write to @regnum
*
* Unlocked helper function which allows a MMD register to be modified as
* new register value = (old register value & ~mask) | set
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Sat, 20 Jun 2026 03:19:53 +0200 you wrote:
On RTL8127A connected to a link partner that advertises 10000baseT speed cannot be changed to anything other than 10000baseT as 10GbE is always advertised regardless of any setting. Fix this by clearing
MDIO_AN_10GBT_CTRL_ADV10Gbit in rtl822x_config_aneg()'s call tophy_modify_mmd_changed().Fixes 83d962316128 ("net: phy: realtek: add RTL8127-internal PHY")Reviewed-by Maxime Chevallier <[email protected]>Signed-off-by Jan Klos <[email protected]>[...]
Here is the summary with links:
- [net,v2] net: phy: realtek: Clear MDIO_AN_10GBT_CTRL_ADV10G bit
https://git.kernel.org/netdev/net/c/510a283f4d12
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Hello,
now thinking of it, I think this should make it into stable - RTL8127 is supported since 6.16, so I think it should go into 6.18, 7.0 & 7.1.
The mainline commit is 510a283f4d12367a3f811f382a2c89202954bbd1 .
Regards,
Jan Klos
Quoted 33 lines · Jan Klos
On RTL8127A connected to a link partner that advertises 10000baseT speed cannot be changed to anything other than 10000baseT as 10GbE is always advertised regardless of any setting. Fix this by clearing
MDIO_AN_10GBT_CTRL_ADV10Gbit in rtl822x_config_aneg()'s call tophy_modify_mmd_changed().Fixes 83d962316128 ("net: phy: realtek: add RTL8127-internal PHY")Reviewed-by Maxime Chevallier <[email protected]>Signed-off-by Jan Klos <[email protected]>---
v2: Patch formalities (rebase, tree name, tags, ccs)drivers/net/phy/realtek/realtek_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/phy/realtek/realtek_main.c +2
-2@@ -1802,7 +1802,8 @@ static int rtl822x_config_aneg(struct phy_device *phydev) ret =phy_modify_mmd_changed (phydev,MDIO_MMD_VEND2 ,RTL_MDIO_AN_10GBT_CTRL ,MDIO_AN_10GBT_CTRL_ADV2_5G | -MDIO_AN_10GBT_CTRL_ADV5G , adv); +MDIO_AN_10GBT_CTRL_ADV5G | +MDIO_AN_10GBT_CTRL_ADV10G , adv);if (ret <0 )return ret; } --2.54.0