From fe01435b6933756f4a916e4bccc409a88e3fcc56 Mon Sep 17 00:00:00 2001 From: Harshal Gohel Date: Wed, 13 Dec 2023 08:29:36 +0100 Subject: [PATCH] rtl83xx: dsa: Clear duplex bit correctly Without this, luci shows 10M full duplex when there is no link. So explicitly set half duplex and unknown speed. Acked-by: Simon Wunderlich Signed-off-by: Harshal Gohel --- target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c index 3b5af72dd6..0e1d64ae69 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c @@ -870,6 +870,8 @@ static void rtl93xx_phylink_mac_config(struct dsa_switch *ds, int port, if (state->duplex == DUPLEX_FULL) reg |= RTL930X_DUPLEX_MODE; + else + reg &= ~RTL930X_DUPLEX_MODE; /* Clear duplex bit otherwise */ if (priv->ports[port].phy_is_integrated) reg &= ~RTL930X_FORCE_EN; /* Clear MAC_FORCE_EN to allow SDS-MAC link */ -- 2.30.2