diff options
author | Kostya Belezko <bkostya@hotmail.com> | 2014-12-30 12:27:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-02 15:45:10 -0500 |
commit | c484994eb317f24693fbed6084cf1b4d984ffd3b (patch) | |
tree | e295756d99f27537bb652d129c45e3072e646b2a | |
parent | 2b972acbe5dccbba0e6dc74b51b3d4cfb2f11e5c (diff) |
Altera TSE: Add missing phydev
Altera network device doesn't come up after
ifconfig eth0 down
ifconfig eth0 up
The reason behind is clearing priv->phydev during tse_shutdown().
The phydev is not restored back at tse_open().
Resubmiting as to follow Tobias Klauser suggestion.
phy_start/phy_stop are called on each ifup/ifdown and
phy_disconnect is called once during the module removal.
Signed-off-by: Kostya Belezko <bkostya@hotmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/altera/altera_tse_main.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index 3498760dc22a..760c72c6e2ac 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c | |||
@@ -1170,10 +1170,6 @@ tx_request_irq_error: | |||
1170 | init_error: | 1170 | init_error: |
1171 | free_skbufs(dev); | 1171 | free_skbufs(dev); |
1172 | alloc_skbuf_error: | 1172 | alloc_skbuf_error: |
1173 | if (priv->phydev) { | ||
1174 | phy_disconnect(priv->phydev); | ||
1175 | priv->phydev = NULL; | ||
1176 | } | ||
1177 | phy_error: | 1173 | phy_error: |
1178 | return ret; | 1174 | return ret; |
1179 | } | 1175 | } |
@@ -1186,12 +1182,9 @@ static int tse_shutdown(struct net_device *dev) | |||
1186 | int ret; | 1182 | int ret; |
1187 | unsigned long int flags; | 1183 | unsigned long int flags; |
1188 | 1184 | ||
1189 | /* Stop and disconnect the PHY */ | 1185 | /* Stop the PHY */ |
1190 | if (priv->phydev) { | 1186 | if (priv->phydev) |
1191 | phy_stop(priv->phydev); | 1187 | phy_stop(priv->phydev); |
1192 | phy_disconnect(priv->phydev); | ||
1193 | priv->phydev = NULL; | ||
1194 | } | ||
1195 | 1188 | ||
1196 | netif_stop_queue(dev); | 1189 | netif_stop_queue(dev); |
1197 | napi_disable(&priv->napi); | 1190 | napi_disable(&priv->napi); |
@@ -1525,6 +1518,10 @@ err_free_netdev: | |||
1525 | static int altera_tse_remove(struct platform_device *pdev) | 1518 | static int altera_tse_remove(struct platform_device *pdev) |
1526 | { | 1519 | { |
1527 | struct net_device *ndev = platform_get_drvdata(pdev); | 1520 | struct net_device *ndev = platform_get_drvdata(pdev); |
1521 | struct altera_tse_private *priv = netdev_priv(ndev); | ||
1522 | |||
1523 | if (priv->phydev) | ||
1524 | phy_disconnect(priv->phydev); | ||
1528 | 1525 | ||
1529 | platform_set_drvdata(pdev, NULL); | 1526 | platform_set_drvdata(pdev, NULL); |
1530 | altera_tse_mdio_destroy(ndev); | 1527 | altera_tse_mdio_destroy(ndev); |