From: Daniel Golle <daniel@makrotopia.org>
Date: Mon, 5 Jan 2026 17:55:02 +0000
Subject: [PATCH] net: phy: realtek: rate-adapter in C22 mode

Use rate-adapter mode in case the PHY is connected to the host using
Clause-22 MDIO.

This is necessary because phylink only handles dynamically switching the
interface mode if the PHY is connected using Clause-45 MDIO.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/drivers/net/phy/realtek/realtek_main.c
+++ b/drivers/net/phy/realtek/realtek_main.c
@@ -1379,7 +1379,7 @@ static int rtl822x_set_serdes_option_mod
 		return 0;
 
 	/* determine SerDes option mode */
-	if (has_2500 && !has_sgmii) {
+	if (has_2500 && (!has_sgmii || !phydev->is_c45)) {
 		mode = RTL822X_VND1_SERDES_OPTION_MODE_2500BASEX;
 		phydev->rate_matching = RATE_MATCH_PAUSE;
 	} else {
