mmc: core: Hold re-tuning while bkops ongoing
authorAdrian Hunter <adrian.hunter@intel.com>
Thu, 7 May 2015 10:10:17 +0000 (13:10 +0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 1 Jun 2015 07:06:55 +0000 (09:06 +0200)
Hold re-tuning during bkops to prevent
it from conflicting with the busy state.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/core.c

index ff1e38400dc58778dd8415fe6a73d8cff37e9930..adb64087a28a97f5882766ddb4d27a0697f92f58 100644 (file)
@@ -318,12 +318,15 @@ void mmc_start_bkops(struct mmc_card *card, bool from_exception)
                use_busy_signal = false;
        }
 
+       mmc_retune_hold(card->host);
+
        err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
                        EXT_CSD_BKOPS_START, 1, timeout,
                        use_busy_signal, true, false);
        if (err) {
                pr_warn("%s: Error %d starting bkops\n",
                        mmc_hostname(card->host), err);
+               mmc_retune_release(card->host);
                goto out;
        }
 
@@ -334,6 +337,8 @@ void mmc_start_bkops(struct mmc_card *card, bool from_exception)
         */
        if (!use_busy_signal)
                mmc_card_set_doing_bkops(card);
+       else
+               mmc_retune_release(card->host);
 out:
        mmc_release_host(card->host);
 }
@@ -749,6 +754,7 @@ int mmc_stop_bkops(struct mmc_card *card)
         */
        if (!err || (err == -EINVAL)) {
                mmc_card_clr_doing_bkops(card);
+               mmc_retune_release(card->host);
                err = 0;
        }