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: 5830871 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9E2D29F380 for ; Sun, 15 Feb 2015 23:29:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF5CC201BC for ; Sun, 15 Feb 2015 23:29:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD20D201B9 for ; Sun, 15 Feb 2015 23:29:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751426AbbBOX33 (ORCPT ); Sun, 15 Feb 2015 18:29:29 -0500 Received: from mail-qa0-f44.google.com ([209.85.216.44]:45170 "EHLO mail-qa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750904AbbBOX33 (ORCPT ); Sun, 15 Feb 2015 18:29:29 -0500 Received: by mail-qa0-f44.google.com with SMTP id n8so19937970qaq.3; 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 Cc: Jaehoon Chung , Ulf Hansson , Olof Johansson , Andrzej Hajda , Douglas Anderson , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Eddie Cai , lintao@rock-chips.com, Tao Huang , "linux-kernel@vger.kernel.org" , "linux-mmc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , linux-rockchip@lists.infradead.org Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 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; }