mmc: core: avoid recovery flow for tuning failure

Communication scenario definitely should fail during
tuning procedure. Already does it reset controller, so
we don't need executing recovery for that case.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
This commit is contained in:
Shawn Lin
2015-06-17 18:50:52 +08:00
parent 115a967d5e
commit 951a22d3f2
2 changed files with 8 additions and 27 deletions

View File

@@ -419,7 +419,7 @@ static void mmc_get_req_timeout(struct mmc_request *mrq, u32 *timeout)
*timeout = 8000;
else if ((mrq->cmd->opcode == MMC_SEND_TUNING_BLOCK_HS200) ||
(mrq->cmd->opcode == MMC_SEND_TUNING_BLOCK))
*timeout = 30;
*timeout = 100;
}
@@ -493,32 +493,6 @@ static int mmc_wait_for_data_req_done(struct mmc_host *host,
return err;
}
static void mmc_get_req_timeout(struct mmc_request *mrq, u32 *timeout)
{
if (!mrq->cmd->data) {
if (mrq->cmd->opcode == MMC_ERASE ||
(mrq->cmd->opcode == MMC_ERASE_GROUP_START) ||
(mrq->cmd->opcode == MMC_ERASE_GROUP_END) ||
(mrq->cmd->opcode == MMC_SEND_STATUS))
*timeout = 2500000;
else
*timeout = 500;
} else {
*timeout = mrq->cmd->data->blocks *
mrq->cmd->data->blksz * 500;
*timeout = (*timeout) ? (*timeout) : 1000;
if (*timeout > 8000)
*timeout = 8000;
}
if ((mrq->cmd->opcode == SD_IO_RW_DIRECT) ||
(mrq->cmd->opcode == SD_IO_RW_EXTENDED))
*timeout = 8000;
else if ((mrq->cmd->opcode == MMC_SEND_TUNING_BLOCK_HS200) ||
(mrq->cmd->opcode == MMC_SEND_TUNING_BLOCK))
*timeout = 100;
}
static void mmc_wait_for_req_done(struct mmc_host *host,
struct mmc_request *mrq)
{
@@ -533,6 +507,7 @@ static void mmc_wait_for_req_done(struct mmc_host *host,
cmd = mrq->cmd;
cmd->error = -ETIMEDOUT;
host->ops->post_tmo(host);
dev_err(mmc_dev(host),
"req failed (CMD%u): error = %d, timeout = %dms\n",
cmd->opcode, cmd->error, timeout);

View File

@@ -1960,13 +1960,19 @@ static void dw_mci_post_tmo(struct mmc_host *mmc)
u32 sdio_int;
unsigned long timeout = 0;
bool ret_timeout = true;
u32 opcode;
opcode = host->mrq->cmd->opcode;
host->cur_slot->mrq = NULL;
host->mrq = NULL;
host->state = STATE_IDLE;
data = host->data;
if ((opcode == MMC_SEND_TUNING_BLOCK_HS200) &&
(opcode == MMC_SEND_TUNING_BLOCK))
return;
printk("[%s] -- Timeout recovery procedure start --\n",
mmc_hostname(host->mmc));