]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mmc: mmc_test: Ensure command queue is disabled for testing
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 1 Dec 2017 12:55:31 +0000 (14:55 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 11 Dec 2017 11:51:29 +0000 (12:51 +0100)
mmc_test disables the command queue because none of the tests use the
command queue. However the Reset Test will re-enable it, so disable it in
that case too.

Fixes: 9d4579a85c84 ("mmc: mmc_test: Disable Command Queue while mmc_test is used")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/mmc_test.c

index f96bbb8014e13c38897ef4f26fa7cde4fcd5b6c9..ef18daeaa4cc6f0a54f2814762fd7d615fcf4c9f 100644 (file)
@@ -2320,10 +2320,17 @@ static int mmc_test_reset(struct mmc_test_card *test)
        int err;
 
        err = mmc_hw_reset(host);
-       if (!err)
+       if (!err) {
+               /*
+                * Reset will re-enable the card's command queue, but tests
+                * expect it to be disabled.
+                */
+               if (card->ext_csd.cmdq_en)
+                       mmc_cmdq_disable(card);
                return RESULT_OK;
-       else if (err == -EOPNOTSUPP)
+       } else if (err == -EOPNOTSUPP) {
                return RESULT_UNSUP_HOST;
+       }
 
        return RESULT_FAIL;
 }