aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAyaz Abdulla <aabdulla@nvidia.com>2009-03-05 03:02:06 -0500
committerDavid S. Miller <davem@davemloft.net>2009-03-10 08:29:47 -0400
commit2daac3e8f831beba2012fdefda17770456be9b7e (patch)
treea68705c44bd7c649482f3673c74b2fa1082ec392 /drivers
parent582806be066bd35dc5d2739b090b561a5efd787a (diff)
forcedeth: remove overhead
This patch removes unnecessary overhead code. Firstly, there is no nead to mask off unwanted interrupts as we will be checking against the irqmask field anyways. Secondly, there has been no value in last few years from detecting error or unknown interrupts. Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/forcedeth.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 37cd23fb9e44..74511f7e13e9 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -120,10 +120,6 @@ enum {
120#define NVREG_IRQ_RX_ALL (NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_RX_FORCED) 120#define NVREG_IRQ_RX_ALL (NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_RX_FORCED)
121#define NVREG_IRQ_OTHER (NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_RECOVER_ERROR) 121#define NVREG_IRQ_OTHER (NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_RECOVER_ERROR)
122 122
123#define NVREG_IRQ_UNKNOWN (~(NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_TX_ERR| \
124 NVREG_IRQ_TX_OK|NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_RX_FORCED| \
125 NVREG_IRQ_TX_FORCED|NVREG_IRQ_RECOVER_ERROR))
126
127 NvRegUnknownSetupReg6 = 0x008, 123 NvRegUnknownSetupReg6 = 0x008,
128#define NVREG_UNKSETUP6_VAL 3 124#define NVREG_UNKSETUP6_VAL 3
129 125
@@ -3424,10 +3420,10 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
3424 3420
3425 for (i=0; ; i++) { 3421 for (i=0; ; i++) {
3426 if (!(np->msi_flags & NV_MSI_X_ENABLED)) { 3422 if (!(np->msi_flags & NV_MSI_X_ENABLED)) {
3427 np->events = readl(base + NvRegIrqStatus) & NVREG_IRQSTAT_MASK; 3423 np->events = readl(base + NvRegIrqStatus);
3428 writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus); 3424 writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
3429 } else { 3425 } else {
3430 np->events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQSTAT_MASK; 3426 np->events = readl(base + NvRegMSIXIrqStatus);
3431 writel(NVREG_IRQSTAT_MASK, base + NvRegMSIXIrqStatus); 3427 writel(NVREG_IRQSTAT_MASK, base + NvRegMSIXIrqStatus);
3432 } 3428 }
3433 dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, np->events); 3429 dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, np->events);
@@ -3475,14 +3471,6 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
3475 spin_unlock(&np->lock); 3471 spin_unlock(&np->lock);
3476 np->link_timeout = jiffies + LINK_TIMEOUT; 3472 np->link_timeout = jiffies + LINK_TIMEOUT;
3477 } 3473 }
3478 if (unlikely(np->events & (NVREG_IRQ_TX_ERR))) {
3479 dprintk(KERN_DEBUG "%s: received irq with events 0x%x. Probably TX fail.\n",
3480 dev->name, np->events);
3481 }
3482 if (unlikely(np->events & (NVREG_IRQ_UNKNOWN))) {
3483 printk(KERN_DEBUG "%s: received irq with unknown events 0x%x. Please report\n",
3484 dev->name, np->events);
3485 }
3486 if (unlikely(np->events & NVREG_IRQ_RECOVER_ERROR)) { 3474 if (unlikely(np->events & NVREG_IRQ_RECOVER_ERROR)) {
3487 spin_lock(&np->lock); 3475 spin_lock(&np->lock);
3488 /* disable interrupts on the nic */ 3476 /* disable interrupts on the nic */
@@ -3540,10 +3528,10 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
3540 3528
3541 for (i=0; ; i++) { 3529 for (i=0; ; i++) {
3542 if (!(np->msi_flags & NV_MSI_X_ENABLED)) { 3530 if (!(np->msi_flags & NV_MSI_X_ENABLED)) {
3543 np->events = readl(base + NvRegIrqStatus) & NVREG_IRQSTAT_MASK; 3531 np->events = readl(base + NvRegIrqStatus);
3544 writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus); 3532 writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
3545 } else { 3533 } else {
3546 np->events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQSTAT_MASK; 3534 np->events = readl(base + NvRegMSIXIrqStatus);
3547 writel(NVREG_IRQSTAT_MASK, base + NvRegMSIXIrqStatus); 3535 writel(NVREG_IRQSTAT_MASK, base + NvRegMSIXIrqStatus);
3548 } 3536 }
3549 dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, np->events); 3537 dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, np->events);
@@ -3591,14 +3579,6 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
3591 spin_unlock(&np->lock); 3579 spin_unlock(&np->lock);
3592 np->link_timeout = jiffies + LINK_TIMEOUT; 3580 np->link_timeout = jiffies + LINK_TIMEOUT;
3593 } 3581 }
3594 if (unlikely(np->events & (NVREG_IRQ_TX_ERR))) {
3595 dprintk(KERN_DEBUG "%s: received irq with events 0x%x. Probably TX fail.\n",
3596 dev->name, np->events);
3597 }
3598 if (unlikely(np->events & (NVREG_IRQ_UNKNOWN))) {
3599 printk(KERN_DEBUG "%s: received irq with unknown events 0x%x. Please report\n",
3600 dev->name, np->events);
3601 }
3602 if (unlikely(np->events & NVREG_IRQ_RECOVER_ERROR)) { 3582 if (unlikely(np->events & NVREG_IRQ_RECOVER_ERROR)) {
3603 spin_lock(&np->lock); 3583 spin_lock(&np->lock);
3604 /* disable interrupts on the nic */ 3584 /* disable interrupts on the nic */
@@ -3663,10 +3643,6 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data)
3663 nv_tx_done_optimized(dev, TX_WORK_PER_LOOP); 3643 nv_tx_done_optimized(dev, TX_WORK_PER_LOOP);
3664 spin_unlock_irqrestore(&np->lock, flags); 3644 spin_unlock_irqrestore(&np->lock, flags);
3665 3645
3666 if (unlikely(events & (NVREG_IRQ_TX_ERR))) {
3667 dprintk(KERN_DEBUG "%s: received irq with events 0x%x. Probably TX fail.\n",
3668 dev->name, events);
3669 }
3670 if (unlikely(i > max_interrupt_work)) { 3646 if (unlikely(i > max_interrupt_work)) {
3671 spin_lock_irqsave(&np->lock, flags); 3647 spin_lock_irqsave(&np->lock, flags);
3672 /* disable interrupts on the nic */ 3648 /* disable interrupts on the nic */
@@ -3825,10 +3801,6 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data)
3825 spin_unlock_irq(&np->lock); 3801 spin_unlock_irq(&np->lock);
3826 break; 3802 break;
3827 } 3803 }
3828 if (events & (NVREG_IRQ_UNKNOWN)) {
3829 printk(KERN_DEBUG "%s: received irq with unknown events 0x%x. Please report\n",
3830 dev->name, events);
3831 }
3832 if (unlikely(i > max_interrupt_work)) { 3804 if (unlikely(i > max_interrupt_work)) {
3833 spin_lock_irqsave(&np->lock, flags); 3805 spin_lock_irqsave(&np->lock, flags);
3834 /* disable interrupts on the nic */ 3806 /* disable interrupts on the nic */