All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc <linux-mmc@vger.kernel.org>
Subject: [PATCH 1/2] mmc: core: Ensure cmd_completion is initialized
Date: Fri,  1 Dec 2017 14:55:30 +0200	[thread overview]
Message-ID: <1512132931-12380-2-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1512132931-12380-1-git-send-email-adrian.hunter@intel.com>

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: cb39f61e9b1e ("mmc: core: Export a few functions needed for blkmq support")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/core/core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 617802f45386..455abbf4f41e 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -348,6 +348,8 @@ int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
 {
 	int err;
 
+	init_completion(&mrq->cmd_completion);
+
 	mmc_retune_hold(host);
 
 	if (mmc_card_removed(host->card))
@@ -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->host = host;
 
-	init_completion(&mrq->cmd_completion);
-
 	err = mmc_start_request(host, mrq);
 	if (err) {
 		mrq->cmd->error = err;
@@ -439,8 +439,6 @@ static int __mmc_start_req(struct mmc_host *host, struct mmc_request *mrq)
 	init_completion(&mrq->completion);
 	mrq->done = mmc_wait_done;
 
-	init_completion(&mrq->cmd_completion);
-
 	err = mmc_start_request(host, mrq);
 	if (err) {
 		mrq->cmd->error = err;
-- 
1.9.1


  reply	other threads:[~2017-12-01 12:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 12:55 [PATCH 0/2] mmc: mmc_test: Ensure command queue is disabled for testing Adrian Hunter
2017-12-01 12:55 ` Adrian Hunter [this message]
2017-12-01 12:55 ` [PATCH 2/2] " Adrian Hunter
2017-12-05 16:24 ` [PATCH 0/2] " Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512132931-12380-2-git-send-email-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.