From: Markus Stockhausen Date: Sun, 18 Jan 2026 11:58:51 +0000 (+0100) Subject: realtek: phy: save RTL8214FC extended page during power set X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=121f4d90d0b5febe288b09d41c0232b343788339;p=thirdparty%2Fopenwrt.git realtek: phy: save RTL8214FC extended page during power set Changing the fibre/copper power of a RTL8214FC changes the extended page via register 29. This is the write only companion of register 30. The register is afterwards overwritten to 0. Use the proper extended page register 30 and preserve its content during the operation. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/21582 Signed-off-by: Robert Marko --- diff --git a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c index 81fa9799fd2..8d0700d5ca0 100644 --- a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c +++ b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c @@ -466,14 +466,15 @@ static bool rtl8214fc_media_is_fibre(struct phy_device *phydev) static void rtl8214fc_power_set(struct phy_device *phydev, int port, bool on) { int page = port == PORT_FIBRE ? RTL821X_MEDIA_PAGE_FIBRE : RTL821X_MEDIA_PAGE_COPPER; + int oldxpage = __phy_read(phydev, RTL821XEXT_MEDIA_PAGE_SELECT); int pdown = on ? 0 : BMCR_PDOWN; phydev_info(phydev, "power %s %s\n", on ? "on" : "off", port == PORT_FIBRE ? "fibre" : "copper"); - phy_write(phydev, RTL821XINT_MEDIA_PAGE_SELECT, page); + phy_write(phydev, RTL821XEXT_MEDIA_PAGE_SELECT, page); phy_modify_paged(phydev, RTL821X_PAGE_POWER, 0x10, BMCR_PDOWN, pdown); - phy_write(phydev, RTL821XINT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_AUTO); + phy_write(phydev, RTL821XEXT_MEDIA_PAGE_SELECT, oldxpage); } static int rtl8214fc_suspend(struct phy_device *phydev)