diff options
author | Mark Brown <broonie@sirena.org.uk> | 2007-10-10 06:05:44 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-15 14:20:45 -0400 |
commit | 0e5d5442cbe3399d789d6a75c6e3a0db37f846f5 (patch) | |
tree | 5ca33d4c1f7d050a82ee5dd042a9f49f621d3ca3 /drivers | |
parent | f4921aff5b174349bc36551f142a5dbac782ea3f (diff) |
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: Mark Brown <broonie@sirena.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/natsemi.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 527f9dcc7f69..b881786eebd4 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -1576,7 +1576,7 @@ static int netdev_open(struct net_device *dev) | |||
1576 | 1576 | ||
1577 | /* Set the timer to check for link beat. */ | 1577 | /* Set the timer to check for link beat. */ |
1578 | init_timer(&np->timer); | 1578 | init_timer(&np->timer); |
1579 | np->timer.expires = jiffies + NATSEMI_TIMER_FREQ; | 1579 | np->timer.expires = round_jiffies(jiffies + NATSEMI_TIMER_FREQ); |
1580 | np->timer.data = (unsigned long)dev; | 1580 | np->timer.data = (unsigned long)dev; |
1581 | np->timer.function = &netdev_timer; /* timer handler */ | 1581 | np->timer.function = &netdev_timer; /* timer handler */ |
1582 | add_timer(&np->timer); | 1582 | add_timer(&np->timer); |
@@ -1856,7 +1856,11 @@ static void netdev_timer(unsigned long data) | |||
1856 | next_tick = 1; | 1856 | next_tick = 1; |
1857 | } | 1857 | } |
1858 | } | 1858 | } |
1859 | mod_timer(&np->timer, jiffies + next_tick); | 1859 | |
1860 | if (next_tick > 1) | ||
1861 | mod_timer(&np->timer, round_jiffies(jiffies + next_tick)); | ||
1862 | else | ||
1863 | mod_timer(&np->timer, jiffies + next_tick); | ||
1860 | } | 1864 | } |
1861 | 1865 | ||
1862 | static void dump_ring(struct net_device *dev) | 1866 | static void dump_ring(struct net_device *dev) |
@@ -3331,7 +3335,7 @@ static int natsemi_resume (struct pci_dev *pdev) | |||
3331 | spin_unlock_irq(&np->lock); | 3335 | spin_unlock_irq(&np->lock); |
3332 | enable_irq(dev->irq); | 3336 | enable_irq(dev->irq); |
3333 | 3337 | ||
3334 | mod_timer(&np->timer, jiffies + 1*HZ); | 3338 | mod_timer(&np->timer, round_jiffies(jiffies + 1*HZ)); |
3335 | } | 3339 | } |
3336 | netif_device_attach(dev); | 3340 | netif_device_attach(dev); |
3337 | out: | 3341 | out: |