From 37b8f427159201a7d54284f68361754926075737 Mon Sep 17 00:00:00 2001 From: Veerabhadrarao Badiganti Date: Thu, 18 May 2017 20:24:31 +0530 Subject: [PATCH] mmc: core: retune after un-gating the clocks We have seen that host controller's clock tuning circuit may go out of sync if controller clocks are gated. To workaround this issue, we are now triggering the retuning of tuning circuit once clocks are ungated. Change-Id: Id2db1cb4829fbb1af4f8c4e463d1e16c0f45e590 Signed-off-by: Veerabhadrarao Badiganti Signed-off-by: Subhash Jadavani --- drivers/mmc/core/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index c462eee4a5f7..1357aaa9b54d 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2312,6 +2312,13 @@ void mmc_ungate_clock(struct mmc_host *host) WARN_ON(host->ios.clock); /* This call will also set host->clk_gated to false */ __mmc_set_clock(host, host->clk_old); + /* + * We have seen that host controller's clock tuning circuit may + * go out of sync if controller clocks are gated. + * To workaround this issue, we are triggering retuning of the + * tuning circuit after ungating the controller clocks. + */ + mmc_retune_needed(host); } }