[openwrt/openwrt] realtek: need to handle PHY_INTERFACE_MODE_NA for sfps

LEDE Commits lede-commits at lists.infradead.org
Sun Apr 18 13:15:38 BST 2021


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/d9b3edef4d84df70a62795cbad2012acc2ee6cab

commit d9b3edef4d84df70a62795cbad2012acc2ee6cab
Author: Bjørn Mork <bjorn at mork.no>
AuthorDate: Sat Mar 13 17:45:50 2021 +0100

    realtek: need to handle PHY_INTERFACE_MODE_NA for sfps
    
    From the validate docs in include/linux/phylink.h:
    
     When state->interface is PHY_INTERFACE_MODE_NA, phylink expects the
     MAC driver to return all supported link modes.
    
    Tested-by: Birger Koblitz <mail at birger-koblitz.de>
    Signed-off-by: Bjørn Mork <bjorn at mork.no>
    (cherry picked from commit 785d830e889ba18793acf369e447d704269169af)
---
 target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c
index af6d92cbc2..2c49ea27a1 100644
--- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c
+++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c
@@ -245,6 +245,7 @@ static void rtl83xx_phylink_validate(struct dsa_switch *ds, int port,
 	pr_debug("In %s port %d", __func__, port);
 
 	if (!phy_interface_mode_is_rgmii(state->interface) &&
+	    state->interface != PHY_INTERFACE_MODE_NA &&
 	    state->interface != PHY_INTERFACE_MODE_1000BASEX &&
 	    state->interface != PHY_INTERFACE_MODE_MII &&
 	    state->interface != PHY_INTERFACE_MODE_REVMII &&



More information about the lede-commits mailing list