mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjanv@redhat.com>
To: Chris Wright <chrisw@osdl.org>
Cc: linux-kernel@vger.kernel.org, jgarzik@pobox.com
Subject: Re: [PATCH 7/13] use cpu_relax() in busy loop
Date: Fri, 19 Sep 2003 09:37:25 +0200	[thread overview]
Message-ID: <1063957044.5394.7.camel@laptop.fenrus.com> (raw)
In-Reply-To: <20030918163523.K16499@osdlab.pdx.osdl.net>

[-- Attachment #1: Type: text/plain, Size: 2405 bytes --]

On Fri, 2003-09-19 at 01:35, Chris Wright wrote:
> Replace busy loop nop with cpu_relax().
> 
> Jeff, here's a batch for net drivers.  They all look pretty straight
> forward.
> 
> ===== drivers/net/3c501.c 1.19 vs edited =====
> --- 1.19/drivers/net/3c501.c	Tue Aug 26 13:21:28 2003
> +++ edited/drivers/net/3c501.c	Thu Sep 18 11:30:18 2003
> @@ -251,7 +251,8 @@
>  		outb(0x00, AX_CMD);
>  
>  		delay = jiffies + HZ/50;
> -		while (time_before(jiffies, delay)) ;
> +		while (time_before(jiffies, delay))
> +			cpu_relax();
>  		autoirq = probe_irq_off(irq_mask);

mdelay()

>  
>  		if (autoirq == 0)
> ===== drivers/net/3c505.c 1.25 vs edited =====
> --- 1.25/drivers/net/3c505.c	Tue Aug 26 13:29:32 2003
> +++ edited/drivers/net/3c505.c	Thu Sep 18 11:32:26 2003
> @@ -299,16 +299,20 @@
>  	}
>  	outb_control(adapter->hcr_val | ATTN | DIR, dev);
>  	timeout = jiffies + 1*HZ/100;
> -	while (time_before_eq(jiffies, timeout));
> +	while (time_before_eq(jiffies, timeout))
> +		cpu_relax();

mdelay()

>  	timeout = jiffies + 1*HZ/100;
> -	while (time_before_eq(jiffies, timeout));
> +	while (time_before_eq(jiffies, timeout))
> +		cpu_relax();

mdelay()

>  	outb_control(adapter->hcr_val | FLSH, dev);
>  	timeout = jiffies + 1*HZ/100;
> -	while (time_before_eq(jiffies, timeout));
> +	while (time_before_eq(jiffies, timeout))
> +		cpu_relax();

mdelay()
>  	outb_control(adapter->hcr_val & ~FLSH, dev);
>  	timeout = jiffies + 1*HZ/100;
> -	while (time_before_eq(jiffies, timeout));
> +	while (time_before_eq(jiffies, timeout))
> +		cpu_relax();
>  

mdelay()
> ===== drivers/net/eepro.c 1.19 vs edited =====
> --- 1.19/drivers/net/eepro.c	Tue Jul 15 10:01:29 2003
> +++ edited/drivers/net/eepro.c	Thu Sep 18 11:33:52 2003
> @@ -904,7 +904,8 @@
>  			eepro_diag(ioaddr); /* RESET the 82595 */
>  
>  			delay = jiffies + HZ/50;
> -			while (time_before(jiffies, delay)) ;
> +			while (time_before(jiffies, delay))
> +				cpu_relax();

mdelay()
> ===== drivers/net/lance.c 1.18 vs edited =====
> --- 1.18/drivers/net/lance.c	Sun Apr 20 22:41:09 2003
> +++ edited/drivers/net/lance.c	Thu Sep 18 11:37:30 2003
> @@ -554,7 +554,8 @@
>  		outw(0x0041, ioaddr+LANCE_DATA);
>  
>  		delay = jiffies + HZ/50;
> -		while (time_before(jiffies, delay)) ;
> +		while (time_before(jiffies, delay))
> +			cpu_relax();

mdelay()



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2003-09-19  7:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-18 23:25 [PATCH 1/13] " Chris Wright
2003-09-18 23:27 ` [PATCH 2/13] " Chris Wright
2003-09-18 23:29   ` [PATCH 3/13] " Chris Wright
2003-09-18 23:31     ` [PATCH 4/13] " Chris Wright
2003-09-18 23:33       ` [PATCH 5/13] " Chris Wright
2003-09-18 23:34         ` [PATCH 6/13] " Chris Wright
2003-09-18 23:35           ` [PATCH 7/13] " Chris Wright
2003-09-18 23:36             ` [PATCH 8/13] " Chris Wright
2003-09-18 23:37               ` [PATCH 9/13] " Chris Wright
2003-09-18 23:40                 ` [PATCH 10/13] " Chris Wright
2003-09-18 23:41                   ` [PATCH 11/13] " Chris Wright
2003-09-18 23:43                     ` [PATCH 12/13] " Chris Wright
2003-09-18 23:46                       ` [PATCH 13/13] " Chris Wright
2003-09-20  7:37                 ` [PATCH 9/13] " David S. Miller
2003-09-19  7:37             ` Arjan van de Ven [this message]
2003-09-19 19:49               ` [PATCH 7/13] " Chris Wright
2003-09-19  7:34       ` [PATCH 4/13] " Arjan van de Ven
2003-09-19 19:48         ` Chris Wright
2003-09-19 19:54           ` Arjan van de Ven
2003-09-19  7:33   ` [PATCH 2/13] " Arjan van de Ven
2003-09-19 19:49     ` Chris Wright

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1063957044.5394.7.camel@laptop.fenrus.com \
    --to=arjanv@redhat.com \
    --cc=chrisw@osdl.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®