aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bcmsysport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/broadcom/bcmsysport.c')
-rw-r--r--drivers/net/ethernet/broadcom/bcmsysport.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 9ae36979bdee..531bb7c57531 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -1110,7 +1110,8 @@ static int bcm_sysport_init_tx_ring(struct bcm_sysport_priv *priv,
1110 /* We just need one DMA descriptor which is DMA-able, since writing to 1110 /* We just need one DMA descriptor which is DMA-able, since writing to
1111 * the port will allocate a new descriptor in its internal linked-list 1111 * the port will allocate a new descriptor in its internal linked-list
1112 */ 1112 */
1113 p = dma_zalloc_coherent(kdev, 1, &ring->desc_dma, GFP_KERNEL); 1113 p = dma_zalloc_coherent(kdev, sizeof(struct dma_desc), &ring->desc_dma,
1114 GFP_KERNEL);
1114 if (!p) { 1115 if (!p) {
1115 netif_err(priv, hw, priv->netdev, "DMA alloc failed\n"); 1116 netif_err(priv, hw, priv->netdev, "DMA alloc failed\n");
1116 return -ENOMEM; 1117 return -ENOMEM;
@@ -1174,6 +1175,13 @@ static void bcm_sysport_fini_tx_ring(struct bcm_sysport_priv *priv,
1174 if (!(reg & TDMA_DISABLED)) 1175 if (!(reg & TDMA_DISABLED))
1175 netdev_warn(priv->netdev, "TDMA not stopped!\n"); 1176 netdev_warn(priv->netdev, "TDMA not stopped!\n");
1176 1177
1178 /* ring->cbs is the last part in bcm_sysport_init_tx_ring which could
1179 * fail, so by checking this pointer we know whether the TX ring was
1180 * fully initialized or not.
1181 */
1182 if (!ring->cbs)
1183 return;
1184
1177 napi_disable(&ring->napi); 1185 napi_disable(&ring->napi);
1178 netif_napi_del(&ring->napi); 1186 netif_napi_del(&ring->napi);
1179 1187
@@ -1183,7 +1191,8 @@ static void bcm_sysport_fini_tx_ring(struct bcm_sysport_priv *priv,
1183 ring->cbs = NULL; 1191 ring->cbs = NULL;
1184 1192
1185 if (ring->desc_dma) { 1193 if (ring->desc_dma) {
1186 dma_free_coherent(kdev, 1, ring->desc_cpu, ring->desc_dma); 1194 dma_free_coherent(kdev, sizeof(struct dma_desc),
1195 ring->desc_cpu, ring->desc_dma);
1187 ring->desc_dma = 0; 1196 ring->desc_dma = 0;
1188 } 1197 }
1189 ring->size = 0; 1198 ring->size = 0;
@@ -1397,6 +1406,9 @@ static void bcm_sysport_netif_start(struct net_device *dev)
1397 /* Enable NAPI */ 1406 /* Enable NAPI */
1398 napi_enable(&priv->napi); 1407 napi_enable(&priv->napi);
1399 1408
1409 /* Enable RX interrupt and TX ring full interrupt */
1410 intrl2_0_mask_clear(priv, INTRL2_0_RDMA_MBDONE | INTRL2_0_TX_RING_FULL);
1411
1400 phy_start(priv->phydev); 1412 phy_start(priv->phydev);
1401 1413
1402 /* Enable TX interrupts for the 32 TXQs */ 1414 /* Enable TX interrupts for the 32 TXQs */
@@ -1499,9 +1511,6 @@ static int bcm_sysport_open(struct net_device *dev)
1499 if (ret) 1511 if (ret)
1500 goto out_free_rx_ring; 1512 goto out_free_rx_ring;
1501 1513
1502 /* Enable RX interrupt and TX ring full interrupt */
1503 intrl2_0_mask_clear(priv, INTRL2_0_RDMA_MBDONE | INTRL2_0_TX_RING_FULL);
1504
1505 /* Turn on TDMA */ 1514 /* Turn on TDMA */
1506 ret = tdma_enable_set(priv, 1); 1515 ret = tdma_enable_set(priv, 1);
1507 if (ret) 1516 if (ret)
@@ -1858,6 +1867,8 @@ static int bcm_sysport_resume(struct device *d)
1858 if (!netif_running(dev)) 1867 if (!netif_running(dev))
1859 return 0; 1868 return 0;
1860 1869
1870 umac_reset(priv);
1871
1861 /* We may have been suspended and never received a WOL event that 1872 /* We may have been suspended and never received a WOL event that
1862 * would turn off MPD detection, take care of that now 1873 * would turn off MPD detection, take care of that now
1863 */ 1874 */
@@ -1885,9 +1896,6 @@ static int bcm_sysport_resume(struct device *d)
1885 1896
1886 netif_device_attach(dev); 1897 netif_device_attach(dev);
1887 1898
1888 /* Enable RX interrupt and TX ring full interrupt */
1889 intrl2_0_mask_clear(priv, INTRL2_0_RDMA_MBDONE | INTRL2_0_TX_RING_FULL);
1890
1891 /* RX pipe enable */ 1899 /* RX pipe enable */
1892 topctrl_writel(priv, 0, RX_FLUSH_CNTL); 1900 topctrl_writel(priv, 0, RX_FLUSH_CNTL);
1893 1901