From b3ab0db2c7d3e091985b127bcca49e92a95ce58e Mon Sep 17 00:00:00 2001 From: Sahitya Tummala Date: Thu, 21 Apr 2016 16:04:09 +0530 Subject: [PATCH] mmc: mmc: fix issue with clock scaling in HS200 mode The scaling logic for HS400 is triggered when the card timing mode is HS400 or when the clock rate is MMC_HS200_MAX_DTR. But this is the same rate used in HS200 mode as well. Due to this, in HS200 mode also, the card enters into the scaling logic meant for HS400 which is not correct. Correct this logic by checking the card timing in addition to the clock rate in HS400 clock scaling logic. Change-Id: If6261c0e42178d331184ac605c192d48a76e1e29 Signed-off-by: Sahitya Tummala --- drivers/mmc/core/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 00617646e708..99caaf85dd50 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1711,7 +1711,7 @@ static int mmc_change_bus_speed(struct mmc_host *host, unsigned long *freq) * for other timings we can simply do clock frequency change */ if (mmc_card_hs400(card) || - (*freq == MMC_HS200_MAX_DTR)) { + (!mmc_card_hs200(host->card) && *freq == MMC_HS200_MAX_DTR)) { err = mmc_set_clock_bus_speed(card, *freq); if (err) { pr_err("%s: %s: failed (%d)to set bus and clock speed (freq=%lu)\n",