summaryrefslogtreecommitdiff
path: root/drivers/mmc/card
diff options
context:
space:
mode:
authorVijay Viswanath <vviswana@codeaurora.org>2016-11-02 16:17:30 +0530
committerVijay Viswanath <vviswana@codeaurora.org>2017-02-22 10:41:47 +0530
commitb17b8358e0748657e3454ddfbeafc6896591530e (patch)
tree9a324faac65856608a7105fd00ef0dc131160cc4 /drivers/mmc/card
parent3294e91ec6ee553a754fe6d7f6b03b60d86dcc2c (diff)
MMC : card: check for card status incase of timeout error
Timeout errors can occur because of execution error in device during execution of last command. For errors encountered while executing commands in card, like cmd46 or 47, the card will stop execution and wait for the next command from controller to return error information. If controller sends no command, then a timeout error will occur. To retrieve the error information in card, send status command must be sent. In case a non-timeout error like RED error is detected, there is no need to send CMD13 to card as the error information is already present in the Resp Arg register. Change-Id: I6ac0d3db834a3d5a6c67ee08d6232240c35714ff Signed-off-by: Vijay Viswanath <vviswana@codeaurora.org>
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r--drivers/mmc/card/block.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 52e3e9b5b778..60b02f28a8ff 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -3482,15 +3482,23 @@ static void mmc_blk_cmdq_err(struct mmc_queue *mq)
/* RED error - Fatal: requires reset */
if (mrq->cmdq_req->resp_err) {
err = mrq->cmdq_req->resp_err;
+ goto reset;
+ }
+
+ /*
+ * TIMEOUT errrors can happen because of execution error
+ * in the last command. So send cmd 13 to get device status
+ */
+ if ((mrq->cmd && (mrq->cmd->error == -ETIMEDOUT)) ||
+ (mrq->data && (mrq->data->error == -ETIMEDOUT))) {
if (mmc_host_halt(host) || mmc_host_cq_disable(host)) {
ret = get_card_status(host->card, &status, 0);
if (ret)
pr_err("%s: CMD13 failed with err %d\n",
mmc_hostname(host), ret);
}
- pr_err("%s: Response error detected with device status 0x%08x\n",
+ pr_err("%s: Timeout error detected with device status 0x%08x\n",
mmc_hostname(host), status);
- goto reset;
}
/*