Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26574
b: refs/heads/master
c: 01bd756
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger committed May 8, 2006
1 parent f85fa3d commit 26f0445
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb5d9547307f44f210f88c829bad4249eeb24bc3
refs/heads/master: 01bd75645f94d49cb7ffd61022890166ce00ec2a
20 changes: 12 additions & 8 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down Expand Up @@ -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));
}


Expand Down Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 26f0445

Please sign in to comment.