提交 73778120 编写于 作者: P Pierre Ossman

mmc: Fix mmc_delay() function

Several fixes for mmc_delay():

 * Repair if-clause that was supposed to detect sub-hz delays.
 * Change yield() to cond_resched() as yield() no longer has the
   semantics we desire.
 * mmc_delay() is used to guarantee protocol delays, so we cannot
   return early (i.e. use _interruptable).

Based on patch by Amol Lad.
Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
上级 e45a1bd2
......@@ -454,11 +454,11 @@ static void mmc_deselect_cards(struct mmc_host *host)
static inline void mmc_delay(unsigned int ms)
{
if (ms < HZ / 1000) {
yield();
if (ms < 1000 / HZ) {
cond_resched();
mdelay(ms);
} else {
msleep_interruptible (ms);
msleep(ms);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册