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,74 +1158,66 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r ...@@ -1162,74 +1158,66 @@ 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;
if ((status & EpicNapiEvent) && !ep->reschedule_in_poll) {
spin_lock(&ep->napi_lock);
if (netif_rx_schedule_prep(dev)) {
epic_napi_irq_off(dev, ep);
__netif_rx_schedule(dev);
} else
ep->reschedule_in_poll++;
spin_unlock(&ep->napi_lock);
}
status &= ~EpicNapiEvent;
/* Check uncommon events all at once. */ handled = 1;
if (status &
(CntFull | TxUnderrun | PCIBusErr170 | PCIBusErr175)) { if ((status & EpicNapiEvent) && !ep->reschedule_in_poll) {
if (status == EpicRemoved) spin_lock(&ep->napi_lock);
break; if (netif_rx_schedule_prep(dev)) {
/* Always update the error counts to avoid overhead later. */ epic_napi_irq_off(dev, ep);
ep->stats.rx_missed_errors += inb(ioaddr + MPCNT); __netif_rx_schedule(dev);
ep->stats.rx_frame_errors += inb(ioaddr + ALICNT); } else
ep->stats.rx_crc_errors += inb(ioaddr + CRCCNT); ep->reschedule_in_poll++;
spin_unlock(&ep->napi_lock);
if (status & TxUnderrun) { /* Tx FIFO underflow. */ }
ep->stats.tx_fifo_errors++; status &= ~EpicNapiEvent;
outl(ep->tx_threshold += 128, ioaddr + TxThresh);
/* Restart the transmit process. */ /* Check uncommon events all at once. */
outl(RestartTx, ioaddr + COMMAND); if (status & (CntFull | TxUnderrun | PCIBusErr170 | PCIBusErr175)) {
} if (status == EpicRemoved)
if (status & PCIBusErr170) { goto out;
printk(KERN_ERR "%s: PCI Bus Error! EPIC status %4.4x.\n",
dev->name, status); /* Always update the error counts to avoid overhead later. */
epic_pause(dev); ep->stats.rx_missed_errors += inb(ioaddr + MPCNT);
epic_restart(dev); ep->stats.rx_frame_errors += inb(ioaddr + ALICNT);
} ep->stats.rx_crc_errors += inb(ioaddr + CRCCNT);
/* Clear all error sources. */
outl(status & 0x7f18, ioaddr + INTSTAT); if (status & TxUnderrun) { /* Tx FIFO underflow. */
ep->stats.tx_fifo_errors++;
outl(ep->tx_threshold += 128, ioaddr + TxThresh);
/* Restart the transmit process. */
outl(RestartTx, ioaddr + COMMAND);
} }
if (!(status & EpicNormalEvent)) if (status & PCIBusErr170) {
break; printk(KERN_ERR "%s: PCI Bus Error! status %4.4x.\n",
if (--boguscnt < 0) { dev->name, status);
printk(KERN_ERR "%s: Too much work at interrupt, " epic_pause(dev);
"IntrStatus=0x%8.8x.\n", epic_restart(dev);
dev->name, status);
/* Clear all interrupt sources. */
outl(0x0001ffff, ioaddr + INTSTAT);
break;
} }
} while (1); /* Clear all error sources. */
outl(status & 0x7f18, ioaddr + INTSTAT);
}
if (debug > 3) out:
printk(KERN_DEBUG "%s: exiting interrupt, intr_status=%#4.4x.\n", if (debug > 3) {
dev->name, status); printk(KERN_DEBUG "%s: exit interrupt, intr_status=%#4.4x.\n",
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