Skip to content

Commit

Permalink
mmc: Fix mmc_delay() function
Browse files Browse the repository at this point in the history
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: Pierre Ossman <drzeus@drzeus.cx>
  • Loading branch information
Pierre Ossman committed Dec 1, 2006
1 parent e45a1bd commit 7377812
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/mmc/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 7377812

Please sign in to comment.