realtek: need to handle PHY_INTERFACE_MODE_NA for sfps
authorBjørn Mork <bjorn@mork.no>
Sat, 13 Mar 2021 16:45:50 +0000 (17:45 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 18 Apr 2021 10:06:27 +0000 (12:06 +0200)
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@birger-koblitz.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 785d830e889ba18793acf369e447d704269169af)

target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/dsa.c

index af6d92cbc221b6b1090df47e235fe17cb00dc806..2c49ea27a1672019602afcfb19b88ded2cbda8cf 100644 (file)
@@ -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 &&