diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2015-08-13 09:50:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-14 00:26:23 -0400 |
commit | 2a4eebf0c485d8e90bdd2e33e75c4b3b1e1673ac (patch) | |
tree | 875406933ff126cec1840cff5e3dd90a5a321133 | |
parent | 25b97c016b26039982daaa2c11d83979f93b71ab (diff) |
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>
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index 2b7610f341b0..10b3bbbbac8e 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -2102,6 +2102,11 @@ int startup_gfar(struct net_device *ndev) | |||
2102 | /* Start Rx/Tx DMA and enable the interrupts */ | 2102 | /* Start Rx/Tx DMA and enable the interrupts */ |
2103 | gfar_start(priv); | 2103 | gfar_start(priv); |
2104 | 2104 | ||
2105 | /* force link state update after mac reset */ | ||
2106 | priv->oldlink = 0; | ||
2107 | priv->oldspeed = 0; | ||
2108 | priv->oldduplex = -1; | ||
2109 | |||
2105 | phy_start(priv->phydev); | 2110 | phy_start(priv->phydev); |
2106 | 2111 | ||
2107 | enable_napi(priv); | 2112 | enable_napi(priv); |