Skip to content

Commit c484994

Browse files
kbelezkodavem330
authored andcommitted
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>
1 parent 2b972ac commit c484994

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

‎drivers/net/ethernet/altera/altera_tse_main.c‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,10 +1170,6 @@ static int tse_open(struct net_device *dev)
11701170
init_error:
11711171
free_skbufs(dev);
11721172
alloc_skbuf_error:
1173-
if (priv->phydev) {
1174-
phy_disconnect(priv->phydev);
1175-
priv->phydev = NULL;
1176-
}
11771173
phy_error:
11781174
return ret;
11791175
}
@@ -1186,12 +1182,9 @@ static int tse_shutdown(struct net_device *dev)
11861182
int ret;
11871183
unsigned long int flags;
11881184

1189-
/* Stop and disconnect the PHY */
1190-
if (priv->phydev) {
1185+
/* Stop the PHY */
1186+
if (priv->phydev)
11911187
phy_stop(priv->phydev);
1192-
phy_disconnect(priv->phydev);
1193-
priv->phydev = NULL;
1194-
}
11951188

11961189
netif_stop_queue(dev);
11971190
napi_disable(&priv->napi);
@@ -1525,6 +1518,10 @@ static int altera_tse_probe(struct platform_device *pdev)
15251518
static int altera_tse_remove(struct platform_device *pdev)
15261519
{
15271520
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);
15281525

15291526
platform_set_drvdata(pdev, NULL);
15301527
altera_tse_mdio_destroy(ndev);

0 commit comments

Comments
 (0)