Commit 0e5d5442 authored by Mark Brown's avatar Mark Brown Committed by Jeff Garzik

natsemi: Use round_jiffies() for slow timers

Unless we have failed to fill the RX ring the timer used by the natsemi
driver is not particularly urgent and can use round_jiffies() to allow
grouping with other timers.
Signed-off-by: default avatarMark Brown <broonie@sirena.org.uk>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent f4921aff
...@@ -1576,7 +1576,7 @@ static int netdev_open(struct net_device *dev) ...@@ -1576,7 +1576,7 @@ static int netdev_open(struct net_device *dev)
/* Set the timer to check for link beat. */ /* Set the timer to check for link beat. */
init_timer(&np->timer); init_timer(&np->timer);
np->timer.expires = jiffies + NATSEMI_TIMER_FREQ; np->timer.expires = round_jiffies(jiffies + NATSEMI_TIMER_FREQ);
np->timer.data = (unsigned long)dev; np->timer.data = (unsigned long)dev;
np->timer.function = &netdev_timer; /* timer handler */ np->timer.function = &netdev_timer; /* timer handler */
add_timer(&np->timer); add_timer(&np->timer);
...@@ -1856,7 +1856,11 @@ static void netdev_timer(unsigned long data) ...@@ -1856,7 +1856,11 @@ static void netdev_timer(unsigned long data)
next_tick = 1; next_tick = 1;
} }
} }
mod_timer(&np->timer, jiffies + next_tick);
if (next_tick > 1)
mod_timer(&np->timer, round_jiffies(jiffies + next_tick));
else
mod_timer(&np->timer, jiffies + next_tick);
} }
static void dump_ring(struct net_device *dev) static void dump_ring(struct net_device *dev)
...@@ -3331,7 +3335,7 @@ static int natsemi_resume (struct pci_dev *pdev) ...@@ -3331,7 +3335,7 @@ static int natsemi_resume (struct pci_dev *pdev)
spin_unlock_irq(&np->lock); spin_unlock_irq(&np->lock);
enable_irq(dev->irq); enable_irq(dev->irq);
mod_timer(&np->timer, jiffies + 1*HZ); mod_timer(&np->timer, round_jiffies(jiffies + 1*HZ));
} }
netif_device_attach(dev); netif_device_attach(dev);
out: out:
......
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