aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChaotian Jing <chaotian.jing@mediatek.com>2015-10-12 05:22:23 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2015-10-21 04:18:11 -0400
commit08b137d90eec51b0e90c42e123ca8ceb118d233f (patch)
tree65f161b53e89d1506281214be5d1a9c5e7bf9447
parent25cb62b76430a91cc6195f902e61c2cb84ade622 (diff)
mmc: core: Fix init_card in 52Mhz
Suppose that we got a data crc error, and it triggers the mmc_reset. mmc_reset will call mmc_send_status to see if HW reset was supported. before issue CMD13, it will do retune, and if EMMC was in HS400 mode, it will reduce frequency to 52Mhz firstly, then results in card init was doing at 52Mhz. The mmc_send_status was originally only done for mmc_test, should drop it. And, rename the "eMMC hardware reset" to "Reset test", as we would also be able to use the test for SD-cards. Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com> Suggested-by: Adrian Hunter <adrian.hunter@intel.com> Fixes: bd11e8bd03ca ("mmc: core: Flag re-tuning is needed on CRC errors") Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/card/mmc_test.c9
-rw-r--r--drivers/mmc/core/mmc.c7
2 files changed, 3 insertions, 13 deletions
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index b78cf5d403a3..7fc9174d4619 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -2263,15 +2263,12 @@ static int mmc_test_profile_sglen_r_nonblock_perf(struct mmc_test_card *test)
2263/* 2263/*
2264 * eMMC hardware reset. 2264 * eMMC hardware reset.
2265 */ 2265 */
2266static int mmc_test_hw_reset(struct mmc_test_card *test) 2266static int mmc_test_reset(struct mmc_test_card *test)
2267{ 2267{
2268 struct mmc_card *card = test->card; 2268 struct mmc_card *card = test->card;
2269 struct mmc_host *host = card->host; 2269 struct mmc_host *host = card->host;
2270 int err; 2270 int err;
2271 2271
2272 if (!mmc_card_mmc(card) || !mmc_can_reset(card))
2273 return RESULT_UNSUP_CARD;
2274
2275 err = mmc_hw_reset(host); 2272 err = mmc_hw_reset(host);
2276 if (!err) 2273 if (!err)
2277 return RESULT_OK; 2274 return RESULT_OK;
@@ -2605,8 +2602,8 @@ static const struct mmc_test_case mmc_test_cases[] = {
2605 }, 2602 },
2606 2603
2607 { 2604 {
2608 .name = "eMMC hardware reset", 2605 .name = "Reset test",
2609 .run = mmc_test_hw_reset, 2606 .run = mmc_test_reset,
2610 }, 2607 },
2611}; 2608};
2612 2609
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index e726903170a8..f6cd995dbe92 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1924,7 +1924,6 @@ EXPORT_SYMBOL(mmc_can_reset);
1924static int mmc_reset(struct mmc_host *host) 1924static int mmc_reset(struct mmc_host *host)
1925{ 1925{
1926 struct mmc_card *card = host->card; 1926 struct mmc_card *card = host->card;
1927 u32 status;
1928 1927
1929 if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset) 1928 if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
1930 return -EOPNOTSUPP; 1929 return -EOPNOTSUPP;
@@ -1937,12 +1936,6 @@ static int mmc_reset(struct mmc_host *host)
1937 1936
1938 host->ops->hw_reset(host); 1937 host->ops->hw_reset(host);
1939 1938
1940 /* If the reset has happened, then a status command will fail */
1941 if (!mmc_send_status(card, &status)) {
1942 mmc_host_clk_release(host);
1943 return -ENOSYS;
1944 }
1945
1946 /* Set initial state and call mmc_set_ios */ 1939 /* Set initial state and call mmc_set_ios */
1947 mmc_set_initial_state(host); 1940 mmc_set_initial_state(host);
1948 mmc_host_clk_release(host); 1941 mmc_host_clk_release(host);