pcnet32: round off carrier watch timer

Submitted by stephen hemminger on Jan. 7, 2009, 8:10 p.m.

Details

Message ID 20090107121036.4e16b7cf@extreme
State Accepted
Delegated to: David Miller
Headers show

Commit Message

stephen hemminger Jan. 7, 2009, 8:10 p.m.
The link check watchdog timer on this driver fires every two seconds, but
since not aligned it causes extra wakeups. It is more important on this
driver than most because it is the hardware that is emulated by default
when using network interfaces on VMware.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Wang Chen Jan. 8, 2009, 12:32 a.m.
Stephen Hemminger said the following on 2009-1-8 4:10:
> The link check watchdog timer on this driver fires every two seconds, but
> since not aligned it causes extra wakeups. It is more important on this
> driver than most because it is the hardware that is emulated by default
> when using network interfaces on VMware.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> --- a/drivers/net/pcnet32.c	2009-01-07 12:05:54.218712996 -0800
> +++ b/drivers/net/pcnet32.c	2009-01-07 12:06:37.430288101 -0800
> @@ -2282,7 +2282,7 @@ static int pcnet32_open(struct net_devic
>  	if (lp->chip_version >= PCNET32_79C970A) {
>  		/* Print the link status and start the watchdog */
>  		pcnet32_check_media(dev, 1);
> -		mod_timer(&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT);
> +		mod_timer(&lp->watchdog_timer, PCNET32_WATCHDOG_TIMEOUT);

should be
+		mod_timer(&lp->watchdog_timer, round_jiffies(PCNET32_WATCHDOG_TIMEOUT));
same as that in pcnet32_watchdog()?

>  	}
>  
>  	i = 0;
> @@ -2917,7 +2917,7 @@ static void pcnet32_watchdog(struct net_
>  	pcnet32_check_media(dev, 0);
>  	spin_unlock_irqrestore(&lp->lock, flags);
>  
> -	mod_timer(&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT);
> +	mod_timer(&lp->watchdog_timer, round_jiffies(PCNET32_WATCHDOG_TIMEOUT));
>  }
>  
>  static int pcnet32_pm_suspend(struct pci_dev *pdev, pm_message_t state)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger Jan. 8, 2009, 12:38 a.m.
On Thu, 08 Jan 2009 08:32:47 +0800
Wang Chen <wangchen@cn.fujitsu.com> wrote:

> Stephen Hemminger said the following on 2009-1-8 4:10:
> > The link check watchdog timer on this driver fires every two seconds, but
> > since not aligned it causes extra wakeups. It is more important on this
> > driver than most because it is the hardware that is emulated by default
> > when using network interfaces on VMware.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> > 
> > --- a/drivers/net/pcnet32.c	2009-01-07 12:05:54.218712996 -0800
> > +++ b/drivers/net/pcnet32.c	2009-01-07 12:06:37.430288101 -0800
> > @@ -2282,7 +2282,7 @@ static int pcnet32_open(struct net_devic
> >  	if (lp->chip_version >= PCNET32_79C970A) {
> >  		/* Print the link status and start the watchdog */
> >  		pcnet32_check_media(dev, 1);
> > -		mod_timer(&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT);
> > +		mod_timer(&lp->watchdog_timer, PCNET32_WATCHDOG_TIMEOUT);
> 
> should be
> +		mod_timer(&lp->watchdog_timer, round_jiffies(PCNET32_WATCHDOG_TIMEOUT));
> same as that in pcnet32_watchdog()?

It only gets run on the first tick so it doesn't matter.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 8, 2009, 7:17 p.m.
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 7 Jan 2009 12:10:36 -0800

> The link check watchdog timer on this driver fires every two seconds, but
> since not aligned it causes extra wakeups. It is more important on this
> driver than most because it is the hardware that is emulated by default
> when using network interfaces on VMware.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch hide | download patch | download mbox

--- a/drivers/net/pcnet32.c	2009-01-07 12:05:54.218712996 -0800
+++ b/drivers/net/pcnet32.c	2009-01-07 12:06:37.430288101 -0800
@@ -2282,7 +2282,7 @@  static int pcnet32_open(struct net_devic
 	if (lp->chip_version >= PCNET32_79C970A) {
 		/* Print the link status and start the watchdog */
 		pcnet32_check_media(dev, 1);
-		mod_timer(&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT);
+		mod_timer(&lp->watchdog_timer, PCNET32_WATCHDOG_TIMEOUT);
 	}
 
 	i = 0;
@@ -2917,7 +2917,7 @@  static void pcnet32_watchdog(struct net_
 	pcnet32_check_media(dev, 0);
 	spin_unlock_irqrestore(&lp->lock, flags);
 
-	mod_timer(&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT);
+	mod_timer(&lp->watchdog_timer, round_jiffies(PCNET32_WATCHDOG_TIMEOUT));
 }
 
 static int pcnet32_pm_suspend(struct pci_dev *pdev, pm_message_t state)