Skip to content

Commit

Permalink
mmc: dw_mmc: Increase cmd11 timeout to 500ms
Browse files Browse the repository at this point in the history
Although the cmd11 interrupt should come within 2ms, that's a very
short time.  Let's increase the timeout to be really sure that we
don't get an accidnetal timeout.  One case in particular this is
useful is if you've got a serial console and printk in just the right
places.  Under that scenario I've seen delays of up to 130ms before
the interrupt fired.

CMD11 is only sent during card insertion, so this extra timeout
shouldn't be terrible.

Fixes: 5c93516 ("mmc: dw_mmc: Add a timeout for sending CMD11")
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Doug Anderson authored and Ulf Hansson committed Apr 9, 2015
1 parent 76184ac commit 8886a6f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,11 +1024,13 @@ static void __dw_mci_start_request(struct dw_mci *host,

if (cmd->opcode == SD_SWITCH_VOLTAGE) {
/*
* Databook says to fail after 2ms w/ no response; give an
* extra jiffy just in case we're about to roll over.
* Databook says to fail after 2ms w/ no response, but evidence
* shows that sometimes the cmd11 interrupt takes over 130ms.
* We'll set to 500ms, plus an extra jiffy just in case jiffies
* is just about to roll over.
*/
mod_timer(&host->cmd11_timer,
jiffies + msecs_to_jiffies(2) + 1);
jiffies + msecs_to_jiffies(500) + 1);
}

if (mrq->stop)
Expand Down

0 comments on commit 8886a6f

Please sign in to comment.