* [PATCH] mmc: core: Use usleep_range for delays less than 20ms
@ 2011-11-09 3:49 Sujit Reddy Thumma
0 siblings, 0 replies; only message in thread
From: Sujit Reddy Thumma @ 2011-11-09 3:49 UTC (permalink / raw)
To: linux-mmc; +Cc: Sujit Reddy Thumma, linux-arm-msm, cjb
msleep of any delay less than 20ms (or 2 jiffies) would
give an unpredictable delay (most of the times as ~20ms).
Use usleep_range in mmc_delay() for delays less than two jiffies.
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
---
drivers/mmc/core/core.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 14664f1..45a6a12 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -50,6 +50,8 @@ static inline void mmc_delay(unsigned int ms)
if (ms < 1000 / HZ) {
cond_resched();
mdelay(ms);
+ } else if (ms < jiffies_to_msecs(2)) {
+ usleep_range(ms * 1000, (ms + 1) * 1000);
} else {
msleep(ms);
}
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-11-09 3:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-09 3:49 [PATCH] mmc: core: Use usleep_range for delays less than 20ms Sujit Reddy Thumma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox