[openwrt/openwrt] kernel: net: phy: c45: check validity of 10GbE LPA

LEDE Commits lede-commits at lists.infradead.org
Tue Jan 6 17:31:42 PST 2026


dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/96ff31b94acc5da50fb3caeccfe6f4abdd7c903b

commit 96ff31b94acc5da50fb3caeccfe6f4abdd7c903b
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sat Jan 3 21:05:35 2026 +0000

    kernel: net: phy: c45: check validity of 10GbE LPA
    
    Only use link-partner advertisement bits for 10GbE modes if they are
    actually valid. Check LOCALOK and REMOTEOK bits and clear 10GbE modes
    unless both of them are set.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 ...-c45-check-validity-of-10GbE-link-partner.patch | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/target/linux/generic/pending-6.12/713-net-phy-c45-check-validity-of-10GbE-link-partner.patch b/target/linux/generic/pending-6.12/713-net-phy-c45-check-validity-of-10GbE-link-partner.patch
new file mode 100644
index 0000000000..5870dfb2ba
--- /dev/null
+++ b/target/linux/generic/pending-6.12/713-net-phy-c45-check-validity-of-10GbE-link-partner.patch
@@ -0,0 +1,29 @@
+From 7d719484930bc10c8472c0d43b94b68087541b24 Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel at makrotopia.org>
+Date: Sat, 22 Apr 2023 01:25:39 +0100
+Subject: [PATCH] net: phy: c45: check validity of 10GbE link-partner
+ advertisement
+
+Only use link-partner advertisement bits for 10GbE modes if they are
+actually valid. Check LOCALOK and REMOTEOK bits and clear 10GbE modes
+unless both of them are set.
+
+Signed-off-by: Daniel Golle <daniel at makrotopia.org>
+--- a/include/linux/mdio.h
++++ b/include/linux/mdio.h
+@@ -323,8 +323,14 @@ static inline u32 linkmode_adv_to_mii_10
+  * to linkmode advertisement settings. Other bits in advertising aren't changed.
+  */
+ static inline void mii_10gbt_stat_mod_linkmode_lpa_t(unsigned long *advertising,
+-						     u32 lpa)
++						     u32 lpa_in)
+ {
++	u32 lpa = lpa_in;
++
++	if (!(lpa & MDIO_AN_10GBT_STAT_REMOK) ||
++	    !(lpa & MDIO_AN_10GBT_STAT_LOCOK))
++		lpa = 0;
++
+ 	linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
+ 			 advertising, lpa & MDIO_AN_10GBT_STAT_LP2_5G);
+ 	linkmode_mod_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,




More information about the lede-commits mailing list