All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mason <mpeg.blue@free.fr>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	cpufreq <cpufreq@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: RFC on cpufreq implementation
Date: Fri, 16 Jan 2015 15:00:14 +0100	[thread overview]
Message-ID: <54B9196E.1030302@free.fr> (raw)
In-Reply-To: <54B8F19F.8060108@free.fr>

On 16/01/2015 12:10, Mason wrote:

> I didn't find where WFI is called :-(
>
> In kernel/cpu/idle.c (file seems to have been removed in 3.15)
> cpu_idle_loop() calls arch_cpu_idle()
> http://lxr.free-electrons.com/source/kernel/cpu/idle.c?v=3.14#L98
>
> In arch/kernel/process.c
> http://lxr.free-electrons.com/source/arch/arm/kernel/process.c?v=3.14#L173
> /*
>   * Called from the core idle loop.
>   */
> void arch_cpu_idle(void)
> {
>      if (cpuidle_idle_call())
>          default_idle();
> }
>
> default_idle calls cpu_do_idle (by default), a macro for cpu_v7_do_idle
> which executes dsb+wfi, BUT...
>
> ifndef CONFIG_CPU_IDLE then
> static inline int cpuidle_idle_call(void) { return -ENODEV; }
>
> Does that mean I MUST define CONFIG_CPU_IDLE if I want the idle
> loop to call wfi (to save power), even if I don't have a cpuidle
> driver?

For the record, I read the code wrong.

cpuidle_idle_call() always returns -ENODEV, so the test
"if (cpuidle_idle_call())" is always true, and we always
call default_idle() and everything works as expected.

Sorry for the noise.


WARNING: multiple messages have this Message-ID (diff)
From: mpeg.blue@free.fr (Mason)
To: linux-arm-kernel@lists.infradead.org
Subject: RFC on cpufreq implementation
Date: Fri, 16 Jan 2015 15:00:14 +0100	[thread overview]
Message-ID: <54B9196E.1030302@free.fr> (raw)
In-Reply-To: <54B8F19F.8060108@free.fr>

On 16/01/2015 12:10, Mason wrote:

> I didn't find where WFI is called :-(
>
> In kernel/cpu/idle.c (file seems to have been removed in 3.15)
> cpu_idle_loop() calls arch_cpu_idle()
> http://lxr.free-electrons.com/source/kernel/cpu/idle.c?v=3.14#L98
>
> In arch/kernel/process.c
> http://lxr.free-electrons.com/source/arch/arm/kernel/process.c?v=3.14#L173
> /*
>   * Called from the core idle loop.
>   */
> void arch_cpu_idle(void)
> {
>      if (cpuidle_idle_call())
>          default_idle();
> }
>
> default_idle calls cpu_do_idle (by default), a macro for cpu_v7_do_idle
> which executes dsb+wfi, BUT...
>
> ifndef CONFIG_CPU_IDLE then
> static inline int cpuidle_idle_call(void) { return -ENODEV; }
>
> Does that mean I MUST define CONFIG_CPU_IDLE if I want the idle
> loop to call wfi (to save power), even if I don't have a cpuidle
> driver?

For the record, I read the code wrong.

cpuidle_idle_call() always returns -ENODEV, so the test
"if (cpuidle_idle_call())" is always true, and we always
call default_idle() and everything works as expected.

Sorry for the noise.

  parent reply	other threads:[~2015-01-16 14:00 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15 17:24 RFC on cpufreq implementation Mason
2015-01-15 17:24 ` Mason
2015-01-16  9:08 ` Krzysztof Kozlowski
2015-01-16  9:08   ` Krzysztof Kozlowski
2015-01-16 11:10   ` Mason
2015-01-16 11:10     ` Mason
2015-01-16 11:43     ` Krzysztof Kozlowski
2015-01-16 11:43       ` Krzysztof Kozlowski
2015-01-16 11:43       ` Krzysztof Kozlowski
2015-01-16 12:10     ` Javi Merino
2015-01-16 12:10       ` Javi Merino
2015-01-16 14:00     ` Mason [this message]
2015-01-16 14:00       ` Mason
2015-01-19  7:52 ` Viresh Kumar
2015-01-19  7:52   ` Viresh Kumar
2015-01-19 22:03   ` Mason
2015-01-19 22:03     ` Mason
2015-01-20  3:55     ` Viresh Kumar
2015-01-20  3:55       ` Viresh Kumar
2015-01-19  9:22 ` Amit Kucheria
2015-01-19  9:22   ` Amit Kucheria
2015-01-19 22:13   ` Mason
2015-01-19 22:13     ` Mason
2015-01-29 16:43 ` Mason
2015-01-29 16:43   ` Mason
2015-01-30  1:15   ` Viresh Kumar
2015-01-30  1:15     ` Viresh Kumar
2015-01-30 23:44     ` Mason
2015-01-30 23:44       ` Mason
2015-02-02  3:58       ` Viresh Kumar
2015-02-02  3:58         ` Viresh Kumar
2015-02-04  0:07         ` Mason
2015-02-04  0:07           ` Mason
2015-02-04  0:32           ` Måns Rullgård
2015-02-04  0:32             ` Måns Rullgård
2015-02-04  4:12           ` Viresh Kumar
2015-02-04  4:12             ` Viresh Kumar

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=54B9196E.1030302@free.fr \
    --to=mpeg.blue@free.fr \
    --cc=cpufreq@vger.kernel.org \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=viresh.kumar@linaro.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 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.