From patchwork Sun Feb 15 23:28:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 5830891 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B9840BF440 for ; Sun, 15 Feb 2015 23:30:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCB51201BC for ; Sun, 15 Feb 2015 23:30:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE88E201B9 for ; Sun, 15 Feb 2015 23:30:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YN8dW-0006US-IW; Sun, 15 Feb 2015 23:30:02 +0000 Received: from mail-qa0-x22d.google.com ([2607:f8b0:400d:c00::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YN8dL-00064J-8G; Sun, 15 Feb 2015 23:29:52 +0000 Received: by mail-qa0-f45.google.com with SMTP id j7so19976178qaq.4; Sun, 15 Feb 2015 15:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=NZXlwTvcrr5oOnVKj+kkixlkfbBBAwmPoN1FgI316ds=; b=RBXQj0OiIQsNx5mzlLSv0uRN3946izp5VYDcngsXsOhxCUW5xTHoicaYtwJ6Qrd53y d9jofjSSoyG1Y1K86JWq7VaaD0LmGnjo++MN+9mtp87R8e56dJ2Tk4bVVLPHycek3kBO cpdpBo2Bm70UDhuoBpS3Of47u3q2A/5qhT87z/kR5YQ/XeVmU6gGrz5pTopfEX8gFWHp meF2Qr3G3upSdCTUDurxX64oUu/EMcC7XKgX7fykOp4XMdV44/0kwZAxulSt3GPfPhtO jD3iioMqOP4ujgM9ZHNHUCQy7YkKfNr4J7tMweo3slmUuQiqhfuMzmFH5zDJQ7RFvjjs vuyQ== X-Received: by 10.229.175.131 with SMTP id ba3mr944888qcb.3.1424042968121; Sun, 15 Feb 2015 15:29:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.28.97 with HTTP; Sun, 15 Feb 2015 15:28:47 -0800 (PST) In-Reply-To: <1423894668-8886-2-git-send-email-addy.ke@rock-chips.com> References: <1423828368-18456-1-git-send-email-addy.ke@rock-chips.com> <1423894668-8886-1-git-send-email-addy.ke@rock-chips.com> <1423894668-8886-2-git-send-email-addy.ke@rock-chips.com> From: Alim Akhtar Date: Mon, 16 Feb 2015 04:58:47 +0530 Message-ID: Subject: Re: [PATCH v4 1/3] mmc: dw_mmc: update clock after host reach a stable voltage To: Addy Ke X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150215_152951_424748_0C793C0B X-CRM114-Status: GOOD ( 14.99 ) X-Spam-Score: -0.8 (/) Cc: Tao Huang , lintao@rock-chips.com, Ulf Hansson , =?UTF-8?Q?Heiko_St=C3=BCbner?= , linux-rockchip@lists.infradead.org, "linux-mmc@vger.kernel.org" , Douglas Anderson , "linux-kernel@vger.kernel.org" , Jaehoon Chung , Andrzej Hajda , Olof Johansson , Eddie Cai , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Hi Addy, On Sat, Feb 14, 2015 at 11:47 AM, Addy Ke wrote: > As show in mmc_power_up(), in MMC_POWER_UP state, the voltage isn't > stable and we may get 'data busy' which can't be cleaned by resetting > all blocks. So we should not send command to update clock in this state. > > Signed-off-by: Addy Ke > --- > drivers/mmc/host/dw_mmc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c > index 4d2e3c2..3472f9b 100644 > --- a/drivers/mmc/host/dw_mmc.c > +++ b/drivers/mmc/host/dw_mmc.c > @@ -1102,7 +1102,8 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) > drv_data->set_ios(slot->host, ios); > > /* Slot specific timing and width adjustment */ > - dw_mci_setup_bus(slot, false); > + if (ios->power_mode != MMC_POWER_UP) > + dw_mci_setup_bus(slot, false); > This looks a HACK to me. If stabilizing host voltage regulator is the problem, can you try out below patch, and see if this resolve your issue? =============== > if (slot->host->state == STATE_WAITING_CMD11_DONE && ios->clock != 0) > slot->host->state = STATE_IDLE; > -- > 1.8.3.2 > > =========== [PATCH] mmc: dw_mmc: Wait for host voltage regulator to be stable Signed-off-by: Alim Akhtar --- drivers/mmc/host/dw_mmc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 4d2e3c2..dc10fbb 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1202,6 +1202,9 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios) } mci_writel(host, UHS_REG, uhs); + /* wait for 5ms so that host voltage regulator is stable */ + usleep_range(5000, 5500); + return 0; }