mmc: core: Set clock before speed mode switch l4t/l4t-r24.2.3 tegra-l4t-r24.2.3.update-01
Aniruddha Tvs Rao [Thu, 9 Aug 2018 04:59:49 +0000 (09:59 +0530)]
Set clock to mx_dtr before switching to high speed mode to
avoid chances of CRC errors for send status command after bus speed
mode switch.

Bug 200281075
Bug 200391328

Change-Id: I355134516f700a6fd44876f29cb356bc57a4fa7f
Signed-off-by: Aniruddha Tvs Rao <anrao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1795592
Reviewed-by: Amulya Yarlagadda <ayarlagadda@nvidia.com>
Tested-by: Amulya Yarlagadda <ayarlagadda@nvidia.com>

drivers/mmc/core/mmc.c

index 72f4a8b..687ea01 100644 (file)
@@ -929,6 +929,7 @@ static int mmc_select_highspeed(struct mmc_card *card)
 
        host = card->host;
 
+       mmc_set_clock(host, MMC_HIGH_52_MAX_DTR);
        /* Switch to High Speed mode */
        err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
                        EXT_CSD_HS_TIMING, 1,
@@ -941,7 +942,6 @@ static int mmc_select_highspeed(struct mmc_card *card)
 
        mmc_card_set_highspeed(card);
        mmc_set_timing(host, MMC_TIMING_MMC_HS);
-       mmc_set_clock(host, MMC_HIGH_52_MAX_DTR);
 
        return err;
 }