From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olliver Schinagl Subject: Re: [PATCH 3/3] mmc: sunxi: use controller automatic clock gating. Date: Wed, 12 Aug 2015 15:19:20 +0200 Message-ID: <55CB47D8.4010207@schinagl.nl> References: <55CB3D92.6040403@redhat.com> Reply-To: oliver+list-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Return-path: In-Reply-To: <55CB3D92.6040403-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, Seungwon Jeon , Jaehoon Chung , Ulf Hansson , Maxime Ripard , =?UTF-8?B?RGF2aWQgTGFuemVuZMO2cmZlcg==?= , Chen-Yu Tsai , Arnd Bergmann , linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: linux-mmc@vger.kernel.org Hey, On 12-08-15 14:35, Hans de Goede wrote: > Hi, > > On 12-08-15 14:23, Michal Suchanek wrote: >> When core does not set the MMC_QUIRK_BROKEN_CLK_GATING flag enable >> automatic hardware controlled clock gating on the mmc interface. >> >> Signed-off-by: Michal Suchanek > > In general this looks good, but I wonder how intensively this has > been tested ? It doesn't matter actually, it took some time longer, but the mmc still craps out even with Michal's 3 patches. I'll revert hans's earlier patch again and do a bit more extensive testing. > Also given the long latencies when using manual > clock on/off support, have you done any testing to check what > sort of latencies this adds, e.g. Both with and without > the patch, dump all the filesystem caches: > > echo 3 > /proc/sys/vm/drop_caches > > And then do: > > time cat /some/small/file/on/the/sdcard > > Do this at least 3 time both with and without the patch, and see > if there are any noticable differences ? > > Regards, > > Hans > > > >> --- >> drivers/mmc/host/sunxi-mmc.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c >> index f808a02..443cab5 100644 >> --- a/drivers/mmc/host/sunxi-mmc.c >> +++ b/drivers/mmc/host/sunxi-mmc.c >> @@ -601,8 +601,13 @@ static int sunxi_mmc_oclk_onoff(struct >> sunxi_mmc_host *host, u32 oclk_en) >> rval = mmc_readl(host, REG_CLKCR); >> rval &= ~(SDXC_CARD_CLOCK_ON | SDXC_LOW_POWER_ON); >> >> - if (oclk_en) >> + if (oclk_en) { >> rval |= SDXC_CARD_CLOCK_ON; >> + if (!host->mmc->card || >> + !(host->mmc->card->quirks & MMC_QUIRK_BROKEN_CLK_GATING)) >> + >> + rval |= SDXC_LOW_POWER_ON; >> + } >> >> start = jiffies; >> end = start + msecs_to_jiffies(750); >> > From mboxrd@z Thu Jan 1 00:00:00 1970 From: oliver+list@schinagl.nl (Olliver Schinagl) Date: Wed, 12 Aug 2015 15:19:20 +0200 Subject: [linux-sunxi] [PATCH 3/3] mmc: sunxi: use controller automatic clock gating. In-Reply-To: <55CB3D92.6040403@redhat.com> References: <55CB3D92.6040403@redhat.com> Message-ID: <55CB47D8.4010207@schinagl.nl> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hey, On 12-08-15 14:35, Hans de Goede wrote: > Hi, > > On 12-08-15 14:23, Michal Suchanek wrote: >> When core does not set the MMC_QUIRK_BROKEN_CLK_GATING flag enable >> automatic hardware controlled clock gating on the mmc interface. >> >> Signed-off-by: Michal Suchanek > > In general this looks good, but I wonder how intensively this has > been tested ? It doesn't matter actually, it took some time longer, but the mmc still craps out even with Michal's 3 patches. I'll revert hans's earlier patch again and do a bit more extensive testing. > Also given the long latencies when using manual > clock on/off support, have you done any testing to check what > sort of latencies this adds, e.g. Both with and without > the patch, dump all the filesystem caches: > > echo 3 > /proc/sys/vm/drop_caches > > And then do: > > time cat /some/small/file/on/the/sdcard > > Do this at least 3 time both with and without the patch, and see > if there are any noticable differences ? > > Regards, > > Hans > > > >> --- >> drivers/mmc/host/sunxi-mmc.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c >> index f808a02..443cab5 100644 >> --- a/drivers/mmc/host/sunxi-mmc.c >> +++ b/drivers/mmc/host/sunxi-mmc.c >> @@ -601,8 +601,13 @@ static int sunxi_mmc_oclk_onoff(struct >> sunxi_mmc_host *host, u32 oclk_en) >> rval = mmc_readl(host, REG_CLKCR); >> rval &= ~(SDXC_CARD_CLOCK_ON | SDXC_LOW_POWER_ON); >> >> - if (oclk_en) >> + if (oclk_en) { >> rval |= SDXC_CARD_CLOCK_ON; >> + if (!host->mmc->card || >> + !(host->mmc->card->quirks & MMC_QUIRK_BROKEN_CLK_GATING)) >> + >> + rval |= SDXC_LOW_POWER_ON; >> + } >> >> start = jiffies; >> end = start + msecs_to_jiffies(750); >> > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932426AbbHLNTZ (ORCPT ); Wed, 12 Aug 2015 09:19:25 -0400 Received: from 7of9.schinagl.nl ([88.159.158.68]:45746 "EHLO 7of9.schinagl.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752084AbbHLNTX (ORCPT ); Wed, 12 Aug 2015 09:19:23 -0400 Message-ID: <55CB47D8.4010207@schinagl.nl> Date: Wed, 12 Aug 2015 15:19:20 +0200 From: Olliver Schinagl User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: hdegoede@redhat.com, hramrach@gmail.com, linux-sunxi@googlegroups.com, Seungwon Jeon , Jaehoon Chung , Ulf Hansson , Maxime Ripard , =?UTF-8?B?RGF2aWQgTGFuemVuZMO2cmZlcg==?= , Chen-Yu Tsai , Arnd Bergmann , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [linux-sunxi] [PATCH 3/3] mmc: sunxi: use controller automatic clock gating. References: <55CB3D92.6040403@redhat.com> In-Reply-To: <55CB3D92.6040403@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey, On 12-08-15 14:35, Hans de Goede wrote: > Hi, > > On 12-08-15 14:23, Michal Suchanek wrote: >> When core does not set the MMC_QUIRK_BROKEN_CLK_GATING flag enable >> automatic hardware controlled clock gating on the mmc interface. >> >> Signed-off-by: Michal Suchanek > > In general this looks good, but I wonder how intensively this has > been tested ? It doesn't matter actually, it took some time longer, but the mmc still craps out even with Michal's 3 patches. I'll revert hans's earlier patch again and do a bit more extensive testing. > Also given the long latencies when using manual > clock on/off support, have you done any testing to check what > sort of latencies this adds, e.g. Both with and without > the patch, dump all the filesystem caches: > > echo 3 > /proc/sys/vm/drop_caches > > And then do: > > time cat /some/small/file/on/the/sdcard > > Do this at least 3 time both with and without the patch, and see > if there are any noticable differences ? > > Regards, > > Hans > > > >> --- >> drivers/mmc/host/sunxi-mmc.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c >> index f808a02..443cab5 100644 >> --- a/drivers/mmc/host/sunxi-mmc.c >> +++ b/drivers/mmc/host/sunxi-mmc.c >> @@ -601,8 +601,13 @@ static int sunxi_mmc_oclk_onoff(struct >> sunxi_mmc_host *host, u32 oclk_en) >> rval = mmc_readl(host, REG_CLKCR); >> rval &= ~(SDXC_CARD_CLOCK_ON | SDXC_LOW_POWER_ON); >> >> - if (oclk_en) >> + if (oclk_en) { >> rval |= SDXC_CARD_CLOCK_ON; >> + if (!host->mmc->card || >> + !(host->mmc->card->quirks & MMC_QUIRK_BROKEN_CLK_GATING)) >> + >> + rval |= SDXC_LOW_POWER_ON; >> + } >> >> start = jiffies; >> end = start + msecs_to_jiffies(750); >> >