Skip to content

Commit

Permalink
mmc: sdhci: Allow for long command timeouts
Browse files Browse the repository at this point in the history
The driver has a timer with a 10 second timeout to catch devices that stop
responding.  However it is possible for commands to take even longer than
that.  Change the timer timeout to reflect the command timeout.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <chris@printf.net>
  • Loading branch information
Adrian Hunter authored and Chris Ball committed Jan 20, 2014
1 parent e562405 commit 3e1a689
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,12 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
mdelay(1);
}

mod_timer(&host->timer, jiffies + 10 * HZ);
timeout = jiffies;
if (!cmd->data && cmd->cmd_timeout_ms > 9000)
timeout += DIV_ROUND_UP(cmd->cmd_timeout_ms, 1000) * HZ + HZ;
else
timeout += 10 * HZ;
mod_timer(&host->timer, timeout);

host->cmd = cmd;

Expand Down

0 comments on commit 3e1a689

Please sign in to comment.