summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-05-08 15:11:30 -0700
committerStephen Hemminger <shemminger@osdl.org>2006-05-08 16:00:27 -0700
commit01bd75645f94d49cb7ffd61022890166ce00ec2a (patch)
tree1148546fc434c3e8f5de04a9be9aced7d4d11ff1 /drivers/net
parentcb5d9547307f44f210f88c829bad4249eeb24bc3 (diff)
downloadop-kernel-dev-01bd75645f94d49cb7ffd61022890166ce00ec2a.zip
op-kernel-dev-01bd75645f94d49cb7ffd61022890166ce00ec2a.tar.gz
sky2: edge triggered workaround enhancement
Need to make the edge-triggered workaround timer faster to get marginally better peformance. The test_and_set_bit in schedule_prep() acts as a barrier already. Make it a module parameter so that laptops who are concerned about power can set it to 0; and user's stuck with broken BIOS's can turn the driver into pure polling. Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/sky2.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index d9cce50..940ed69 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -98,6 +98,10 @@ static int disable_msi = 0;
module_param(disable_msi, int, 0);
MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
+static int idle_timeout = 100;
+module_param(idle_timeout, int, 0);
+MODULE_PARM_DESC(idle_timeout, "Idle timeout workaround for lost interrupts (ms)");
+
static const struct pci_device_id sky2_id_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) },
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) },
@@ -2092,12 +2096,13 @@ static void sky2_descriptor_error(struct sky2_hw *hw, unsigned port,
*/
static void sky2_idle(unsigned long arg)
{
- struct net_device *dev = (struct net_device *) arg;
+ struct sky2_hw *hw = (struct sky2_hw *) arg;
+ struct net_device *dev = hw->dev[0];
- local_irq_disable();
if (__netif_rx_schedule_prep(dev))
__netif_rx_schedule(dev);
- local_irq_enable();
+
+ mod_timer(&hw->idle_timer, jiffies + msecs_to_jiffies(idle_timeout));
}
@@ -2145,8 +2150,6 @@ static int sky2_poll(struct net_device *dev0, int *budget)
if (work_done >= work_limit)
return 1;
- mod_timer(&hw->idle_timer, jiffies + HZ);
-
netif_rx_complete(dev0);
status = sky2_read32(hw, B0_Y2_SP_LISR);
@@ -2167,8 +2170,6 @@ static irqreturn_t sky2_intr(int irq, void *dev_id, struct pt_regs *regs)
prefetch(&hw->st_le[hw->st_idx]);
if (likely(__netif_rx_schedule_prep(dev0)))
__netif_rx_schedule(dev0);
- else
- printk(KERN_DEBUG PFX "irq race detected\n");
return IRQ_HANDLED;
}
@@ -3290,7 +3291,10 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
- setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) dev);
+ setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw);
+ if (idle_timeout > 0)
+ mod_timer(&hw->idle_timer,
+ jiffies + msecs_to_jiffies(idle_timeout));
pci_set_drvdata(pdev, hw);
OpenPOWER on IntegriCloud