Skip to content

Commit 36e6c7a

Browse files
ffainelligregkh
authored andcommitted
net: bcmgenet: Restore phy_stop() depending upon suspend/close
[ Upstream commit 225c657 ] 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 <f.fainelli@gmail.com> Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Link: https://lore.kernel.org/r/20230515025608.2587012-1-f.fainelli@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 41357a5 commit 36e6c7a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3445,7 +3445,7 @@ static int bcmgenet_open(struct net_device *dev)
34453445
return ret;
34463446
}
34473447

3448-
static void bcmgenet_netif_stop(struct net_device *dev)
3448+
static void bcmgenet_netif_stop(struct net_device *dev, bool stop_phy)
34493449
{
34503450
struct bcmgenet_priv *priv = netdev_priv(dev);
34513451

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

3463+
if (stop_phy)
3464+
phy_stop(dev->phydev);
34633465
bcmgenet_disable_rx_napi(priv);
34643466
bcmgenet_intr_disable(priv);
34653467

@@ -3480,7 +3482,7 @@ static int bcmgenet_close(struct net_device *dev)
34803482

34813483
netif_dbg(priv, ifdown, dev, "bcmgenet_close\n");
34823484

3483-
bcmgenet_netif_stop(dev);
3485+
bcmgenet_netif_stop(dev, false);
34843486

34853487
/* Really kill the PHY state machine and disconnect from it */
34863488
phy_disconnect(dev->phydev);
@@ -4298,7 +4300,7 @@ static int bcmgenet_suspend(struct device *d)
42984300

42994301
netif_device_detach(dev);
43004302

4301-
bcmgenet_netif_stop(dev);
4303+
bcmgenet_netif_stop(dev, true);
43024304

43034305
if (!device_may_wakeup(d))
43044306
phy_suspend(dev->phydev);

0 commit comments

Comments
 (0)