linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sean MacLennan <smaclennan@pikatech.com>
To: "Timur Tabi" <timur@freescale.com>
Cc: scottwood@freescale.com, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH v6] introduce macro spin_event_timeout()
Date: Fri, 1 May 2009 17:33:54 -0400	[thread overview]
Message-ID: <20090501173354.64e78def@lappy.seanm.ca> (raw)
In-Reply-To: <1240859144-20893-1-git-send-email-timur@freescale.com>

On Mon, 27 Apr 2009 14:05:44 -0500
"Timur Tabi" <timur@freescale.com> wrote:

> +#define spin_event_timeout(condition, timeout, delay,
> rc)                   \
> +{                                                                           \
> +	unsigned long __loops = tb_ticks_per_usec *
> timeout;                \
> +	unsigned long __start =
> get_tbl();                                  \
> +	while (!(rc = (condition)) && (tb_ticks_since(__start) <=
> __loops)) \
> +		udelay(delay);
> 	    \ +}
> +

Would cpu_relax be a good thing to put here?

Something like:

while (!(rc = (condition)) && (tb_ticks_since(__start) <= __loops)) \
	if (delay) \
		udelay(delay); \
	else \
		cpu_relax(); \

Cheers,
   Sean

  parent reply	other threads:[~2009-05-01 21:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-27 19:05 [PATCH v6] introduce macro spin_event_timeout() Timur Tabi
2009-04-29 22:48 ` Timur Tabi
2009-05-01 20:51 ` Kumar Gala
2009-05-01 20:55   ` Timur Tabi
2009-05-01 20:56   ` Scott Wood
2009-05-01 21:33 ` Sean MacLennan [this message]
2009-05-01 21:44   ` Timur Tabi

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=20090501173354.64e78def@lappy.seanm.ca \
    --to=smaclennan@pikatech.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=scottwood@freescale.com \
    --cc=timur@freescale.com \
    /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;
as well as URLs for NNTP newsgroup(s).