All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Paul Burton <paul.burton@imgtec.com>, linux-mips@linux-mips.org
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>, linux-pm@vger.kernel.org
Subject: Re: [PATCH 08/10] MIPS: support use of cpuidle
Date: Thu, 20 Feb 2014 09:52:26 +0100	[thread overview]
Message-ID: <5305C24A.1070006@linaro.org> (raw)
In-Reply-To: <1389794137-11361-9-git-send-email-paul.burton@imgtec.com>

On 01/15/2014 02:55 PM, Paul Burton wrote:
> This patch lays the groundwork for MIPS platforms to make use of the
> cpuidle framework. The arch_cpu_idle function simply calls cpuidle &
> falls back to the regular cpu_wait path if cpuidle should fail (eg. if
> it's not selected or no driver is registered). A generic cpuidle state
> for the wait instruction is introduced, intended to ease use of the wait
> instruction from cpuidle drivers and reduce code duplication.

Hi,

What is the status of this patchset ? Still need comments ?

Thanks
   -- Daniel

>
> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
> Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: linux-pm@vger.kernel.org
> ---
>   arch/mips/Kconfig            |  2 ++
>   arch/mips/include/asm/idle.h | 14 ++++++++++++++
>   arch/mips/kernel/idle.c      | 20 +++++++++++++++++++-
>   3 files changed, 35 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index 5bc27c0..95f2f11 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -1838,6 +1838,8 @@ config CPU_R4K_CACHE_TLB
>   	bool
>   	default y if !(CPU_R3000 || CPU_R8000 || CPU_SB1 || CPU_TX39XX || CPU_CAVIUM_OCTEON)
>
> +source "drivers/cpuidle/Kconfig"
> +
>   choice
>   	prompt "MIPS MT options"
>
> diff --git a/arch/mips/include/asm/idle.h b/arch/mips/include/asm/idle.h
> index d192158..d9f932d 100644
> --- a/arch/mips/include/asm/idle.h
> +++ b/arch/mips/include/asm/idle.h
> @@ -1,6 +1,7 @@
>   #ifndef __ASM_IDLE_H
>   #define __ASM_IDLE_H
>
> +#include <linux/cpuidle.h>
>   #include <linux/linkage.h>
>
>   extern void (*cpu_wait)(void);
> @@ -20,4 +21,17 @@ static inline int address_is_in_r4k_wait_irqoff(unsigned long addr)
>   	       addr < (unsigned long)__pastwait;
>   }
>
> +extern int mips_cpuidle_wait_enter(struct cpuidle_device *dev,
> +				   struct cpuidle_driver *drv, int index);
> +
> +#define MIPS_CPUIDLE_WAIT_STATE {\
> +	.enter			= mips_cpuidle_wait_enter,\
> +	.exit_latency		= 1,\
> +	.target_residency	= 1,\
> +	.power_usage		= UINT_MAX,\
> +	.flags			= CPUIDLE_FLAG_TIME_VALID,\
> +	.name			= "wait",\
> +	.desc			= "MIPS wait",\
> +}
> +
>   #endif /* __ASM_IDLE_H  */
> diff --git a/arch/mips/kernel/idle.c b/arch/mips/kernel/idle.c
> index 3553243..64e91e4 100644
> --- a/arch/mips/kernel/idle.c
> +++ b/arch/mips/kernel/idle.c
> @@ -11,6 +11,7 @@
>    * as published by the Free Software Foundation; either version
>    * 2 of the License, or (at your option) any later version.
>    */
> +#include <linux/cpuidle.h>
>   #include <linux/export.h>
>   #include <linux/init.h>
>   #include <linux/irqflags.h>
> @@ -239,7 +240,7 @@ static void smtc_idle_hook(void)
>   #endif
>   }
>
> -void arch_cpu_idle(void)
> +static void mips_cpu_idle(void)
>   {
>   	smtc_idle_hook();
>   	if (cpu_wait)
> @@ -247,3 +248,20 @@ void arch_cpu_idle(void)
>   	else
>   		local_irq_enable();
>   }
> +
> +void arch_cpu_idle(void)
> +{
> +	if (cpuidle_idle_call())
> +		mips_cpu_idle();
> +}
> +
> +#ifdef CONFIG_CPU_IDLE
> +
> +int mips_cpuidle_wait_enter(struct cpuidle_device *dev,
> +			    struct cpuidle_driver *drv, int index)
> +{
> +	mips_cpu_idle();
> +	return index;
> +}
> +
> +#endif
>


-- 
  <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

  reply	other threads:[~2014-02-20  8:52 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15 13:55 [PATCH 00/10] MIPS CPS cpuidle Paul Burton
2014-01-15 13:55 ` Paul Burton
2014-01-15 13:55 ` [PATCH 01/10] MIPS: inst.h: define COP0 wait op Paul Burton
2014-01-15 13:55   ` Paul Burton
2014-01-15 13:55 ` [PATCH 02/10] MIPS: inst.h: define missing microMIPS POOL32AXf ops Paul Burton
2014-01-15 13:55   ` Paul Burton
2014-01-15 13:55 ` [PATCH 03/10] MIPS: uasm: add sync instruction Paul Burton
2014-01-15 13:55   ` Paul Burton
2014-01-15 13:55 ` [PATCH 04/10] MIPS: uasm: add wait instruction Paul Burton
2014-01-15 13:55   ` Paul Burton
2014-01-15 13:55 ` [PATCH 05/10] MIPS: uasm: add jr.hb instruction Paul Burton
2014-01-15 13:55   ` Paul Burton
2014-01-15 13:55 ` [PATCH 06/10] MIPS: uasm: add mftc0 & mttc0 instructions Paul Burton
2014-01-15 13:55   ` Paul Burton
2014-01-15 13:55 ` [PATCH 07/10] MIPS: uasm: add a label variant of beq Paul Burton
2014-01-15 13:55   ` Paul Burton
2014-01-15 13:55 ` [PATCH 08/10] MIPS: support use of cpuidle Paul Burton
2014-01-15 13:55   ` Paul Burton
2014-02-20  8:52   ` Daniel Lezcano [this message]
2014-02-20  9:57     ` Paul Burton
2014-02-20  9:57       ` Paul Burton
2014-01-15 13:55 ` [PATCH 09/10] cpuidle: declare cpuidle_dev in cpuidle.h Paul Burton
2014-01-15 13:55   ` Paul Burton
2014-02-20 13:35   ` Daniel Lezcano
2014-02-20 13:41     ` Paul Burton
2014-02-20 13:41       ` Paul Burton
2014-02-20 13:53       ` Daniel Lezcano
2014-02-20 14:00         ` Paul Burton
2014-02-20 14:00           ` Paul Burton
2014-02-25 14:39           ` Daniel Lezcano
2014-01-15 13:55 ` [PATCH 10/10] cpuidle: cpuidle driver for MIPS CPS Paul Burton
2014-01-15 13:55   ` Paul Burton
2014-02-25 15:33   ` Daniel Lezcano
2014-02-25 22:12     ` Paul Burton
2014-02-25 22:12       ` Paul Burton
2014-02-26 14:37       ` Daniel Lezcano
2014-02-27  9:50         ` Paul Burton
2014-02-27  9:50           ` Paul Burton

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=5305C24A.1070006@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=paul.burton@imgtec.com \
    --cc=rjw@rjwysocki.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.