]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path
authorOleksij Rempel <o.rempel@pengutronix.de>
Thu, 6 Aug 2026 13:47:16 +0000 (15:47 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 10 Aug 2026 23:05:05 +0000 (16:05 -0700)
In rtlgen_write_mmd(), the MDIO_AN_EEE_ADV case swaps the arguments to
rtlgen_write_vend2(): it passes the MMD register number as the OCP address
and the OCP address constant as the value. The caller's value is discarded
and the write lands on the wrong register, so the EEE advertisement cannot
be configured on the affected PHYs.

Mirror rtlgen_read_mmd() and write the value to RTL_MDIO_AN_EEE_ADV.

Fixes: da681ed73fb9 ("net: phy: realtek: improve mmd register access for internal PHY's")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Link: https://patch.msgid.link/20260806134716.3511821-1-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/realtek/realtek_main.c

index b65d0f5fa1a014bac736a418f8745a34b320683c..0d2321bd18c84020aaf71831f74830ebf17396ce 100644 (file)
@@ -1370,7 +1370,7 @@ static int rtlgen_write_mmd(struct phy_device *phydev, int devnum, u16 regnum,
        if (devnum == MDIO_MMD_VEND2)
                ret = rtlgen_write_vend2(phydev, regnum, val);
        else if (devnum == MDIO_MMD_AN && regnum == MDIO_AN_EEE_ADV)
-               ret = rtlgen_write_vend2(phydev, regnum, RTL_MDIO_AN_EEE_ADV);
+               ret = rtlgen_write_vend2(phydev, RTL_MDIO_AN_EEE_ADV, val);
        else
                ret = -EOPNOTSUPP;