From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753151AbbBSKaw (ORCPT ); Thu, 19 Feb 2015 05:30:52 -0500 Received: from regular1.263xmail.com ([211.150.99.139]:38033 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752515AbbBSKau (ORCPT ); Thu, 19 Feb 2015 05:30:50 -0500 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: addy.ke@rock-chips.com X-FST-TO: linux-rockchip@lists.infradead.org X-SENDER-IP: 58.22.114.113 X-LOGIN-NAME: addy.ke@rock-chips.com X-UNIQUE-TAG: <74f3df8688c11f9f425e193a6acce8b3> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <54E5BB4B.8090405@rock-chips.com> Date: Thu, 19 Feb 2015 18:30:35 +0800 From: addy ke User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: alim.akhtar@gmail.com CC: jh80.chung@samsung.com, ulf.hansson@linaro.org, olof@lixom.net, a.hajda@samsung.com, dianders@chromium.org, heiko@sntech.de, cf@rock-chips.com, lintao@rock-chips.com, huangtao@rock-chips.com, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH v4 1/3] mmc: dw_mmc: update clock after host reach a stable voltage 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> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Alim Sorry for late reply. On 2015/2/16 07:28, Alim Akhtar wrote: > 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? I have test by: cd /sys/bus/platform/drivers/dwmmc_rockchip for i in $(seq 1 10000); do echo "========================" $i echo ff0c0000.dwmmc > unbind sleep .5 echo ff0c0000.dwmmc > bind sleep 2 done There is no error. I think this patch can resolve my issue, thank you. Do you send this patch upstream, or can I put it in my patch list? > > =========== > [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; > } > > =============== > >> if (slot->host->state == STATE_WAITING_CMD11_DONE && ios->clock != 0) >> slot->host->state = STATE_IDLE; >> -- >> 1.8.3.2 >> >> > > >