This is provided at Srinivas' request.  The LP controller is disabled
for the moment on server FADT profiles in order to avoid disturbing
the performance behavior of small-core servers.  In cases where the
default inferred from the BIOS FADT profile is suboptimal, the LP
controller can be forcefully enabled or disabled by passing
"intel_pstate=lp" or "intel_pstate=no_lp" respectively in the kernel
command line.

Signed-off-by: Francisco Jerez <curroje...@riseup.net>
---
 Documentation/admin-guide/kernel-parameters.txt |  6 +++++
 Documentation/admin-guide/pm/intel_pstate.rst   |  7 ++++++
 drivers/cpufreq/intel_pstate.c                  | 32 ++++++++++++++++++++++++-
 3 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt 
b/Documentation/admin-guide/kernel-parameters.txt
index 1d1d53f85ddd..0ba112696938 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1681,6 +1681,12 @@
                per_cpu_perf_limits
                        Allow per-logical-CPU P-State performance control 
limits using
                        cpufreq sysfs interface
+               lp
+                       Force use of LP P-state controller.  Overrides selection
+                       derived from ACPI FADT profile.  Has no effect if HWP is
+                       available.
+               no_lp
+                       Prevent use of LP P-state controller (see "lp" 
parameter).
 
        intremap=       [X86-64, Intel-IOMMU]
                        on      enable Interrupt Remapping (default)
diff --git a/Documentation/admin-guide/pm/intel_pstate.rst 
b/Documentation/admin-guide/pm/intel_pstate.rst
index d2b6fda3d67b..a5885fc4c039 100644
--- a/Documentation/admin-guide/pm/intel_pstate.rst
+++ b/Documentation/admin-guide/pm/intel_pstate.rst
@@ -642,6 +642,13 @@ of them have to be prepended with the ``intel_pstate=`` 
prefix.
        Use per-logical-CPU P-State limits (see `Coordination of P-state
        Limits`_ for details).
 
+``lp``
+       Force use of LP P-state controller.  Overrides selection derived
+       from ACPI FADT profile.  Has no effect if HWP is available.
+
+``no_lp``
+       Prevent use of LP P-state controller (see "lp" parameter).
+
 
 Diagnostics and Tuning
 ======================
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index d4b5d0aaa282..d0e212387755 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2485,6 +2485,7 @@ static int intel_pstate_update_status(const char *buf, 
size_t size)
 
 static int no_load __initdata;
 static int no_hwp __initdata;
+static int no_lp __initdata;
 static int hwp_only __initdata;
 static unsigned int force_load __initdata;
 
@@ -2507,8 +2508,12 @@ static void __init copy_cpu_funcs(struct pstate_funcs 
*funcs)
        pstate_funcs.get_scaling = funcs->get_scaling;
        pstate_funcs.get_val   = funcs->get_val;
        pstate_funcs.get_vid   = funcs->get_vid;
-       pstate_funcs.update_util = funcs->update_util;
        pstate_funcs.get_aperf_mperf_shift = funcs->get_aperf_mperf_shift;
+
+       if (no_lp)
+               pstate_funcs.update_util = intel_pstate_update_util;
+       else
+               pstate_funcs.update_util = funcs->update_util;
 }
 
 #ifdef CONFIG_ACPI
@@ -2690,6 +2695,25 @@ static int __init intel_pstate_init(void)
 }
 device_initcall(intel_pstate_init);
 
+#ifdef CONFIG_ACPI
+static bool __init is_server_acpi_profile(void)
+{
+       switch (acpi_gbl_FADT.preferred_profile) {
+       case PM_ENTERPRISE_SERVER:
+       case PM_SOHO_SERVER:
+       case PM_PERFORMANCE_SERVER:
+               return true;
+       default:
+               return false;
+       }
+}
+#else
+static bool __init is_server_acpi_profile(void)
+{
+       return false;
+}
+#endif
+
 static int __init intel_pstate_setup(char *str)
 {
        if (!str)
@@ -2713,6 +2737,12 @@ static int __init intel_pstate_setup(char *str)
        if (!strcmp(str, "per_cpu_perf_limits"))
                per_cpu_limits = true;
 
+       no_lp = is_server_acpi_profile();
+       if (!strcmp(str, "lp"))
+               no_lp = 0;
+       if (!strcmp(str, "no_lp"))
+               no_lp = 1;
+
 #ifdef CONFIG_ACPI
        if (!strcmp(str, "support_acpi_ppc"))
                acpi_ppc = true;
-- 
2.16.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to