diff options
| author | Veerabhadrarao Badiganti <vbadigan@codeaurora.org> | 2017-02-21 15:06:23 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-03-03 09:01:29 -0800 |
| commit | 2c7676c7d7bff911652015685f74b5cb97cd8a6d (patch) | |
| tree | f0fc5d893ff985b1cc86418fe81b8b93b4a9226e | |
| parent | 83333ef2f4925f18f6072b5ba031267c7cdf6d1f (diff) | |
mmc: card: block: Add support for completing cmdq requests with error
Add support for completing failed cmdq requests with error.
If any cmdq request is failed, we enter into error recovery path and
re-queue the same request. But in some cases (e.g. requests failed due
to invalid crypto configuration) same request shouldn't be re-queued
but should complete the request with error so that the a new requested
would be issued.
In mmc_blk_cmdq_complete_rq(), for a request if error information is
present and flag which indicates to skip error handling is set
then complete that request with error info.
Change-Id: I9c4a446bb27b4d82a0847d0bfb4481b314df479c
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
| -rw-r--r-- | drivers/mmc/card/block.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 60b02f28a8ff..c1ce221f491e 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -3544,7 +3544,7 @@ void mmc_blk_cmdq_complete_rq(struct request *rq) else if (mrq->data && mrq->data->error) err = mrq->data->error; - if (err || cmdq_req->resp_err) { + if ((err || cmdq_req->resp_err) && !cmdq_req->skip_err_handling) { pr_err("%s: %s: txfr error(%d)/resp_err(%d)\n", mmc_hostname(mrq->host), __func__, err, cmdq_req->resp_err); @@ -3581,6 +3581,17 @@ void mmc_blk_cmdq_complete_rq(struct request *rq) blk_end_request_all(rq, err); goto out; } + /* + * In case of error, cmdq_req->data.bytes_xfered is set to 0. + * If we call blk_end_request() with nr_bytes as 0 then the request + * never gets completed. So in case of error, to complete a request + * with error we should use blk_end_request_all(). + */ + if (err && cmdq_req->skip_err_handling) { + cmdq_req->skip_err_handling = false; + blk_end_request_all(rq, err); + goto out; + } blk_end_request(rq, err, cmdq_req->data.bytes_xfered); |
