From patchwork Thu Aug 28 02:24:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4792221 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0E1039F2A9 for ; Thu, 28 Aug 2014 02:24:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 373DA2011E for ; Thu, 28 Aug 2014 02:24:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 162EA200F0 for ; Thu, 28 Aug 2014 02:24:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934086AbaH1CY2 (ORCPT ); Wed, 27 Aug 2014 22:24:28 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:52883 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933108AbaH1CY0 (ORCPT ); Wed, 27 Aug 2014 22:24:26 -0400 Received: by mail-pa0-f50.google.com with SMTP id kq14so505325pab.23 for ; Wed, 27 Aug 2014 19:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=u9LSh9+MAW7T3kfxDn8U2ekgJbfC5UFeHTMjctT3+XA=; b=Mty0+t5ldi/I8QGCN3u8Zj/KElLv1c9E4EQkD3OnbK7NN1nOAxijyBI3q+zK7+XLwg KqIAuAi7sQ5uYcWLIcYNBaKe9ppQN5quMMLOzP3ZO28fHR8+F3s17a7xL6yl445Qnzyv fyr4HBXz9bbaErZDrOGpjSxd1oe1RLLcu+dn5RlI548SMPp7vSpMvthK3W0jilmnaOmR +UrGwVd28OO19m5SSAzsRf6JEBZH7e9ocLUaH9NQrtUdMQ3vXWFP7DwBo0kFVQbJGpzb gRWXEwJ8S49Fj+m1WKHZ68/4Ctj/BLJ9ZQ4XDRcymZJm7lfT/RD2f7vcI3AivBXuE1qh ztHQ== X-Received: by 10.68.105.197 with SMTP id go5mr1199040pbb.73.1409192665990; Wed, 27 Aug 2014 19:24:25 -0700 (PDT) Received: from remon.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id bq17sm7204566pac.47.2014.08.27.19.24.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 27 Aug 2014 19:24:24 -0700 (PDT) Date: Wed, 27 Aug 2014 19:24:24 -0700 (PDT) Message-ID: <87bnr5ic6h.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto Subject: [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Ulf Hansson Cc: Simon , Chris Ball , Ian Molton , Morimoto , Magnus , Linux-SH , linux-mmc In-Reply-To: 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") Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }