All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Wang <wei.w.wang@intel.com>
To: xen-devel@lists.xen.org, jbeulich@suse.com
Cc: andrew.cooper3@citrix.com, Wei Wang <wei.w.wang@intel.com>
Subject: [PATCH v3 08/11] x86/intel_pstate: add a booting param to select the driver to load
Date: Thu, 11 Jun 2015 16:28:26 +0800	[thread overview]
Message-ID: <1434011306-17498-1-git-send-email-wei.w.wang@intel.com> (raw)

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

             reply	other threads:[~2015-06-11  8:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11  8:28 Wei Wang [this message]
2015-06-18 15:07 ` [PATCH v3 08/11] x86/intel_pstate: add a booting param to select the driver to load Jan Beulich

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=1434011306-17498-1-git-send-email-wei.w.wang@intel.com \
    --to=wei.w.wang@intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xen.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.