From patchwork Mon Aug 29 13:42:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 1108112 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7TDgPWA004040 for ; Mon, 29 Aug 2011 13:42:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752741Ab1H2Nm3 (ORCPT ); Mon, 29 Aug 2011 09:42:29 -0400 Received: from mga14.intel.com ([143.182.124.37]:63266 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752638Ab1H2Nm3 (ORCPT ); Mon, 29 Aug 2011 09:42:29 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 29 Aug 2011 06:42:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.68,296,1312182000"; d="scan'208";a="43516905" Received: from unknown (HELO ahunter-desktop.localhost.com) ([10.255.18.143]) by azsmga001.ch.intel.com with ESMTP; 29 Aug 2011 06:42:27 -0700 From: Adrian Hunter To: Chris Ball Cc: linux-mmc , Adrian Hunter Subject: [PATCH 4/5] mmc: mmc-test: add eMMC hardware reset test Date: Mon, 29 Aug 2011 16:42:14 +0300 Message-Id: <1314625335-11638-5-git-send-email-adrian.hunter@intel.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1314625335-11638-1-git-send-email-adrian.hunter@intel.com> References: <1314625335-11638-1-git-send-email-adrian.hunter@intel.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 29 Aug 2011 13:42:30 +0000 (UTC) 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 --- drivers/mmc/card/mmc_test.c | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c index 2bf229a..9cdce63 100644 --- a/drivers/mmc/card/mmc_test.c +++ b/drivers/mmc/card/mmc_test.c @@ -2328,6 +2328,31 @@ static int mmc_test_profile_sglen_r_nonblock_perf(struct mmc_test_card *test) return mmc_test_rw_multiple_sg_len(test, &test_data); } +/* + * eMMC hardware reset. + */ +static int mmc_test_hw_reset(struct mmc_test_card *test) +{ + struct mmc_card *card = test->card; + struct mmc_host *host = card->host; + int err; + + err = mmc_hw_reset_check(host); + if (!err) + return RESULT_OK; + + if (err == -ENOSYS) + return RESULT_FAIL; + + if (err != -EOPNOTSUPP) + return err; + + if (!mmc_can_reset(card)) + return RESULT_UNSUP_CARD; + + return RESULT_UNSUP_HOST; +} + static const struct mmc_test_case mmc_test_cases[] = { { .name = "Basic write (no data verification)", @@ -2650,6 +2675,11 @@ static const struct mmc_test_case mmc_test_cases[] = { .run = mmc_test_profile_sglen_r_nonblock_perf, .cleanup = mmc_test_area_cleanup, }, + + { + .name = "eMMC hardware reset", + .run = mmc_test_hw_reset, + }, }; static DEFINE_MUTEX(mmc_test_lock);