summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2017-12-01 14:55:31 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-19 09:09:59 +0100
commitb19715a17b620825d7d58b11870c82621b10cd83 (patch)
treece09df65283a0b9565d7c82605f47c33a3de3745
parentbe5494a8f85b9e1e1172a6d8e4dffe413913d4e1 (diff)
downloadlinux-stable-b19715a17b620825d7d58b11870c82621b10cd83.tar.gz
linux-stable-b19715a17b620825d7d58b11870c82621b10cd83.tar.bz2
linux-stable-b19715a17b620825d7d58b11870c82621b10cd83.zip
mmc: mmc_test: Ensure command queue is disabled for testing
[ 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>
-rw-r--r--drivers/mmc/core/mmc_test.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
index 478869805b96..789afef66fce 100644
--- a/drivers/mmc/core/mmc_test.c
+++ b/drivers/mmc/core/mmc_test.c
@@ -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;
}