linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -v2] cpufreq: skip loading acpi_cpufreq after intel_pstate
@ 2013-09-20 17:43 Yinghai Lu
  2013-09-20 19:51 ` Yinghai Lu
  2013-09-26  5:17 ` Yinghai Lu
  0 siblings, 2 replies; 5+ messages in thread
From: Yinghai Lu @ 2013-09-20 17:43 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: cpufreq, linux-acpi, linux-pm, linux-kernel, Yinghai Lu

If the hw support intel_pstate and acpi_cpufreq, intel_pstate will
get loaded first.

acpi_cpufreq_init will call acpi_cpufreq_early_init()
and that will allocate perf data and init those perf data in ACPI core,
(that will cover all cpus). But later it will free them as
cpufreq_register_driver(acpi_cpufreq) will fail as init_pstate is
already registered

Use cpufreq_get_current_driver() to check if we can skip the
acpi_cpufreq loading.

-v2: update changelog and separate second part to another patch, according
     to Viresh.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 drivers/cpufreq/acpi-cpufreq.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-2.6/drivers/cpufreq/acpi-cpufreq.c
===================================================================
--- linux-2.6.orig/drivers/cpufreq/acpi-cpufreq.c
+++ linux-2.6/drivers/cpufreq/acpi-cpufreq.c
@@ -986,6 +986,10 @@ static int __init acpi_cpufreq_init(void
 {
 	int ret;
 
+	/* don't keep reloading if cpufreq_driver exists */
+	if (cpufreq_get_current_driver())
+		return 0;
+
 	if (acpi_disabled)
 		return 0;
 

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

* Re: [PATCH -v2] cpufreq: skip loading acpi_cpufreq after intel_pstate
  2013-09-20 17:43 [PATCH -v2] cpufreq: skip loading acpi_cpufreq after intel_pstate Yinghai Lu
@ 2013-09-20 19:51 ` Yinghai Lu
  2013-09-26  5:17 ` Yinghai Lu
  1 sibling, 0 replies; 5+ messages in thread
From: Yinghai Lu @ 2013-09-20 19:51 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: cpufreq@vger.kernel.org, ACPI Devel Maling List, Linux PM list,
	Linux Kernel Mailing List, Yinghai Lu

On Fri, Sep 20, 2013 at 10:43 AM, Yinghai Lu <yinghai@kernel.org> wrote:
> If the hw support intel_pstate and acpi_cpufreq, intel_pstate will
> get loaded first.
>
> acpi_cpufreq_init will call acpi_cpufreq_early_init()
> and that will allocate perf data and init those perf data in ACPI core,
> (that will cover all cpus). But later it will free them as
> cpufreq_register_driver(acpi_cpufreq) will fail as init_pstate is
> already registered
>
> Use cpufreq_get_current_driver() to check if we can skip the
> acpi_cpufreq loading.
>
> -v2: update changelog and separate second part to another patch, according
>      to Viresh.
>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>
> ---
>  drivers/cpufreq/acpi-cpufreq.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> Index: linux-2.6/drivers/cpufreq/acpi-cpufreq.c
> ===================================================================
> --- linux-2.6.orig/drivers/cpufreq/acpi-cpufreq.c
> +++ linux-2.6/drivers/cpufreq/acpi-cpufreq.c
> @@ -986,6 +986,10 @@ static int __init acpi_cpufreq_init(void
>  {
>         int ret;
>
> +       /* don't keep reloading if cpufreq_driver exists */
> +       if (cpufreq_get_current_driver())
> +               return 0;
> +
>         if (acpi_disabled)
>                 return 0;
>

only this one is needed, other one

cpufreq: fix racing between acpi_cpufreq_loading

is not needed.

Thanks

Yinghai

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

* Re: [PATCH -v2] cpufreq: skip loading acpi_cpufreq after intel_pstate
  2013-09-20 17:43 [PATCH -v2] cpufreq: skip loading acpi_cpufreq after intel_pstate Yinghai Lu
  2013-09-20 19:51 ` Yinghai Lu
@ 2013-09-26  5:17 ` Yinghai Lu
  2013-09-26  5:40   ` Viresh Kumar
  1 sibling, 1 reply; 5+ messages in thread
From: Yinghai Lu @ 2013-09-26  5:17 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: cpufreq@vger.kernel.org, ACPI Devel Maling List, Linux PM list,
	Linux Kernel Mailing List, Yinghai Lu

On Fri, Sep 20, 2013 at 10:43 AM, Yinghai Lu <yinghai@kernel.org> wrote:
> If the hw support intel_pstate and acpi_cpufreq, intel_pstate will
> get loaded first.
>
> acpi_cpufreq_init will call acpi_cpufreq_early_init()
> and that will allocate perf data and init those perf data in ACPI core,
> (that will cover all cpus). But later it will free them as
> cpufreq_register_driver(acpi_cpufreq) will fail as init_pstate is
> already registered
>
> Use cpufreq_get_current_driver() to check if we can skip the
> acpi_cpufreq loading.
>
> -v2: update changelog and separate second part to another patch, according
>      to Viresh.
>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>
> ---
>  drivers/cpufreq/acpi-cpufreq.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> Index: linux-2.6/drivers/cpufreq/acpi-cpufreq.c
> ===================================================================
> --- linux-2.6.orig/drivers/cpufreq/acpi-cpufreq.c
> +++ linux-2.6/drivers/cpufreq/acpi-cpufreq.c
> @@ -986,6 +986,10 @@ static int __init acpi_cpufreq_init(void
>  {
>         int ret;
>
> +       /* don't keep reloading if cpufreq_driver exists */
> +       if (cpufreq_get_current_driver())
> +               return 0;
> +
>         if (acpi_disabled)
>                 return 0;
>

Rafael,

can you put this one in acpi tree?

Thanks

Yinghai

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

* Re: [PATCH -v2] cpufreq: skip loading acpi_cpufreq after intel_pstate
  2013-09-26  5:17 ` Yinghai Lu
@ 2013-09-26  5:40   ` Viresh Kumar
  2013-09-26 15:41     ` Yinghai Lu
  0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2013-09-26  5:40 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Rafael J. Wysocki, cpufreq@vger.kernel.org,
	ACPI Devel Maling List, Linux PM list, Linux Kernel Mailing List

On 26 September 2013 10:47, Yinghai Lu <yinghai@kernel.org> wrote:
> can you put this one in acpi tree?

Its already applied in Rafael's linux-next branch.. Do you want something
else?

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

* Re: [PATCH -v2] cpufreq: skip loading acpi_cpufreq after intel_pstate
  2013-09-26  5:40   ` Viresh Kumar
@ 2013-09-26 15:41     ` Yinghai Lu
  0 siblings, 0 replies; 5+ messages in thread
From: Yinghai Lu @ 2013-09-26 15:41 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rafael J. Wysocki, cpufreq@vger.kernel.org,
	ACPI Devel Maling List, Linux PM list, Linux Kernel Mailing List

On Wed, Sep 25, 2013 at 10:40 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 26 September 2013 10:47, Yinghai Lu <yinghai@kernel.org> wrote:
>> can you put this one in acpi tree?
>
> Its already applied in Rafael's linux-next branch.. Do you want something
> else?

sorry, I missed that.

I still had that in local patches directory, but looks like quilt is
not smart enough and did not report that patch is already applied.

Thanks

Yinghai

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

end of thread, other threads:[~2013-09-26 15:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-20 17:43 [PATCH -v2] cpufreq: skip loading acpi_cpufreq after intel_pstate Yinghai Lu
2013-09-20 19:51 ` Yinghai Lu
2013-09-26  5:17 ` Yinghai Lu
2013-09-26  5:40   ` Viresh Kumar
2013-09-26 15:41     ` Yinghai Lu

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