aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/core/core.c6
-rw-r--r--include/linux/mmc/host.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 45ea968e7dd1..0b4c2ed22bce 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -320,8 +320,14 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host,
320 mmc_wait_for_req_done(host, host->areq->mrq); 320 mmc_wait_for_req_done(host, host->areq->mrq);
321 err = host->areq->err_check(host->card, host->areq); 321 err = host->areq->err_check(host->card, host->areq);
322 if (err) { 322 if (err) {
323 /* post process the completed failed request */
323 mmc_post_req(host, host->areq->mrq, 0); 324 mmc_post_req(host, host->areq->mrq, 0);
324 if (areq) 325 if (areq)
326 /*
327 * Cancel the new prepared request, because
328 * it can't run until the failed
329 * request has been properly handled.
330 */
325 mmc_post_req(host, areq->mrq, -EINVAL); 331 mmc_post_req(host, areq->mrq, -EINVAL);
326 332
327 host->areq = NULL; 333 host->areq = NULL;
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 4c4bddf5ef61..340cc0c9409f 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -109,6 +109,9 @@ struct mmc_host_ops {
109 * It is optional for the host to implement pre_req and post_req in 109 * It is optional for the host to implement pre_req and post_req in
110 * order to support double buffering of requests (prepare one 110 * order to support double buffering of requests (prepare one
111 * request while another request is active). 111 * request while another request is active).
112 * pre_req() must always be followed by a post_req().
113 * To undo a call made to pre_req(), call post_req() with
114 * a nonzero err condition.
112 */ 115 */
113 void (*post_req)(struct mmc_host *host, struct mmc_request *req, 116 void (*post_req)(struct mmc_host *host, struct mmc_request *req,
114 int err); 117 int err);