]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
net: lan743x: fix duplex configuration in mac_link_up
authorThangaraj Samynathan <thangaraj.s@microchip.com>
Mon, 23 Mar 2026 06:53:45 +0000 (12:23 +0530)
committerJakub Kicinski <kuba@kernel.org>
Wed, 25 Mar 2026 03:48:25 +0000 (20:48 -0700)
The driver does not explicitly configure the MAC duplex mode when
bringing the link up. As a result, the MAC may retain a stale duplex
setting from a previous link state, leading to duplex mismatches with
the link partner and degraded network performance.

Update lan743x_phylink_mac_link_up() to set or clear the MAC_CR_DPX_
bit according to the negotiated duplex mode.

This ensures the MAC configuration is consistent with the phylink
resolved state.

Fixes: a5f199a8d8a03 ("net: lan743x: Migrate phylib to phylink")
Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20260323065345.144915-1-thangaraj.s@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/lan743x_main.c

index a3845edf0e48fa725e59347f00295423696fdae6..f0b5dd752f084f0f067aac59f1c670f16c75f84e 100644 (file)
@@ -3053,6 +3053,11 @@ static void lan743x_phylink_mac_link_up(struct phylink_config *config,
        else if (speed == SPEED_100)
                mac_cr |= MAC_CR_CFG_L_;
 
+       if (duplex == DUPLEX_FULL)
+               mac_cr |= MAC_CR_DPX_;
+       else
+               mac_cr &= ~MAC_CR_DPX_;
+
        lan743x_csr_write(adapter, MAC_CR, mac_cr);
 
        lan743x_ptp_update_latency(adapter, speed);