Message ID | 20240802080403.739509-2-paweldembicki@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: dsa: vsc73xx: fix MDIO bus access and PHY operations | expand |
On Fri, Aug 2, 2024 at 10:04 AM Pawel Dembicki <paweldembicki@gmail.com> wrote: > According to the datasheet description ("Port Mode Procedure" in 5.6.2), > the VSC73XX_MAC_CFG_WEXC_DIS bit is configured only for half duplex mode. > > The WEXC_DIS bit is responsible for MAC behavior after an excessive > collision. Let's set it as described in the datasheet. > > Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Good catch! Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
On 8/2/24 01:03, Pawel Dembicki wrote: > According to the datasheet description ("Port Mode Procedure" in 5.6.2), > the VSC73XX_MAC_CFG_WEXC_DIS bit is configured only for half duplex mode. > > The WEXC_DIS bit is responsible for MAC behavior after an excessive > collision. Let's set it as described in the datasheet. > > Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
On Fri, Aug 02, 2024 at 10:03:58AM +0200, Pawel Dembicki wrote: > According to the datasheet description ("Port Mode Procedure" in 5.6.2), > the VSC73XX_MAC_CFG_WEXC_DIS bit is configured only for half duplex mode. > > The WEXC_DIS bit is responsible for MAC behavior after an excessive > collision. Let's set it as described in the datasheet. > > Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> > --- > This patch came from net-next series[0]. > Changes since net-next: > - rebased to netdev/main only Since this is targeting net, a fixes tag would still be good. If nothing else it prevents somebody trying to backport it to linux 2.6.39 :-) Andrew
diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c index d9d3e30fd47a..f548ed4cb23f 100644 --- a/drivers/net/dsa/vitesse-vsc73xx-core.c +++ b/drivers/net/dsa/vitesse-vsc73xx-core.c @@ -957,6 +957,11 @@ static void vsc73xx_mac_link_up(struct phylink_config *config, if (duplex == DUPLEX_FULL) val |= VSC73XX_MAC_CFG_FDX; + else + /* In datasheet description ("Port Mode Procedure" in 5.6.2) + * this bit is configured only for half duplex. + */ + val |= VSC73XX_MAC_CFG_WEXC_DIS; /* This routine is described in the datasheet (below ARBDISC register * description) @@ -967,7 +972,6 @@ static void vsc73xx_mac_link_up(struct phylink_config *config, get_random_bytes(&seed, 1); val |= seed << VSC73XX_MAC_CFG_SEED_OFFSET; val |= VSC73XX_MAC_CFG_SEED_LOAD; - val |= VSC73XX_MAC_CFG_WEXC_DIS; /* Those bits are responsible for MTU only. Kernel takes care about MTU, * let's enable +8 bytes frame length unconditionally.
According to the datasheet description ("Port Mode Procedure" in 5.6.2), the VSC73XX_MAC_CFG_WEXC_DIS bit is configured only for half duplex mode. The WEXC_DIS bit is responsible for MAC behavior after an excessive collision. Let's set it as described in the datasheet. Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> --- This patch came from net-next series[0]. Changes since net-next: - rebased to netdev/main only [0] https://patchwork.kernel.org/project/netdevbpf/patch/20240729210615.279952-6-paweldembicki@gmail.com/ --- drivers/net/dsa/vitesse-vsc73xx-core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)