aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/mmc_test.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2017-03-13 08:36:38 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2017-04-24 15:42:02 -0400
commit9d4579a85c84340044b10ffa6cd576397f59dc93 (patch)
treee52b4118053ec75fe88ded78a0ac6b2ac7f3d2ff /drivers/mmc/core/mmc_test.c
parentb658af718465cd1e8011c8da281befdfc2debefd (diff)
mmc: mmc_test: Disable Command Queue while mmc_test is used
Normal read and write commands may not be used while the command queue is enabled. Disable the Command Queue when mmc_test is probed and re-enable it when it is removed. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Harjani Ritesh <riteshh@codeaurora.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/mmc_test.c')
-rw-r--r--drivers/mmc/core/mmc_test.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
index f99ac3123fd2..fd1b4b8510b9 100644
--- a/drivers/mmc/core/mmc_test.c
+++ b/drivers/mmc/core/mmc_test.c
@@ -26,6 +26,7 @@
26#include "card.h" 26#include "card.h"
27#include "host.h" 27#include "host.h"
28#include "bus.h" 28#include "bus.h"
29#include "mmc_ops.h"
29 30
30#define RESULT_OK 0 31#define RESULT_OK 0
31#define RESULT_FAIL 1 32#define RESULT_FAIL 1
@@ -3264,6 +3265,14 @@ static int mmc_test_probe(struct mmc_card *card)
3264 if (ret) 3265 if (ret)
3265 return ret; 3266 return ret;
3266 3267
3268 if (card->ext_csd.cmdq_en) {
3269 mmc_claim_host(card->host);
3270 ret = mmc_cmdq_disable(card);
3271 mmc_release_host(card->host);
3272 if (ret)
3273 return ret;
3274 }
3275
3267 dev_info(&card->dev, "Card claimed for testing.\n"); 3276 dev_info(&card->dev, "Card claimed for testing.\n");
3268 3277
3269 return 0; 3278 return 0;
@@ -3271,6 +3280,11 @@ static int mmc_test_probe(struct mmc_card *card)
3271 3280
3272static void mmc_test_remove(struct mmc_card *card) 3281static void mmc_test_remove(struct mmc_card *card)
3273{ 3282{
3283 if (card->reenable_cmdq) {
3284 mmc_claim_host(card->host);
3285 mmc_cmdq_enable(card);
3286 mmc_release_host(card->host);
3287 }
3274 mmc_test_free_result(card); 3288 mmc_test_free_result(card);
3275 mmc_test_free_dbgfs_file(card); 3289 mmc_test_free_dbgfs_file(card);
3276} 3290}