]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
b44: timer power saving
authorStephen Hemminger <shemminger@linux-foundation.org>
Mon, 4 Jun 2007 20:25:37 +0000 (13:25 -0700)
committerJeff Garzik <jeff@garzik.org>
Mon, 9 Jul 2007 02:16:39 +0000 (22:16 -0400)
Make the PHY and statistic timer run on one second boundary
for powersaving.

On resume, the driver should check for link up immediately, to
get online faster (rather than waiting for the next second).

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/b44.c

index 879a2fff474e007f62907e642d1ea9fdab2ec04b..e87bab9f9bea8baba0ae122e1f37880f7a2a6282 100644 (file)
@@ -599,8 +599,7 @@ static void b44_timer(unsigned long __opaque)
 
        spin_unlock_irq(&bp->lock);
 
-       bp->timer.expires = jiffies + HZ;
-       add_timer(&bp->timer);
+       mod_timer(&bp->timer, round_jiffies(jiffies + HZ));
 }
 
 static void b44_tx(struct b44 *bp)
@@ -2348,11 +2347,11 @@ static int b44_resume(struct pci_dev *pdev)
        netif_device_attach(bp->dev);
        spin_unlock_irq(&bp->lock);
 
-       bp->timer.expires = jiffies + HZ;
-       add_timer(&bp->timer);
-
        b44_enable_ints(bp);
        netif_wake_queue(dev);
+
+       mod_timer(&bp->timer, jiffies + 1);
+
        return 0;
 }