aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti/cpsw.c
diff options
context:
space:
mode:
authorMugunthan V N <mugunthanvnm@ti.com>2013-02-17 17:19:20 -0500
committerDavid S. Miller <davem@davemloft.net>2013-02-18 14:51:50 -0500
commit510a1e7249298f6bbd049e1ec98041ddf5ef6452 (patch)
tree51604f599a9ffc5f7e824235c52b5975eb51e315 /drivers/net/ethernet/ti/cpsw.c
parent4153577a8d318ae02b3791341e10e78416de402f (diff)
drivers: net: davinci_cpdma: acknowledge interrupt properly
CPDMA interrupts are not properly acknowledged which leads to interrupt storm, only cpdma interrupt 0 is acknowledged in Davinci CPDMA driver. Changed cpdma_ctlr_eoi api to acknowledge 1 and 2 interrupts which are used for rx and tx respectively. Reported-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/cpsw.c')
-rw-r--r--drivers/net/ethernet/ti/cpsw.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 4ceed6e0f1be..7e93df6585e7 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -510,19 +510,21 @@ static int cpsw_poll(struct napi_struct *napi, int budget)
510 int num_tx, num_rx; 510 int num_tx, num_rx;
511 511
512 num_tx = cpdma_chan_process(priv->txch, 128); 512 num_tx = cpdma_chan_process(priv->txch, 128);
513 num_rx = cpdma_chan_process(priv->rxch, budget); 513 if (num_tx)
514 514 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
515 if (num_rx || num_tx)
516 cpsw_dbg(priv, intr, "poll %d rx, %d tx pkts\n",
517 num_rx, num_tx);
518 515
516 num_rx = cpdma_chan_process(priv->rxch, budget);
519 if (num_rx < budget) { 517 if (num_rx < budget) {
520 napi_complete(napi); 518 napi_complete(napi);
521 cpsw_intr_enable(priv); 519 cpsw_intr_enable(priv);
522 cpdma_ctlr_eoi(priv->dma); 520 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
523 cpsw_enable_irq(priv); 521 cpsw_enable_irq(priv);
524 } 522 }
525 523
524 if (num_rx || num_tx)
525 cpsw_dbg(priv, intr, "poll %d rx, %d tx pkts\n",
526 num_rx, num_tx);
527
526 return num_rx; 528 return num_rx;
527} 529}
528 530
@@ -835,7 +837,8 @@ static int cpsw_ndo_open(struct net_device *ndev)
835 cpdma_ctlr_start(priv->dma); 837 cpdma_ctlr_start(priv->dma);
836 cpsw_intr_enable(priv); 838 cpsw_intr_enable(priv);
837 napi_enable(&priv->napi); 839 napi_enable(&priv->napi);
838 cpdma_ctlr_eoi(priv->dma); 840 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
841 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
839 842
840 if (priv->data.dual_emac) 843 if (priv->data.dual_emac)
841 priv->slaves[priv->emac_port].open_stat = true; 844 priv->slaves[priv->emac_port].open_stat = true;
@@ -1075,7 +1078,9 @@ static void cpsw_ndo_tx_timeout(struct net_device *ndev)
1075 cpdma_chan_start(priv->txch); 1078 cpdma_chan_start(priv->txch);
1076 cpdma_ctlr_int_ctrl(priv->dma, true); 1079 cpdma_ctlr_int_ctrl(priv->dma, true);
1077 cpsw_intr_enable(priv); 1080 cpsw_intr_enable(priv);
1078 cpdma_ctlr_eoi(priv->dma); 1081 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
1082 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
1083
1079} 1084}
1080 1085
1081static struct net_device_stats *cpsw_ndo_get_stats(struct net_device *ndev) 1086static struct net_device_stats *cpsw_ndo_get_stats(struct net_device *ndev)
@@ -1094,7 +1099,9 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev)
1094 cpsw_interrupt(ndev->irq, priv); 1099 cpsw_interrupt(ndev->irq, priv);
1095 cpdma_ctlr_int_ctrl(priv->dma, true); 1100 cpdma_ctlr_int_ctrl(priv->dma, true);
1096 cpsw_intr_enable(priv); 1101 cpsw_intr_enable(priv);
1097 cpdma_ctlr_eoi(priv->dma); 1102 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
1103 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
1104
1098} 1105}
1099#endif 1106#endif
1100 1107