[openwrt/openwrt] realtek: phy: save RTL8214FC extended page during power set

LEDE Commits lede-commits at lists.infradead.org
Sat Jan 24 02:44:14 PST 2026


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/121f4d90d0b5febe288b09d41c0232b343788339

commit 121f4d90d0b5febe288b09d41c0232b343788339
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Sun Jan 18 12:58:51 2026 +0100

    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 <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21582
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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 81fa9799fd..8d0700d5ca 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)




More information about the lede-commits mailing list