From: Kuninori Morimoto Subject: [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock Date: Wed, 27 Aug 2014 19:24:24 -0700 (PDT) Message-ID: <87bnr5ic6h.wl%kuninori.morimoto.gx@gmail.com> References: <87simtenpi.wl%kuninori.morimoto.gx@renesas.com> <87pphxe2q0.wl%kuninori.morimoto.gx@renesas.com> <53AD638C.5060907@renesas.com> <87egxehsec.wl%kuninori.morimoto.gx@gmail.com> <87bnr9tgwj.wl%kuninori.morimoto.gx@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Sender: linux-sh-owner@vger.kernel.org To: Ulf Hansson Cc: Simon , Chris Ball , Ian Molton , Morimoto , Magnus , Linux-SH , linux-mmc List-Id: linux-mmc@vger.kernel.org From: Kuninori Morimoto This patch ensures that the clock has been stopped before it calls tmio_mmc_set_clock(). The clock settings might be failed without this patch Signed-off-by: Kuninori Morimoto --- v3 -> v4 - based on latest git://git.linaro.org/people/ulf.hansson/mmc.git#next drivers/mmc/host/tmio_mmc_pio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index ba45413..7289331 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -924,12 +924,14 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) tmio_mmc_clk_stop(host); break; case MMC_POWER_UP: + tmio_mmc_clk_stop(host); tmio_mmc_set_clock(host, ios->clock); tmio_mmc_power_on(host, ios->vdd); tmio_mmc_clk_start(host); tmio_mmc_set_bus_width(host, ios->bus_width); break; case MMC_POWER_ON: + tmio_mmc_clk_stop(host); tmio_mmc_set_clock(host, ios->clock); tmio_mmc_clk_start(host); tmio_mmc_set_bus_width(host, ios->bus_width); @@ -1199,6 +1201,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev) tmio_mmc_clk_update(host); if (host->clk_cache) { + tmio_mmc_clk_stop(host); tmio_mmc_set_clock(host, host->clk_cache); tmio_mmc_clk_start(host); } -- 1.7.9.5