linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: rjw-KKrjLPT3xs0@public.gmane.org,
	deepthi-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Cc: linaro-kernel-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
	swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org,
	patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	rnayak-l0cyMroinI0@public.gmane.org,
	nsekhar-l0cyMroinI0@public.gmane.org,
	josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	horms+renesas-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH 9/9] POWERPC: pseries: cpuidle: use time keeping flag
Date: Wed, 03 Apr 2013 16:25:54 +0200	[thread overview]
Message-ID: <515C3BF2.7040609@linaro.org> (raw)
In-Reply-To: <1364991322-20585-9-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

On 04/03/2013 02:15 PM, Daniel Lezcano wrote:
> The current code computes the idle time but that can be handled
> by the cpuidle framework if we enable the .en_core_tk_irqen flag.
>
> Set the flag and remove the code related to the time computation.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Signed-off-by: Deepthi Dharwar <deepthi-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> ---

Rafael,

Deepthi took the patch, did a fix and tested it, this is why there is
its signed-off.

Deepthi, could you ack the patch for Rafael also ?

Thanks
-- Daniel

>  arch/powerpc/platforms/pseries/processor_idle.c |   35 ++++++++++-------------
>  1 file changed, 15 insertions(+), 20 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/processor_idle.c b/arch/powerpc/platforms/pseries/processor_idle.c
> index 4d806b4..a197120 100644
> --- a/arch/powerpc/platforms/pseries/processor_idle.c
> +++ b/arch/powerpc/platforms/pseries/processor_idle.c
> @@ -23,8 +23,9 @@
>  #include "pseries.h"
>  
>  struct cpuidle_driver pseries_idle_driver = {
> -	.name =		"pseries_idle",
> -	.owner =	THIS_MODULE,
> +	.name             = "pseries_idle",
> +	.owner            = THIS_MODULE,
> +	.en_core_tk_irqen = 1,
>  };
>  
>  #define MAX_IDLE_STATE_COUNT	2
> @@ -33,10 +34,8 @@ static int max_idle_state = MAX_IDLE_STATE_COUNT - 1;
>  static struct cpuidle_device __percpu *pseries_cpuidle_devices;
>  static struct cpuidle_state *cpuidle_state_table;
>  
> -static inline void idle_loop_prolog(unsigned long *in_purr, ktime_t *kt_before)
> +static inline void idle_loop_prolog(unsigned long *in_purr)
>  {
> -
> -	*kt_before = ktime_get();
>  	*in_purr = mfspr(SPRN_PURR);
>  	/*
>  	 * Indicate to the HV that we are idle. Now would be
> @@ -45,12 +44,10 @@ static inline void idle_loop_prolog(unsigned long *in_purr, ktime_t *kt_before)
>  	get_lppaca()->idle = 1;
>  }
>  
> -static inline  s64 idle_loop_epilog(unsigned long in_purr, ktime_t kt_before)
> +static inline void idle_loop_epilog(unsigned long in_purr)
>  {
>  	get_lppaca()->wait_state_cycles += mfspr(SPRN_PURR) - in_purr;
>  	get_lppaca()->idle = 0;
> -
> -	return ktime_to_us(ktime_sub(ktime_get(), kt_before));
>  }
>  
>  static int snooze_loop(struct cpuidle_device *dev,
> @@ -58,10 +55,9 @@ static int snooze_loop(struct cpuidle_device *dev,
>  			int index)
>  {
>  	unsigned long in_purr;
> -	ktime_t kt_before;
>  	int cpu = dev->cpu;
>  
> -	idle_loop_prolog(&in_purr, &kt_before);
> +	idle_loop_prolog(&in_purr);
>  	local_irq_enable();
>  	set_thread_flag(TIF_POLLING_NRFLAG);
>  
> @@ -75,8 +71,8 @@ static int snooze_loop(struct cpuidle_device *dev,
>  	clear_thread_flag(TIF_POLLING_NRFLAG);
>  	smp_mb();
>  
> -	dev->last_residency =
> -		(int)idle_loop_epilog(in_purr, kt_before);
> +	idle_loop_epilog(in_purr);
> +
>  	return index;
>  }
>  
> @@ -102,9 +98,8 @@ static int dedicated_cede_loop(struct cpuidle_device *dev,
>  				int index)
>  {
>  	unsigned long in_purr;
> -	ktime_t kt_before;
>  
> -	idle_loop_prolog(&in_purr, &kt_before);
> +	idle_loop_prolog(&in_purr);
>  	get_lppaca()->donate_dedicated_cpu = 1;
>  
>  	ppc64_runlatch_off();
> @@ -112,8 +107,9 @@ static int dedicated_cede_loop(struct cpuidle_device *dev,
>  	check_and_cede_processor();
>  
>  	get_lppaca()->donate_dedicated_cpu = 0;
> -	dev->last_residency =
> -		(int)idle_loop_epilog(in_purr, kt_before);
> +
> +	idle_loop_epilog(in_purr);
> +
>  	return index;
>  }
>  
> @@ -122,9 +118,8 @@ static int shared_cede_loop(struct cpuidle_device *dev,
>  			int index)
>  {
>  	unsigned long in_purr;
> -	ktime_t kt_before;
>  
> -	idle_loop_prolog(&in_purr, &kt_before);
> +	idle_loop_prolog(&in_purr);
>  
>  	/*
>  	 * Yield the processor to the hypervisor.  We return if
> @@ -135,8 +130,8 @@ static int shared_cede_loop(struct cpuidle_device *dev,
>  	 */
>  	check_and_cede_processor();
>  
> -	dev->last_residency =
> -		(int)idle_loop_epilog(in_purr, kt_before);
> +	idle_loop_epilog(in_purr);
> +
>  	return index;
>  }
>  


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

  parent reply	other threads:[~2013-04-03 14:25 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-03 12:15 [PATCH 1/9] ARM: cpuidle: remove useless declaration Daniel Lezcano
     [not found] ` <1364991322-20585-1-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-04-03 12:15   ` [PATCH 2/9] ARM: shmobile: pm: fix init sections Daniel Lezcano
2013-04-03 12:15   ` [PATCH 3/9] ARM: shmobile: cpuidle: remove useless WFI function Daniel Lezcano
2013-04-03 12:15   ` [PATCH 6/9] ARM: davinci: cpuidle: fix wrong enter function Daniel Lezcano
2013-04-04  7:16     ` Sekhar Nori
2013-04-03 12:15   ` [PATCH 9/9] POWERPC: pseries: cpuidle: use time keeping flag Daniel Lezcano
     [not found]     ` <1364991322-20585-9-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-04-03 14:25       ` Daniel Lezcano [this message]
2013-04-04 11:01         ` Deepthi Dharwar
2013-04-04 22:30   ` [PATCH 1/9] ARM: cpuidle: remove useless declaration Rafael J. Wysocki
2013-04-03 12:15 ` [PATCH 4/9] ARM: tegra2: cpuidle: change driver initialization Daniel Lezcano
2013-04-03 12:15 ` [PATCH 5/9] ARM: tegra: cpuidle: remove useless initialization Daniel Lezcano
2013-04-03 12:15 ` [PATCH 7/9] intel: cpuidle: remove stop/start critical timings Daniel Lezcano
     [not found]   ` <1364991322-20585-7-git-send-email-daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-04-04 22:31     ` Rafael J. Wysocki
     [not found]       ` <3375360.P4DAA9Jd5Y-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2013-04-07 20:52         ` Daniel Lezcano
     [not found]           ` <5161DC9C.3020703-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-04-08 17:40             ` Daniel Lezcano
     [not found]               ` <51630115.6040205-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-04-08 19:27                 ` Rafael J. Wysocki
2013-04-08 19:27                   ` Daniel Lezcano
2013-04-19 22:02     ` Len Brown
2013-04-03 12:15 ` [PATCH 8/9] ARM: omap3: cpuidle: enable time keeping Daniel Lezcano
2013-04-03 17:47   ` Kevin Hilman
     [not found]     ` <87zjxfzetw.fsf-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-04-03 20:49       ` Daniel Lezcano
     [not found]         ` <515C95BF.6030103-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-04-03 21:43           ` Kevin Hilman
2013-04-03 12:23 ` [PATCH 1/9] ARM: cpuidle: remove useless declaration Daniel Lezcano
2013-04-08 20:50   ` Rafael J. Wysocki
2013-04-08 20:53     ` Daniel Lezcano
2013-04-18 14:13   ` Russell King - ARM Linux
2013-04-18 14:31     ` Daniel Lezcano
2013-04-18 15:42       ` Russell King - ARM Linux
     [not found]         ` <20130418154236.GY14496-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-04-18 15:47           ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=515C3BF2.7040609@linaro.org \
    --to=daniel.lezcano-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=deepthi-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=horms+renesas-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org \
    --cc=josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linaro-kernel-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nsekhar-l0cyMroinI0@public.gmane.org \
    --cc=patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=rjw-KKrjLPT3xs0@public.gmane.org \
    --cc=rnayak-l0cyMroinI0@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).