Commit 59fb935e authored by andi@cosy.sbg.ac.at's avatar andi@cosy.sbg.ac.at Committed by Linus Torvalds

[PATCH] sundance: attempt to address high irqs due to TX overflow

In at least some versions of Kernel 2.6 (2.6.8.1, 2.6.11-rc2)
the driver drivers/net/sundance.c creates high interrupt load
(~ 100 interrupts per second) even in case of no network traffic
at all.

It seems that some sort of TX overflow handling is misplaced
and triggers interrupts very often even in case of no data to
send. The TX overflow handling has been moved to a more
appropriate place.

While there, an off by one error of reading the TX status has
also been corrected by moving the read after the break.

Thanks to Jeroen who tested the patch (also with high workload).
Interrupts are down to normal and there are no obvious side
effects.
parent 88f48c81
......@@ -1210,9 +1210,11 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
}
/* Yup, this is a documentation bug. It cost me *hours*. */
iowrite16 (0, ioaddr + TxStatus);
tx_status = ioread16 (ioaddr + TxStatus);
if (tx_cnt < 0)
if (tx_cnt < 0) {
iowrite32(5000, ioaddr + DownCounter);
break;
}
tx_status = ioread16 (ioaddr + TxStatus);
}
hw_frame_id = (tx_status >> 8) & 0xff;
} else {
......@@ -1278,7 +1280,6 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
if (netif_msg_intr(np))
printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n",
dev->name, ioread16(ioaddr + IntrStatus));
iowrite32(5000, ioaddr + DownCounter);
return IRQ_RETVAL(handled);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment