From b1d2009d048df7df5b6d62b154681a08dd298ef6 Mon Sep 17 00:00:00 2001 From: Veerabhadrarao Badiganti Date: Thu, 13 Oct 2016 17:18:06 +0530 Subject: [PATCH] mmc: core: Enable HS mode first in the device and then in the host While switching to HS mode, high speed mode timing should be selected in the device before changing the clock frequency in the host. But present driver first updates the frequency in host and then selects HS mode in device while selecting HS400 mode. This is a spec violation. Updated the sequence to comply with spec. Change-Id: I5b2c1f724d820daf9c0bca8651cf85bd0ff67655 Signed-off-by: Veerabhadrarao Badiganti --- drivers/mmc/core/mmc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a3f650f5ee9f..7aa01372412d 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1192,10 +1192,6 @@ static int mmc_select_hs400(struct mmc_card *card) if (host->caps & MMC_CAP_WAIT_WHILE_BUSY) send_status = false; - /* Reduce frequency to HS frequency */ - max_dtr = card->ext_csd.hs_max_dtr; - mmc_set_clock(host, max_dtr); - /* Switch card to HS mode */ val = EXT_CSD_TIMING_HS; err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, @@ -1211,6 +1207,10 @@ static int mmc_select_hs400(struct mmc_card *card) /* Set host controller to HS timing */ mmc_set_timing(card->host, MMC_TIMING_MMC_HS); + /* Reduce frequency to HS frequency */ + max_dtr = card->ext_csd.hs_max_dtr; + mmc_set_clock(host, max_dtr); + if (!send_status) { err = mmc_switch_status(card); if (err)