aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/atheros/atlx/atl1.c
diff options
context:
space:
mode:
authorTony Zelenoff <antonz@parallels.com>2012-04-13 02:09:53 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-15 13:00:12 -0400
commit2a9bc71e9a1a099e1aab745f1755a3c15a745ad8 (patch)
tree3c73cc2b377b4c97b972ea91703f78f32266f176 /drivers/net/ethernet/atheros/atlx/atl1.c
parent73650f28ae60b7a9e38b1612012f92a6c3b9941c (diff)
atl1: do not process interrupts in cycle in handler
As the rx/tx handled inside napi handler, the cycle is not needed now, because only the rx/tx need such kind of processing. Signed-off-by: Tony Zelenoff <antonz@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/atheros/atlx/atl1.c')
-rw-r--r--drivers/net/ethernet/atheros/atlx/atl1.c105
1 files changed, 48 insertions, 57 deletions
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
index f17cecae59e..066b980cc2f 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.c
+++ b/drivers/net/ethernet/atheros/atlx/atl1.c
@@ -2499,77 +2499,68 @@ static irqreturn_t atl1_intr(int irq, void *data)
2499{ 2499{
2500 struct atl1_adapter *adapter = netdev_priv(data); 2500 struct atl1_adapter *adapter = netdev_priv(data);
2501 u32 status; 2501 u32 status;
2502 int max_ints = 10;
2503 2502
2504 status = adapter->cmb.cmb->int_stats; 2503 status = adapter->cmb.cmb->int_stats;
2505 if (!status) 2504 if (!status)
2506 return IRQ_NONE; 2505 return IRQ_NONE;
2507 2506
2508 do { 2507 /* clear CMB interrupt status at once */
2509 /* clear CMB interrupt status at once */ 2508 adapter->cmb.cmb->int_stats = 0;
2510 adapter->cmb.cmb->int_stats = 0;
2511
2512 if (status & ISR_GPHY) /* clear phy status */
2513 atlx_clear_phy_int(adapter);
2514 2509
2515 /* clear ISR status, and Enable CMB DMA/Disable Interrupt */ 2510 if (status & ISR_GPHY) /* clear phy status */
2516 iowrite32(status | ISR_DIS_INT, adapter->hw.hw_addr + REG_ISR); 2511 atlx_clear_phy_int(adapter);
2517 2512
2518 /* check if SMB intr */ 2513 /* clear ISR status, and Enable CMB DMA/Disable Interrupt */
2519 if (status & ISR_SMB) 2514 iowrite32(status | ISR_DIS_INT, adapter->hw.hw_addr + REG_ISR);
2520 atl1_inc_smb(adapter);
2521 2515
2522 /* check if PCIE PHY Link down */ 2516 /* check if SMB intr */
2523 if (status & ISR_PHY_LINKDOWN) { 2517 if (status & ISR_SMB)
2524 if (netif_msg_intr(adapter)) 2518 atl1_inc_smb(adapter);
2525 dev_printk(KERN_DEBUG, &adapter->pdev->dev,
2526 "pcie phy link down %x\n", status);
2527 if (netif_running(adapter->netdev)) { /* reset MAC */
2528 atlx_irq_disable(adapter);
2529 schedule_work(&adapter->pcie_dma_to_rst_task);
2530 return IRQ_HANDLED;
2531 }
2532 }
2533 2519
2534 /* check if DMA read/write error ? */ 2520 /* check if PCIE PHY Link down */
2535 if (status & (ISR_DMAR_TO_RST | ISR_DMAW_TO_RST)) { 2521 if (status & ISR_PHY_LINKDOWN) {
2536 if (netif_msg_intr(adapter)) 2522 if (netif_msg_intr(adapter))
2537 dev_printk(KERN_DEBUG, &adapter->pdev->dev, 2523 dev_printk(KERN_DEBUG, &adapter->pdev->dev,
2538 "pcie DMA r/w error (status = 0x%x)\n", 2524 "pcie phy link down %x\n", status);
2539 status); 2525 if (netif_running(adapter->netdev)) { /* reset MAC */
2540 atlx_irq_disable(adapter); 2526 atlx_irq_disable(adapter);
2541 schedule_work(&adapter->pcie_dma_to_rst_task); 2527 schedule_work(&adapter->pcie_dma_to_rst_task);
2542 return IRQ_HANDLED; 2528 return IRQ_HANDLED;
2543 } 2529 }
2530 }
2544 2531
2545 /* link event */ 2532 /* check if DMA read/write error ? */
2546 if (status & ISR_GPHY) { 2533 if (status & (ISR_DMAR_TO_RST | ISR_DMAW_TO_RST)) {
2547 adapter->soft_stats.tx_carrier_errors++; 2534 if (netif_msg_intr(adapter))
2548 atl1_check_for_link(adapter); 2535 dev_printk(KERN_DEBUG, &adapter->pdev->dev,
2549 } 2536 "pcie DMA r/w error (status = 0x%x)\n",
2550 2537 status);
2551 /* transmit or receive event */ 2538 atlx_irq_disable(adapter);
2552 if (status & (ISR_CMB_TX | ISR_CMB_RX) && 2539 schedule_work(&adapter->pcie_dma_to_rst_task);
2553 atl1_sched_rings_clean(adapter)) 2540 return IRQ_HANDLED;
2554 break; 2541 }
2555 2542
2556 /* rx exception */ 2543 /* link event */
2557 if (unlikely(status & (ISR_RXF_OV | ISR_RFD_UNRUN | 2544 if (status & ISR_GPHY) {
2558 ISR_RRD_OV | ISR_HOST_RFD_UNRUN | 2545 adapter->soft_stats.tx_carrier_errors++;
2559 ISR_HOST_RRD_OV))) { 2546 atl1_check_for_link(adapter);
2560 if (netif_msg_intr(adapter)) 2547 }
2561 dev_printk(KERN_DEBUG, 2548
2562 &adapter->pdev->dev, 2549 /* transmit or receive event */
2563 "rx exception, ISR = 0x%x\n", 2550 if (status & (ISR_CMB_TX | ISR_CMB_RX))
2564 status); 2551 atl1_sched_rings_clean(adapter);
2565 if (atl1_sched_rings_clean(adapter)) 2552
2566 break; 2553 /* rx exception */
2567 } 2554 if (unlikely(status & (ISR_RXF_OV | ISR_RFD_UNRUN |
2568 2555 ISR_RRD_OV | ISR_HOST_RFD_UNRUN |
2569 if (--max_ints < 0) 2556 ISR_HOST_RRD_OV))) {
2570 break; 2557 if (netif_msg_intr(adapter))
2571 2558 dev_printk(KERN_DEBUG,
2572 } while ((status = adapter->cmb.cmb->int_stats)); 2559 &adapter->pdev->dev,
2560 "rx exception, ISR = 0x%x\n",
2561 status);
2562 atl1_sched_rings_clean(adapter);
2563 }
2573 2564
2574 /* re-enable Interrupt */ 2565 /* re-enable Interrupt */
2575 iowrite32(ISR_DIS_SMB | ISR_DIS_DMA, adapter->hw.hw_addr + REG_ISR); 2566 iowrite32(ISR_DIS_SMB | ISR_DIS_DMA, adapter->hw.hw_addr + REG_ISR);