Commit d2383318 authored by Adrian Hunter's avatar Adrian Hunter Committed by Ulf Hansson

mmc: core: Ensure cmd_completion is initialized

mmc_test now uses mmc_start_request() to test sending commands during
"ongoing" asynchronous transfers, i.e. tests:
	Commands during non-blocking read - use Set Block Count (CMD23)
	Commands during non-blocking write - use Set Block Count (CMD23)

mmc_start_request() was not initializing cmd_completion, but cmd_completion
is used by "ongoing" transfers, so move initialization of cmd_completion
into making mmc_start_request().

Fixes: cb39f61e ("mmc: core: Export a few functions needed for blkmq support")
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 34597a3f
...@@ -348,6 +348,8 @@ int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) ...@@ -348,6 +348,8 @@ int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
{ {
int err; int err;
init_completion(&mrq->cmd_completion);
mmc_retune_hold(host); mmc_retune_hold(host);
if (mmc_card_removed(host->card)) if (mmc_card_removed(host->card))
...@@ -418,8 +420,6 @@ static int __mmc_start_data_req(struct mmc_host *host, struct mmc_request *mrq) ...@@ -418,8 +420,6 @@ static int __mmc_start_data_req(struct mmc_host *host, struct mmc_request *mrq)
mrq->done = mmc_wait_data_done; mrq->done = mmc_wait_data_done;
mrq->host = host; mrq->host = host;
init_completion(&mrq->cmd_completion);
err = mmc_start_request(host, mrq); err = mmc_start_request(host, mrq);
if (err) { if (err) {
mrq->cmd->error = err; mrq->cmd->error = err;
...@@ -439,8 +439,6 @@ static int __mmc_start_req(struct mmc_host *host, struct mmc_request *mrq) ...@@ -439,8 +439,6 @@ static int __mmc_start_req(struct mmc_host *host, struct mmc_request *mrq)
init_completion(&mrq->completion); init_completion(&mrq->completion);
mrq->done = mmc_wait_done; mrq->done = mmc_wait_done;
init_completion(&mrq->cmd_completion);
err = mmc_start_request(host, mrq); err = mmc_start_request(host, mrq);
if (err) { if (err) {
mrq->cmd->error = err; mrq->cmd->error = err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment