linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: fix regression: set default clock gating delay to 0
@ 2012-02-23 10:22 Guennadi Liakhovetski
  2012-03-02 20:55 ` Chris Ball
  0 siblings, 1 reply; 2+ messages in thread
From: Guennadi Liakhovetski @ 2012-02-23 10:22 UTC (permalink / raw)
  To: linux-mmc; +Cc: Magnus Damm, Rafael J. Wysocki, Chris Ball, Sujit Reddy Thumma

A recent commit "mmc: core: Use delayed work in clock gating framework"
introduced a default 200ms delay before clock gating actually takes place.
This means, that every time an MMC interface becomes idle it first stays
on for 200ms before gating its clock. This leads to increased power
consumption and is therefore a clear regression. This patch restores the
original behaviour by setting the default delay to 0. Users,
prioritising throughput over power efficiency can still modify the delay
via sysfs.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---

As discussed in this thread

http://thread.gmane.org/gmane.linux.kernel.mmc/12307

this is one of the ways to fix the regression. Please, push for 3.3.

 drivers/mmc/core/host.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 30055f2..c3704e2 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -238,10 +238,10 @@ static inline void mmc_host_clk_init(struct mmc_host *host)
 	/* Hold MCI clock for 8 cycles by default */
 	host->clk_delay = 8;
 	/*
-	 * Default clock gating delay is 200ms.
+	 * Default clock gating delay is 0ms to avoid wasting power.
 	 * This value can be tuned by writing into sysfs entry.
 	 */
-	host->clkgate_delay = 200;
+	host->clkgate_delay = 0;
 	host->clk_gated = false;
 	INIT_DELAYED_WORK(&host->clk_gate_work, mmc_host_clk_gate_work);
 	spin_lock_init(&host->clk_lock);
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: fix regression: set default clock gating delay to 0
  2012-02-23 10:22 [PATCH] mmc: fix regression: set default clock gating delay to 0 Guennadi Liakhovetski
@ 2012-03-02 20:55 ` Chris Ball
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Ball @ 2012-03-02 20:55 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-mmc, Magnus Damm, Rafael J. Wysocki, Sujit Reddy Thumma

Hi,

On Thu, Feb 23 2012, Guennadi Liakhovetski wrote:
> A recent commit "mmc: core: Use delayed work in clock gating framework"
> introduced a default 200ms delay before clock gating actually takes place.
> This means, that every time an MMC interface becomes idle it first stays
> on for 200ms before gating its clock. This leads to increased power
> consumption and is therefore a clear regression. This patch restores the
> original behaviour by setting the default delay to 0. Users,
> prioritising throughput over power efficiency can still modify the delay
> via sysfs.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>
> As discussed in this thread
>
> http://thread.gmane.org/gmane.linux.kernel.mmc/12307
>
> this is one of the ways to fix the regression. Please, push for 3.3.
>
>  drivers/mmc/core/host.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 30055f2..c3704e2 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -238,10 +238,10 @@ static inline void mmc_host_clk_init(struct mmc_host *host)
>  	/* Hold MCI clock for 8 cycles by default */
>  	host->clk_delay = 8;
>  	/*
> -	 * Default clock gating delay is 200ms.
> +	 * Default clock gating delay is 0ms to avoid wasting power.
>  	 * This value can be tuned by writing into sysfs entry.
>  	 */
> -	host->clkgate_delay = 200;
> +	host->clkgate_delay = 0;
>  	host->clk_gated = false;
>  	INIT_DELAYED_WORK(&host->clk_gate_work, mmc_host_clk_gate_work);
>  	spin_lock_init(&host->clk_lock);

Thanks, will push this to 3.3 this week.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-02 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-23 10:22 [PATCH] mmc: fix regression: set default clock gating delay to 0 Guennadi Liakhovetski
2012-03-02 20:55 ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).