diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2013-11-14 03:16:20 -0500 |
---|---|---|
committer | Chris Ball <chris@printf.net> | 2014-01-20 09:54:40 -0500 |
commit | 3e1a6892481034193b2502725f787465ebf39818 (patch) | |
tree | fd7969412565a38b9a74a32bac02ce4abff0003e /drivers/mmc/host/sdhci.c | |
parent | e5624054c1726a16c13a89c08b2792aba3df06eb (diff) |
mmc: sdhci: Allow for long command timeouts
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>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 0a1893a54dd7..9ddef4763541 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -1018,7 +1018,12 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) | |||
1018 | mdelay(1); | 1018 | mdelay(1); |
1019 | } | 1019 | } |
1020 | 1020 | ||
1021 | mod_timer(&host->timer, jiffies + 10 * HZ); | 1021 | timeout = jiffies; |
1022 | if (!cmd->data && cmd->cmd_timeout_ms > 9000) | ||
1023 | timeout += DIV_ROUND_UP(cmd->cmd_timeout_ms, 1000) * HZ + HZ; | ||
1024 | else | ||
1025 | timeout += 10 * HZ; | ||
1026 | mod_timer(&host->timer, timeout); | ||
1022 | 1027 | ||
1023 | host->cmd = cmd; | 1028 | host->cmd = cmd; |
1024 | 1029 | ||