]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.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)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 19 Mar 2018 23:42:13 +0000 (20:42 -0300)
BugLink: http://bugs.launchpad.net/bugs/1756978
[ Upstream commit 23a185254ace8e63dc4ca36e0315aed9440ae749 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/mmc/core/mmc_test.c

index 478869805b96300a19ea0a284239f3c15277e92f..789afef66fce83759411fafeca4e0cc7fb8f5a6f 100644 (file)
@@ -2328,10 +2328,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;
 }