Commit 05102b62 authored by François Romieu's avatar François Romieu Committed by Jeff Garzik

[PATCH] epic100: code removal in irq handler

The loop in the irq handler is not needed any more as the high frequency
events have been deferred due to napi usage.
parent dfe22676
...@@ -77,8 +77,6 @@ ...@@ -77,8 +77,6 @@
These may be modified when a driver module is loaded.*/ These may be modified when a driver module is loaded.*/
static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */ static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */
/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
static int max_interrupt_work = 32;
/* Used to pass the full-duplex flag, etc. */ /* Used to pass the full-duplex flag, etc. */
#define MAX_UNITS 8 /* More are supported, limit only on options */ #define MAX_UNITS 8 /* More are supported, limit only on options */
...@@ -155,12 +153,10 @@ MODULE_DESCRIPTION("SMC 83c170 EPIC series Ethernet driver"); ...@@ -155,12 +153,10 @@ MODULE_DESCRIPTION("SMC 83c170 EPIC series Ethernet driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_PARM(debug, "i"); MODULE_PARM(debug, "i");
MODULE_PARM(max_interrupt_work, "i");
MODULE_PARM(rx_copybreak, "i"); MODULE_PARM(rx_copybreak, "i");
MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i");
MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i");
MODULE_PARM_DESC(debug, "EPIC/100 debug level (0-5)"); MODULE_PARM_DESC(debug, "EPIC/100 debug level (0-5)");
MODULE_PARM_DESC(max_interrupt_work, "EPIC/100 maximum events handled per interrupt");
MODULE_PARM_DESC(options, "EPIC/100: Bits 0-3: media type, bit 4: full duplex"); MODULE_PARM_DESC(options, "EPIC/100: Bits 0-3: media type, bit 4: full duplex");
MODULE_PARM_DESC(rx_copybreak, "EPIC/100 copy breakpoint for copy-only-tiny-frames"); MODULE_PARM_DESC(rx_copybreak, "EPIC/100 copy breakpoint for copy-only-tiny-frames");
MODULE_PARM_DESC(full_duplex, "EPIC/100 full duplex setting(s) (1)"); MODULE_PARM_DESC(full_duplex, "EPIC/100 full duplex setting(s) (1)");
...@@ -1162,21 +1158,22 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r ...@@ -1162,21 +1158,22 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r
struct net_device *dev = dev_instance; struct net_device *dev = dev_instance;
struct epic_private *ep = dev->priv; struct epic_private *ep = dev->priv;
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
int status, boguscnt = max_interrupt_work;
unsigned int handled = 0; unsigned int handled = 0;
int status;
do {
status = inl(ioaddr + INTSTAT); status = inl(ioaddr + INTSTAT);
/* Acknowledge all of the current interrupt sources ASAP. */ /* Acknowledge all of the current interrupt sources ASAP. */
outl(status & EpicNormalEvent, ioaddr + INTSTAT); outl(status & EpicNormalEvent, ioaddr + INTSTAT);
if (debug > 4) if (debug > 4) {
printk(KERN_DEBUG "%s: Interrupt, status=%#8.8x new " printk(KERN_DEBUG "%s: Interrupt, status=%#8.8x new "
"intstat=%#8.8x.\n", "intstat=%#8.8x.\n", dev->name, status,
dev->name, status, (int)inl(ioaddr + INTSTAT)); (int)inl(ioaddr + INTSTAT));
}
if ((status & IntrSummary) == 0) if ((status & IntrSummary) == 0)
break; goto out;
handled = 1; handled = 1;
if ((status & EpicNapiEvent) && !ep->reschedule_in_poll) { if ((status & EpicNapiEvent) && !ep->reschedule_in_poll) {
...@@ -1191,10 +1188,10 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r ...@@ -1191,10 +1188,10 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r
status &= ~EpicNapiEvent; status &= ~EpicNapiEvent;
/* Check uncommon events all at once. */ /* Check uncommon events all at once. */
if (status & if (status & (CntFull | TxUnderrun | PCIBusErr170 | PCIBusErr175)) {
(CntFull | TxUnderrun | PCIBusErr170 | PCIBusErr175)) {
if (status == EpicRemoved) if (status == EpicRemoved)
break; goto out;
/* Always update the error counts to avoid overhead later. */ /* Always update the error counts to avoid overhead later. */
ep->stats.rx_missed_errors += inb(ioaddr + MPCNT); ep->stats.rx_missed_errors += inb(ioaddr + MPCNT);
ep->stats.rx_frame_errors += inb(ioaddr + ALICNT); ep->stats.rx_frame_errors += inb(ioaddr + ALICNT);
...@@ -1207,7 +1204,7 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r ...@@ -1207,7 +1204,7 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r
outl(RestartTx, ioaddr + COMMAND); outl(RestartTx, ioaddr + COMMAND);
} }
if (status & PCIBusErr170) { if (status & PCIBusErr170) {
printk(KERN_ERR "%s: PCI Bus Error! EPIC status %4.4x.\n", printk(KERN_ERR "%s: PCI Bus Error! status %4.4x.\n",
dev->name, status); dev->name, status);
epic_pause(dev); epic_pause(dev);
epic_restart(dev); epic_restart(dev);
...@@ -1215,21 +1212,12 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r ...@@ -1215,21 +1212,12 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r
/* Clear all error sources. */ /* Clear all error sources. */
outl(status & 0x7f18, ioaddr + INTSTAT); outl(status & 0x7f18, ioaddr + INTSTAT);
} }
if (!(status & EpicNormalEvent))
break;
if (--boguscnt < 0) {
printk(KERN_ERR "%s: Too much work at interrupt, "
"IntrStatus=0x%8.8x.\n",
dev->name, status);
/* Clear all interrupt sources. */
outl(0x0001ffff, ioaddr + INTSTAT);
break;
}
} while (1);
if (debug > 3) out:
printk(KERN_DEBUG "%s: exiting interrupt, intr_status=%#4.4x.\n", if (debug > 3) {
printk(KERN_DEBUG "%s: exit interrupt, intr_status=%#4.4x.\n",
dev->name, status); dev->name, status);
}
return IRQ_RETVAL(handled); 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