All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 08/11] x86/intel_pstate: add a booting param to select the driver to load
@ 2015-06-11  8:28 Wei Wang
  2015-06-18 15:07 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Wang @ 2015-06-11  8:28 UTC (permalink / raw)
  To: xen-devel, jbeulich; +Cc: andrew.cooper3, Wei Wang

By default, the old P-state driver (acpi-freq) is used. Adding
"intel_pstate" to the Xen booting param list to enable the
use of intel_pstate. However, if intel_pstate is enabled on a
machine which does not support the driver (e.g. Nehalem), the
old P-state driver will be loaded due to the failure loading of
intel_pstate.

Signed-off-by: Wei Wang <wei.w.wang@intel.com>
---
 xen/arch/x86/acpi/cpufreq/cpufreq.c      | 8 +++++---
 xen/arch/x86/acpi/cpufreq/intel_pstate.c | 6 ++++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index fa3678d..3765fc4 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -650,9 +650,11 @@ static int __init cpufreq_driver_init(void)
     int ret = 0;
 
     if ((cpufreq_controller == FREQCTL_xen) &&
-        (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL))
-        ret = cpufreq_register_driver(&acpi_cpufreq_driver);
-    else if ((cpufreq_controller == FREQCTL_xen) &&
+        (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)) {
+            ret = intel_pstate_init();
+            if (ret)
+                ret = cpufreq_register_driver(&acpi_cpufreq_driver);
+    } else if ((cpufreq_controller == FREQCTL_xen) &&
         (boot_cpu_data.x86_vendor == X86_VENDOR_AMD))
         ret = powernow_register_driver();
 
diff --git a/xen/arch/x86/acpi/cpufreq/intel_pstate.c b/xen/arch/x86/acpi/cpufreq/intel_pstate.c
index 48bbc30..d1a6056 100644
--- a/xen/arch/x86/acpi/cpufreq/intel_pstate.c
+++ b/xen/arch/x86/acpi/cpufreq/intel_pstate.c
@@ -749,6 +749,9 @@ static struct cpufreq_driver intel_pstate_driver = {
     .name         = "intel_pstate",
 };
 
+static bool_t __initdata load_intel_pstate;
+boolean_param("intel_pstate", load_intel_pstate);
+
 static int intel_pstate_msrs_not_valid(void)
 {
     if (!pstate_funcs.get_max() ||
@@ -785,6 +788,9 @@ int __init intel_pstate_init(void)
     const struct x86_cpu_id *id;
     struct cpu_defaults *cpu_info;
 
+    if (!load_intel_pstate)
+         return -ENODEV;
+
     id = x86_match_cpu(intel_pstate_cpu_ids);
     if (!id)
         return -ENODEV;
-- 
1.9.1

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

* Re: [PATCH v3 08/11] x86/intel_pstate: add a booting param to select the driver to load
  2015-06-11  8:28 [PATCH v3 08/11] x86/intel_pstate: add a booting param to select the driver to load Wei Wang
@ 2015-06-18 15:07 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2015-06-18 15:07 UTC (permalink / raw)
  To: Wei Wang; +Cc: andrew.cooper3, xen-devel

>>> On 11.06.15 at 10:28, <wei.w.wang@intel.com> wrote:
> --- a/xen/arch/x86/acpi/cpufreq/intel_pstate.c
> +++ b/xen/arch/x86/acpi/cpufreq/intel_pstate.c
> @@ -749,6 +749,9 @@ static struct cpufreq_driver intel_pstate_driver = {
>      .name         = "intel_pstate",
>  };
>  
> +static bool_t __initdata load_intel_pstate;
> +boolean_param("intel_pstate", load_intel_pstate);
> +
>  static int intel_pstate_msrs_not_valid(void)
>  {
>      if (!pstate_funcs.get_max() ||

Please move this immediately ahead of the (only) function you need
it in, or even inside that function. With that and with patch 9 folded
into this one
Acked-by: Jan Beulich <jbeulich@suse.com>

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

end of thread, other threads:[~2015-06-18 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-11  8:28 [PATCH v3 08/11] x86/intel_pstate: add a booting param to select the driver to load Wei Wang
2015-06-18 15:07 ` Jan Beulich

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.