From e3a2555910c09a29429d921a736688787dd3d124 Mon Sep 17 00:00:00 2001 From: Sridhar Arra Date: Tue, 22 Sep 2020 21:41:03 +0530 Subject: [PATCH] mmc: host: Update HS400 timing mode before performing tuning Updating HS400 timing mode, before performing tuning. Timing should be adjusted to the HS400 target operation frequency for tuning process. Similar handling is also done in mmc_hs200_tuning(). This is handled properly in sdhci-msm.c from msm-5.4 onwards. Change-Id: I39ec61033843b90bb178756e2910419fafafa78a Signed-off-by: Sridhar Arra --- drivers/mmc/core/host.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 0de222c75aa5..7ba6c5515d21 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -479,6 +479,16 @@ int mmc_retune(struct mmc_host *host) host->ops->prepare_hs400_tuning(host, &host->ios); } + /* + * Timing should be adjusted to the HS400 target + * operation frequency for tuning process. + * Similar handling is also done in mmc_hs200_tuning() + * This is handled properly in sdhci-msm.c from msm-5.4 onwards. + */ + if (host->card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS400 && + host->ios.bus_width == MMC_BUS_WIDTH_8) + mmc_set_timing(host, MMC_TIMING_MMC_HS400); + err = mmc_execute_tuning(host->card); if (err) goto out;