Skip to content

Commit

Permalink
Merge branch 'net-timeout-fixes-for-GENET-and-SYSTEMPORT'
Browse files Browse the repository at this point in the history
Florian Fainelli says:

====================
net: timeout fixes for GENET and SYSTEMPORT

This patch series fixes occasional transmit timeout around the time
the system goes into suspend. GENET and SYSTEMPORT have nearly the same
logic in that regard and were both affected in the same way.

Please queue up for stable, thanks!
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Nov 3, 2018
2 parents c7e86ac + 7cb6a2a commit 265ad06
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
15 changes: 7 additions & 8 deletions drivers/net/ethernet/broadcom/bcmsysport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1902,9 +1902,6 @@ static void bcm_sysport_netif_start(struct net_device *dev)
intrl2_1_mask_clear(priv, 0xffffffff);
else
intrl2_0_mask_clear(priv, INTRL2_0_TDMA_MBDONE_MASK);

/* Last call before we start the real business */
netif_tx_start_all_queues(dev);
}

static void rbuf_init(struct bcm_sysport_priv *priv)
Expand Down Expand Up @@ -2048,6 +2045,8 @@ static int bcm_sysport_open(struct net_device *dev)

bcm_sysport_netif_start(dev);

netif_tx_start_all_queues(dev);

return 0;

out_clear_rx_int:
Expand All @@ -2071,7 +2070,7 @@ static void bcm_sysport_netif_stop(struct net_device *dev)
struct bcm_sysport_priv *priv = netdev_priv(dev);

/* stop all software from updating hardware */
netif_tx_stop_all_queues(dev);
netif_tx_disable(dev);
napi_disable(&priv->napi);
cancel_work_sync(&priv->dim.dim.work);
phy_stop(dev->phydev);
Expand Down Expand Up @@ -2658,12 +2657,12 @@ static int __maybe_unused bcm_sysport_suspend(struct device *d)
if (!netif_running(dev))
return 0;

netif_device_detach(dev);

bcm_sysport_netif_stop(dev);

phy_suspend(dev->phydev);

netif_device_detach(dev);

/* Disable UniMAC RX */
umac_enable_set(priv, CMD_RX_EN, 0);

Expand Down Expand Up @@ -2746,8 +2745,6 @@ static int __maybe_unused bcm_sysport_resume(struct device *d)
goto out_free_rx_ring;
}

netif_device_attach(dev);

/* RX pipe enable */
topctrl_writel(priv, 0, RX_FLUSH_CNTL);

Expand Down Expand Up @@ -2788,6 +2785,8 @@ static int __maybe_unused bcm_sysport_resume(struct device *d)

bcm_sysport_netif_start(dev);

netif_device_attach(dev);

return 0;

out_free_rx_ring:
Expand Down
13 changes: 7 additions & 6 deletions drivers/net/ethernet/broadcom/genet/bcmgenet.c
Original file line number Diff line number Diff line change
Expand Up @@ -2855,7 +2855,6 @@ static void bcmgenet_netif_start(struct net_device *dev)

umac_enable_set(priv, CMD_TX_EN | CMD_RX_EN, true);

netif_tx_start_all_queues(dev);
bcmgenet_enable_tx_napi(priv);

/* Monitor link interrupts now */
Expand Down Expand Up @@ -2937,6 +2936,8 @@ static int bcmgenet_open(struct net_device *dev)

bcmgenet_netif_start(dev);

netif_tx_start_all_queues(dev);

return 0;

err_irq1:
Expand All @@ -2958,7 +2959,7 @@ static void bcmgenet_netif_stop(struct net_device *dev)
struct bcmgenet_priv *priv = netdev_priv(dev);

bcmgenet_disable_tx_napi(priv);
netif_tx_stop_all_queues(dev);
netif_tx_disable(dev);

/* Disable MAC receive */
umac_enable_set(priv, CMD_RX_EN, false);
Expand Down Expand Up @@ -3620,13 +3621,13 @@ static int bcmgenet_suspend(struct device *d)
if (!netif_running(dev))
return 0;

netif_device_detach(dev);

bcmgenet_netif_stop(dev);

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

netif_device_detach(dev);

/* Prepare the device for Wake-on-LAN and switch to the slow clock */
if (device_may_wakeup(d) && priv->wolopts) {
ret = bcmgenet_power_down(priv, GENET_POWER_WOL_MAGIC);
Expand Down Expand Up @@ -3700,8 +3701,6 @@ static int bcmgenet_resume(struct device *d)
/* Always enable ring 16 - descriptor ring */
bcmgenet_enable_dma(priv, dma_ctrl);

netif_device_attach(dev);

if (!device_may_wakeup(d))
phy_resume(dev->phydev);

Expand All @@ -3710,6 +3709,8 @@ static int bcmgenet_resume(struct device *d)

bcmgenet_netif_start(dev);

netif_device_attach(dev);

return 0;

out_clk_disable:
Expand Down

0 comments on commit 265ad06

Please sign in to comment.