Skip to content

Commit 0ef89ec

Browse files
committed
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 <[email protected]> Signed-off-by: Ulf Hansson <[email protected]> Tested-by: Damien Thebault <[email protected]>
1 parent 4ba9bf9 commit 0ef89ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mmc/host/mvsdio.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ static void mvsd_request(struct mmc_host *mmc, struct mmc_request *mrq)
143143
struct mmc_command *cmd = mrq->cmd;
144144
u32 cmdreg = 0, xfer = 0, intr = 0;
145145
unsigned long flags;
146+
unsigned int timeout;
146147

147148
BUG_ON(host->mrq != NULL);
148149
host->mrq = mrq;
@@ -234,7 +235,8 @@ static void mvsd_request(struct mmc_host *mmc, struct mmc_request *mrq)
234235
mvsd_write(MVSD_NOR_INTR_EN, host->intr_en);
235236
mvsd_write(MVSD_ERR_INTR_EN, 0xffff);
236237

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));
238240

239241
spin_unlock_irqrestore(&host->lock, flags);
240242
}

0 commit comments

Comments
 (0)