mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 3/3] drivers/mci: add PXA host controller
Date: Wed, 7 Dec 2011 17:41:55 +0100	[thread overview]
Message-ID: <20111207164155.GR27267@pengutronix.de> (raw)
In-Reply-To: <87y5uocqvd.fsf@free.fr>

On Wed, Dec 07, 2011 at 05:01:58PM +0100, Robert Jarzmik wrote:
> Sascha Hauer <s.hauer@pengutronix.de> writes:
> 
> >> +	if (mmc_readl(MMC_STAT) & STAT_CLK_EN) {
> >> +		writel(STOP_CLOCK, host->base + MMC_STRPCL);
> >> +
> >> +		do {
> >> +			v = mmc_readl(MMC_STAT);
> >> +			if (!(v & STAT_CLK_EN))
> >> +				break;
> >> +			udelay(1);
> >> +		} while (timeout--);
> >
> > please use this for timeout loops:
> >
> > 	uint64_t start = get_time_ns(void);
> >
> > 	while (!is_timeout(start, 10 * MSECOND)
> > 		poll_something();
> Ok, should I do this also to the other 2 timeout loops (pxamci_read_data and
> pxamci_write_data), or can I use the same pattern which would give :

Please always use is_timeout(). Just polling 100000 times gives no well
defined timeout.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2011-12-07 16:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-06 20:11 [PATCH 1/3] arm/mach-pxa: add MMC clock Robert Jarzmik
2011-12-06 20:11 ` [PATCH 2/3] arm/mach-pxa: add mci_pxa2xx file Robert Jarzmik
2011-12-06 20:11 ` [PATCH 3/3] drivers/mci: add PXA host controller Robert Jarzmik
2011-12-07  8:49   ` Sascha Hauer
2011-12-07 16:01     ` Robert Jarzmik
2011-12-07 16:41       ` Sascha Hauer [this message]

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=20111207164155.GR27267@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=robert.jarzmik@free.fr \
    /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