aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2018-05-31 06:16:04 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2018-05-31 09:01:13 -0400
commit0ef89ec24e7bfe17fb81ec222f3cd39bd5090efc (patch)
tree8ed6823e415774b7d331d6689457d6394f69d184
parent4ba9bf98b8996b70d73381e700384ac75b82f745 (diff)
mmc: mvsdio: Respect card busy time out from mmc core
Instead of using a hardcoded timeout of 5 * HZ jiffies, let's respect the command busy timeout provided by the mmc core. This make the used timeout more reliable. Cc: Damien Thebault <damien.thebault@vitec.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Damien Thebault <damien.thebault@vitec.com>
-rw-r--r--drivers/mmc/host/mvsdio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 210247b3d11a..4c70829cffd7 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -143,6 +143,7 @@ static void mvsd_request(struct mmc_host *mmc, struct mmc_request *mrq)
143 struct mmc_command *cmd = mrq->cmd; 143 struct mmc_command *cmd = mrq->cmd;
144 u32 cmdreg = 0, xfer = 0, intr = 0; 144 u32 cmdreg = 0, xfer = 0, intr = 0;
145 unsigned long flags; 145 unsigned long flags;
146 unsigned int timeout;
146 147
147 BUG_ON(host->mrq != NULL); 148 BUG_ON(host->mrq != NULL);
148 host->mrq = mrq; 149 host->mrq = mrq;
@@ -234,7 +235,8 @@ static void mvsd_request(struct mmc_host *mmc, struct mmc_request *mrq)
234 mvsd_write(MVSD_NOR_INTR_EN, host->intr_en); 235 mvsd_write(MVSD_NOR_INTR_EN, host->intr_en);
235 mvsd_write(MVSD_ERR_INTR_EN, 0xffff); 236 mvsd_write(MVSD_ERR_INTR_EN, 0xffff);
236 237
237 mod_timer(&host->timer, jiffies + 5 * HZ); 238 timeout = cmd->busy_timeout ? cmd->busy_timeout : 5000;
239 mod_timer(&host->timer, jiffies + msecs_to_jiffies(timeout));
238 240
239 spin_unlock_irqrestore(&host->lock, flags); 241 spin_unlock_irqrestore(&host->lock, flags);
240} 242}