[openwrt/openwrt] realtek: pcs: select OFF mode with no links on SerDes

LEDE Commits lede-commits at lists.infradead.org
Sat Jan 3 08:00:45 PST 2026


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b63f68e409f2ec2ab04d84bf6bb4bcad3776d089

commit b63f68e409f2ec2ab04d84bf6bb4bcad3776d089
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Jan 2 18:50:10 2026 +0000

    realtek: pcs: select OFF mode with no links on SerDes
    
    Because the PCS driver keeps track of the number of registered links for
    each SerDes now, we now know when there is no link on a SerDes. In this
    case, determine to turn off the SerDes in the mode mapper.
    
    Though the phylink subsystem shouldn't attempt to config something
    different when no link/port references a Serdes, be on the safe side.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21365
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index bd19bd5fb2..06647938d2 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -287,6 +287,12 @@ static int rtpcs_sds_determine_hw_mode(struct rtpcs_serdes *sds,
 {
 	u8 n_links = sds->num_of_links;
 
+	/* turn off SerDes when there are no links */
+	if (!n_links) {
+		*hw_mode = RTPCS_SDS_MODE_OFF;
+		return 0;
+	}
+
 	switch (if_mode) {
 	case PHY_INTERFACE_MODE_NA:
 		*hw_mode = RTPCS_SDS_MODE_OFF;




More information about the lede-commits mailing list