From a820398b0547d7ca44eca4fb3613598369d32be0 Mon Sep 17 00:00:00 2001 From: Per Forlin Date: Mon, 29 Aug 2011 15:35:58 +0200 Subject: [PATCH] --- yaml --- r: 270268 b: refs/heads/master c: 7c8a2829c22a270acadc6aa3a937e2e7956b19f5 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/mmc/core/core.c | 6 ++++++ trunk/include/linux/mmc/host.h | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 2f3fc85deb9f..5999e1e4bd6c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 44669034815a7ad263542ac605c581a10b22d146 +refs/heads/master: 7c8a2829c22a270acadc6aa3a937e2e7956b19f5 diff --git a/trunk/drivers/mmc/core/core.c b/trunk/drivers/mmc/core/core.c index 45ea968e7dd1..0b4c2ed22bce 100644 --- a/trunk/drivers/mmc/core/core.c +++ b/trunk/drivers/mmc/core/core.c @@ -320,8 +320,14 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host, mmc_wait_for_req_done(host, host->areq->mrq); err = host->areq->err_check(host->card, host->areq); if (err) { + /* post process the completed failed request */ mmc_post_req(host, host->areq->mrq, 0); if (areq) + /* + * Cancel the new prepared request, because + * it can't run until the failed + * request has been properly handled. + */ mmc_post_req(host, areq->mrq, -EINVAL); host->areq = NULL; diff --git a/trunk/include/linux/mmc/host.h b/trunk/include/linux/mmc/host.h index 4c4bddf5ef61..340cc0c9409f 100644 --- a/trunk/include/linux/mmc/host.h +++ b/trunk/include/linux/mmc/host.h @@ -109,6 +109,9 @@ struct mmc_host_ops { * It is optional for the host to implement pre_req and post_req in * order to support double buffering of requests (prepare one * request while another request is active). + * pre_req() must always be followed by a post_req(). + * To undo a call made to pre_req(), call post_req() with + * a nonzero err condition. */ void (*post_req)(struct mmc_host *host, struct mmc_request *req, int err);