Skip to content

Commit 2a4eebf

Browse files
claudiu-mdavem330
authored andcommitted
gianfar: Restore link state settings after MAC reset
There are some MAC registers that need to be kept in sync with the link state parameters, see adjust_link(). However, after a MAC soft reset default values for these registers are assumed. In some cases (excepting if down/ if up for example) adjust_link() does not see that these values were reset to default because the priv->old* link parameters were left unchanged. So, reset the priv->old* link params as well during a MAC reset to let adjust_link() restore the MAC link settings to the actual link state values. Fixes following case, for example: Setting link to 100M, changing MTU (implies MAC reset), link state remains unchanged to 100M but MAC registers were reset to default (1G) breaking the connectivity w/ the PHY. Closing and re-opening the interface would restore the MAC link parameters to the correct values. Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 25b97c0 commit 2a4eebf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/freescale/gianfar.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,6 +2102,11 @@ int startup_gfar(struct net_device *ndev)
21022102
/* Start Rx/Tx DMA and enable the interrupts */
21032103
gfar_start(priv);
21042104

2105+
/* force link state update after mac reset */
2106+
priv->oldlink = 0;
2107+
priv->oldspeed = 0;
2108+
priv->oldduplex = -1;
2109+
21052110
phy_start(priv->phydev);
21062111

21072112
enable_napi(priv);

0 commit comments

Comments
 (0)