Skip to content

Commit 2311344

Browse files
ahunter6cjb
authored andcommitted
mmc: mmc-test: add eMMC hardware reset test
MMC core provides a checking function that checks if the reset has happended. Add a test to use that function. Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Chris Ball <[email protected]>
1 parent 0f20165 commit 2311344

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

drivers/mmc/card/mmc_test.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,6 +2328,31 @@ static int mmc_test_profile_sglen_r_nonblock_perf(struct mmc_test_card *test)
23282328
return mmc_test_rw_multiple_sg_len(test, &test_data);
23292329
}
23302330

2331+
/*
2332+
* eMMC hardware reset.
2333+
*/
2334+
static int mmc_test_hw_reset(struct mmc_test_card *test)
2335+
{
2336+
struct mmc_card *card = test->card;
2337+
struct mmc_host *host = card->host;
2338+
int err;
2339+
2340+
err = mmc_hw_reset_check(host);
2341+
if (!err)
2342+
return RESULT_OK;
2343+
2344+
if (err == -ENOSYS)
2345+
return RESULT_FAIL;
2346+
2347+
if (err != -EOPNOTSUPP)
2348+
return err;
2349+
2350+
if (!mmc_can_reset(card))
2351+
return RESULT_UNSUP_CARD;
2352+
2353+
return RESULT_UNSUP_HOST;
2354+
}
2355+
23312356
static const struct mmc_test_case mmc_test_cases[] = {
23322357
{
23332358
.name = "Basic write (no data verification)",
@@ -2650,6 +2675,11 @@ static const struct mmc_test_case mmc_test_cases[] = {
26502675
.run = mmc_test_profile_sglen_r_nonblock_perf,
26512676
.cleanup = mmc_test_area_cleanup,
26522677
},
2678+
2679+
{
2680+
.name = "eMMC hardware reset",
2681+
.run = mmc_test_hw_reset,
2682+
},
26532683
};
26542684

26552685
static DEFINE_MUTEX(mmc_test_lock);

0 commit comments

Comments
 (0)