Skip to content

Commit 225c657

Browse files
ffainelliPaolo Abeni
authored andcommitted
net: bcmgenet: Restore phy_stop() depending upon suspend/close
Removing the phy_stop() from bcmgenet_netif_stop() ended up causing warnings from the PHY library that phy_start() is called from the RUNNING state since we are no longer stopping the PHY state machine during bcmgenet_suspend(). Restore the call to phy_stop() but make it conditional on being called from the close or suspend path. Fixes: c96e731 ("net: bcmgenet: connect and disconnect from the PHY state machine") Fixes: 93e0401 ("net: bcmgenet: Remove phy_stop() from bcmgenet_netif_stop()") Signed-off-by: Florian Fainelli <[email protected]> Reviewed-by: Pavan Chebbi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent df0acdc commit 225c657

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3450,7 +3450,7 @@ static int bcmgenet_open(struct net_device *dev)
34503450
return ret;
34513451
}
34523452

3453-
static void bcmgenet_netif_stop(struct net_device *dev)
3453+
static void bcmgenet_netif_stop(struct net_device *dev, bool stop_phy)
34543454
{
34553455
struct bcmgenet_priv *priv = netdev_priv(dev);
34563456

@@ -3465,6 +3465,8 @@ static void bcmgenet_netif_stop(struct net_device *dev)
34653465
/* Disable MAC transmit. TX DMA disabled must be done before this */
34663466
umac_enable_set(priv, CMD_TX_EN, false);
34673467

3468+
if (stop_phy)
3469+
phy_stop(dev->phydev);
34683470
bcmgenet_disable_rx_napi(priv);
34693471
bcmgenet_intr_disable(priv);
34703472

@@ -3485,7 +3487,7 @@ static int bcmgenet_close(struct net_device *dev)
34853487

34863488
netif_dbg(priv, ifdown, dev, "bcmgenet_close\n");
34873489

3488-
bcmgenet_netif_stop(dev);
3490+
bcmgenet_netif_stop(dev, false);
34893491

34903492
/* Really kill the PHY state machine and disconnect from it */
34913493
phy_disconnect(dev->phydev);
@@ -4303,7 +4305,7 @@ static int bcmgenet_suspend(struct device *d)
43034305

43044306
netif_device_detach(dev);
43054307

4306-
bcmgenet_netif_stop(dev);
4308+
bcmgenet_netif_stop(dev, true);
43074309

43084310
if (!device_may_wakeup(d))
43094311
phy_suspend(dev->phydev);

0 commit comments

Comments
 (0)