Re: [PATCH net-next v2 3/4] net: phy: realtek: add support for RTL8261C_CG
From: Nicolai Buchwitz
Date: Thu Jun 04 2026 - 05:08:55 EST
Hi Javen
On 4.6.2026 09:42, javen wrote:
From: Javen Xu <javen_xu@xxxxxxxxxxxxxx>
This patch adds support for Realtek phy chip RTL8261C_CG. Its PHY ID is
0x001cc898.
Signed-off-by: Javen Xu <javen_xu@xxxxxxxxxxxxxx>
---
Changes in v2:
- remove RTL8261D, only support RTL8261C_CG
- remove speed 500, rarely used
- add helper function, genphy_c45_soft_reset() and genphy_c45_config_master_slave()
---
drivers/net/phy/realtek/realtek_main.c | 178 +++++++++++++++++++++++++
1 file changed, 178 insertions(+)
diff --git a/drivers/net/phy/realtek/realtek_main.c b/drivers/net/phy/realtek/realtek_main.c
[...]
+
+#define RTL8261C_CE_MODEL 0x00
+#define RTL8261X_GBCR_REG 0xa412
IMHO this is just RTL822X_VND2_C22_REG(MII_CTRL1000) (= 0xa412), already
used elsewhere in the file. Drop the define and reuse the macro, as
Aleksander suggested on v1.
[...]
+struct rtl8261x_priv {
+ u8 sub_phy_id;
+};
sub_phy_id is only written, never read. Andrew already asked about the
unused priv fields on v1. A local in probe() is enough, drop the field?
[...]
+
+ if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
+ phydev->advertising))
+ adv_1g = ADVERTISE_1000FULL;
+
+ ret = phy_modify_mmd_changed(phydev, MDIO_MMD_VEND2,
+ RTL8261X_GBCR_REG,
+ ADVERTISE_1000FULL, adv_1g);
See above and replace with RTL822X_VND2_C22_REG(MII_CTRL1000).
The aneg-restart handling looks correct now, thanks for picking up the v1
comment.
[...]
Thanks,
Nicolai