diff options
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_main.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 06103cad7c77..05c146f718a3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -1277,8 +1277,10 @@ static void free_dma_desc_resources(struct stmmac_priv *priv) | |||
1277 | */ | 1277 | */ |
1278 | static void stmmac_dma_operation_mode(struct stmmac_priv *priv) | 1278 | static void stmmac_dma_operation_mode(struct stmmac_priv *priv) |
1279 | { | 1279 | { |
1280 | int rxfifosz = priv->plat->rx_fifo_size; | ||
1281 | |||
1280 | if (priv->plat->force_thresh_dma_mode) | 1282 | if (priv->plat->force_thresh_dma_mode) |
1281 | priv->hw->dma->dma_mode(priv->ioaddr, tc, tc); | 1283 | priv->hw->dma->dma_mode(priv->ioaddr, tc, tc, rxfifosz); |
1282 | else if (priv->plat->force_sf_dma_mode || priv->plat->tx_coe) { | 1284 | else if (priv->plat->force_sf_dma_mode || priv->plat->tx_coe) { |
1283 | /* | 1285 | /* |
1284 | * In case of GMAC, SF mode can be enabled | 1286 | * In case of GMAC, SF mode can be enabled |
@@ -1287,10 +1289,12 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv) | |||
1287 | * 2) There is no bugged Jumbo frame support | 1289 | * 2) There is no bugged Jumbo frame support |
1288 | * that needs to not insert csum in the TDES. | 1290 | * that needs to not insert csum in the TDES. |
1289 | */ | 1291 | */ |
1290 | priv->hw->dma->dma_mode(priv->ioaddr, SF_DMA_MODE, SF_DMA_MODE); | 1292 | priv->hw->dma->dma_mode(priv->ioaddr, SF_DMA_MODE, SF_DMA_MODE, |
1293 | rxfifosz); | ||
1291 | priv->xstats.threshold = SF_DMA_MODE; | 1294 | priv->xstats.threshold = SF_DMA_MODE; |
1292 | } else | 1295 | } else |
1293 | priv->hw->dma->dma_mode(priv->ioaddr, tc, SF_DMA_MODE); | 1296 | priv->hw->dma->dma_mode(priv->ioaddr, tc, SF_DMA_MODE, |
1297 | rxfifosz); | ||
1294 | } | 1298 | } |
1295 | 1299 | ||
1296 | /** | 1300 | /** |
@@ -1442,6 +1446,7 @@ static void stmmac_tx_err(struct stmmac_priv *priv) | |||
1442 | static void stmmac_dma_interrupt(struct stmmac_priv *priv) | 1446 | static void stmmac_dma_interrupt(struct stmmac_priv *priv) |
1443 | { | 1447 | { |
1444 | int status; | 1448 | int status; |
1449 | int rxfifosz = priv->plat->rx_fifo_size; | ||
1445 | 1450 | ||
1446 | status = priv->hw->dma->dma_interrupt(priv->ioaddr, &priv->xstats); | 1451 | status = priv->hw->dma->dma_interrupt(priv->ioaddr, &priv->xstats); |
1447 | if (likely((status & handle_rx)) || (status & handle_tx)) { | 1452 | if (likely((status & handle_rx)) || (status & handle_tx)) { |
@@ -1456,10 +1461,11 @@ static void stmmac_dma_interrupt(struct stmmac_priv *priv) | |||
1456 | (tc <= 256)) { | 1461 | (tc <= 256)) { |
1457 | tc += 64; | 1462 | tc += 64; |
1458 | if (priv->plat->force_thresh_dma_mode) | 1463 | if (priv->plat->force_thresh_dma_mode) |
1459 | priv->hw->dma->dma_mode(priv->ioaddr, tc, tc); | 1464 | priv->hw->dma->dma_mode(priv->ioaddr, tc, tc, |
1465 | rxfifosz); | ||
1460 | else | 1466 | else |
1461 | priv->hw->dma->dma_mode(priv->ioaddr, tc, | 1467 | priv->hw->dma->dma_mode(priv->ioaddr, tc, |
1462 | SF_DMA_MODE); | 1468 | SF_DMA_MODE, rxfifosz); |
1463 | priv->xstats.threshold = tc; | 1469 | priv->xstats.threshold = tc; |
1464 | } | 1470 | } |
1465 | } else if (unlikely(status == tx_hard_error)) | 1471 | } else if (unlikely(status == tx_hard_error)) |
@@ -2970,15 +2976,15 @@ int stmmac_dvr_remove(struct net_device *ndev) | |||
2970 | priv->hw->dma->stop_tx(priv->ioaddr); | 2976 | priv->hw->dma->stop_tx(priv->ioaddr); |
2971 | 2977 | ||
2972 | stmmac_set_mac(priv->ioaddr, false); | 2978 | stmmac_set_mac(priv->ioaddr, false); |
2973 | if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI && | ||
2974 | priv->pcs != STMMAC_PCS_RTBI) | ||
2975 | stmmac_mdio_unregister(ndev); | ||
2976 | netif_carrier_off(ndev); | 2979 | netif_carrier_off(ndev); |
2977 | unregister_netdev(ndev); | 2980 | unregister_netdev(ndev); |
2978 | if (priv->stmmac_rst) | 2981 | if (priv->stmmac_rst) |
2979 | reset_control_assert(priv->stmmac_rst); | 2982 | reset_control_assert(priv->stmmac_rst); |
2980 | clk_disable_unprepare(priv->pclk); | 2983 | clk_disable_unprepare(priv->pclk); |
2981 | clk_disable_unprepare(priv->stmmac_clk); | 2984 | clk_disable_unprepare(priv->stmmac_clk); |
2985 | if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI && | ||
2986 | priv->pcs != STMMAC_PCS_RTBI) | ||
2987 | stmmac_mdio_unregister(ndev); | ||
2982 | free_netdev(ndev); | 2988 | free_netdev(ndev); |
2983 | 2989 | ||
2984 | return 0; | 2990 | return 0; |