mmc: mmc_test: Ensure command queue is disabled for testing
cover mmc: mmc_test: Ensure command queue is disabled for testing
Hi
Here are a couple of fixes related to mmc_test.
Adrian Hunter (2):
mmc: core: Ensure cmd_completion is initialized
mmc: mmc_test: Ensure command queue is disabled for testing
drivers/mmc/core/core.c | 6 ++---- drivers/mmc/core/mmc_test.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-)
Regards
Adrian
PATCH 1/2 mmc: core: Ensure cmd_completion is initialized
mmc_test now uses mmc_start_request() to test sending commands during "ongoing" asynchronous transfers, i.e. tests:
Commands during non-blocking read - use Set Block Count (CMD23) Commands during non-blocking write - use Set Block Count (CMD23)
mmc_start_request() was not initializing cmd_completion, but cmd_completion is used by "ongoing" transfers, so move initialization of cmd_completion into making mmc_start_request().
--- drivers/mmc/core/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/core/core.c +2 -4
@@ -348,6 +348,8 @@ int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) {int err; +init_completion (&mrq->cmd_completion); +mmc_retune_hold (host);if (mmc_card_removed (host->card))
@@ -418,8 +420,6 @@ static int __mmc_start_data_req(struct mmc_host *host, struct mmc_request *mrq) mrq->done = mmc_wait_data_done; mrq->host = host; -init_completion (&mrq->cmd_completion); - err =mmc_start_request (host, mrq);if (err) { mrq->cmd->error = err;
@@ -439,8 +439,6 @@ static int __mmc_start_req(struct mmc_host *host, struct mmc_request *mrq)init_completion (&mrq->completion); mrq->done = mmc_wait_done; -init_completion (&mrq->cmd_completion); - err =mmc_start_request (host, mrq);if (err) { mrq->cmd->error = err;
Signature · 1 line
1.9.1
PATCH 2/2 mmc: mmc_test: Ensure command queue is disabled for testing
In reply to Adrian Huntermmc_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.
--- drivers/mmc/core/mmc_test.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/mmc/core/mmc_test.c +9 -2
@@ -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 ; }
Signature · 1 line
1.9.1
Ulf Hansson
AppliedQuoted 5 lines · Adrian Hunter
Hi
Here are a couple of fixes related to
mmc_test.
Quoted 9 lines
Adrian Hunter (2):
mmc: core: Ensurecmd_completionis initialized
mmc:mmc_test: Ensure command queue is disabled for testingdrivers/mmc/core/core.c | 6 ++---- drivers/mmc/core/mmc_test.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-)
Thanks, applied for next!
Kind regards
Uffe