lkml.org 
[lkml]   [2012]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mmc: change mmc_delay() to use usleep_range()
Hi,

On Fri, 13 Jan 2012, Dmitry Antipov wrote:
> Use the usleep_range() to simplify mmc_delay() and give some more
> accuracy to it - but with an exception of mmc_card_sleepawake():
> since sleep/awake timeout varies in a wide range, different
> delay methods should be used.
>
> Signed-off-by: Dmitry Antipov <dmitry.antipov@linaro.org>

[...]

> + if (!(host->caps & MMC_CAP_WAIT_WHILE_BUSY)) {
> + /* JEDEC MMCA 4.41 specifies the timeout value is in 200ns..838.86ms
> + range. Round it up to 1us and use an appropriate delay method. */
> + unsigned long us = DIV_ROUND_UP(card->ext_csd.sa_timeout, 10);
> + if (us < 10)
> + udelay(us);
> + else
> + usleep_range(us, us + 100);
> + }

I think this part of the patch is over-engineered. What difference
does it make in practice if you round it up to a bigger value so that
usleep_range() makes always sense? The S/A timeout defines the max time
the transition can take, it's not wrong to wait a bit longer. Also note
that udelay() is not accurate so you need to add some margin anyway.

A.


\
 
 \ /
  Last update: 2012-01-13 22:43    [W:0.123 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site