Commit c484994e authored by Kostya Belezko's avatar Kostya Belezko Committed by David S. Miller

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: default avatarKostya Belezko <bkostya@hotmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2b972acb
...@@ -1170,10 +1170,6 @@ static int tse_open(struct net_device *dev) ...@@ -1170,10 +1170,6 @@ static int tse_open(struct net_device *dev)
init_error: init_error:
free_skbufs(dev); free_skbufs(dev);
alloc_skbuf_error: alloc_skbuf_error:
if (priv->phydev) {
phy_disconnect(priv->phydev);
priv->phydev = NULL;
}
phy_error: phy_error:
return ret; return ret;
} }
...@@ -1186,12 +1182,9 @@ static int tse_shutdown(struct net_device *dev) ...@@ -1186,12 +1182,9 @@ static int tse_shutdown(struct net_device *dev)
int ret; int ret;
unsigned long int flags; unsigned long int flags;
/* Stop and disconnect the PHY */ /* Stop the PHY */
if (priv->phydev) { if (priv->phydev)
phy_stop(priv->phydev); phy_stop(priv->phydev);
phy_disconnect(priv->phydev);
priv->phydev = NULL;
}
netif_stop_queue(dev); netif_stop_queue(dev);
napi_disable(&priv->napi); napi_disable(&priv->napi);
...@@ -1525,6 +1518,10 @@ static int altera_tse_probe(struct platform_device *pdev) ...@@ -1525,6 +1518,10 @@ static int altera_tse_probe(struct platform_device *pdev)
static int altera_tse_remove(struct platform_device *pdev) static int altera_tse_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
struct altera_tse_private *priv = netdev_priv(ndev);
if (priv->phydev)
phy_disconnect(priv->phydev);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
altera_tse_mdio_destroy(ndev); altera_tse_mdio_destroy(ndev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment