diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-05-08 18:11:30 -0400 |
---|---|---|
committer | Stephen Hemminger <shemminger@osdl.org> | 2006-05-08 19:00:27 -0400 |
commit | 01bd75645f94d49cb7ffd61022890166ce00ec2a (patch) | |
tree | 1148546fc434c3e8f5de04a9be9aced7d4d11ff1 /drivers | |
parent | cb5d9547307f44f210f88c829bad4249eeb24bc3 (diff) |
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')
-rw-r--r-- | drivers/net/sky2.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index d9cce50cffd1..940ed699a702 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -98,6 +98,10 @@ static int disable_msi = 0; | |||
98 | module_param(disable_msi, int, 0); | 98 | module_param(disable_msi, int, 0); |
99 | MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); | 99 | MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); |
100 | 100 | ||
101 | static int idle_timeout = 100; | ||
102 | module_param(idle_timeout, int, 0); | ||
103 | MODULE_PARM_DESC(idle_timeout, "Idle timeout workaround for lost interrupts (ms)"); | ||
104 | |||
101 | static const struct pci_device_id sky2_id_table[] = { | 105 | static const struct pci_device_id sky2_id_table[] = { |
102 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, | 106 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, |
103 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, | 107 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, |
@@ -2092,12 +2096,13 @@ static void sky2_descriptor_error(struct sky2_hw *hw, unsigned port, | |||
2092 | */ | 2096 | */ |
2093 | static void sky2_idle(unsigned long arg) | 2097 | static void sky2_idle(unsigned long arg) |
2094 | { | 2098 | { |
2095 | struct net_device *dev = (struct net_device *) arg; | 2099 | struct sky2_hw *hw = (struct sky2_hw *) arg; |
2100 | struct net_device *dev = hw->dev[0]; | ||
2096 | 2101 | ||
2097 | local_irq_disable(); | ||
2098 | if (__netif_rx_schedule_prep(dev)) | 2102 | if (__netif_rx_schedule_prep(dev)) |
2099 | __netif_rx_schedule(dev); | 2103 | __netif_rx_schedule(dev); |
2100 | local_irq_enable(); | 2104 | |
2105 | mod_timer(&hw->idle_timer, jiffies + msecs_to_jiffies(idle_timeout)); | ||
2101 | } | 2106 | } |
2102 | 2107 | ||
2103 | 2108 | ||
@@ -2145,8 +2150,6 @@ static int sky2_poll(struct net_device *dev0, int *budget) | |||
2145 | if (work_done >= work_limit) | 2150 | if (work_done >= work_limit) |
2146 | return 1; | 2151 | return 1; |
2147 | 2152 | ||
2148 | mod_timer(&hw->idle_timer, jiffies + HZ); | ||
2149 | |||
2150 | netif_rx_complete(dev0); | 2153 | netif_rx_complete(dev0); |
2151 | 2154 | ||
2152 | status = sky2_read32(hw, B0_Y2_SP_LISR); | 2155 | 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) | |||
2167 | prefetch(&hw->st_le[hw->st_idx]); | 2170 | prefetch(&hw->st_le[hw->st_idx]); |
2168 | if (likely(__netif_rx_schedule_prep(dev0))) | 2171 | if (likely(__netif_rx_schedule_prep(dev0))) |
2169 | __netif_rx_schedule(dev0); | 2172 | __netif_rx_schedule(dev0); |
2170 | else | ||
2171 | printk(KERN_DEBUG PFX "irq race detected\n"); | ||
2172 | 2173 | ||
2173 | return IRQ_HANDLED; | 2174 | return IRQ_HANDLED; |
2174 | } | 2175 | } |
@@ -3290,7 +3291,10 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
3290 | 3291 | ||
3291 | sky2_write32(hw, B0_IMSK, Y2_IS_BASE); | 3292 | sky2_write32(hw, B0_IMSK, Y2_IS_BASE); |
3292 | 3293 | ||
3293 | setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) dev); | 3294 | setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw); |
3295 | if (idle_timeout > 0) | ||
3296 | mod_timer(&hw->idle_timer, | ||
3297 | jiffies + msecs_to_jiffies(idle_timeout)); | ||
3294 | 3298 | ||
3295 | pci_set_drvdata(pdev, hw); | 3299 | pci_set_drvdata(pdev, hw); |
3296 | 3300 | ||