Blob Blame History Raw
From 89a2ac43621c8094ab412b3a8905f4976a4e33ce Mon Sep 17 00:00:00 2001
From: Mel Gorman <mgorman@suse.de>
Date: Mon, 8 Oct 2018 09:23:17 +0100
Subject: [PATCH] cpufreq, intel_pstate: Allow unspecified FADT profile to
 probe PPC

References: bnc#1108841
Patch-mainline: No, there is a risk of regressions on non-server hardware

A HP Gen8 Server is not reporting the correct 'preferred_profile' PM
attribute of ACPI and PPC is not probed as a result. This patch gambles
that it is safe to probe the PPC anyway.

Note that there is a light risk of regressions due to this patch if
the ACPI implementation also has a broken PPC table. This is considered
less likely for servers that correctly specify PM_ENTERPRISE_SERVER or
PM_PERFORMANCE_SERVER as those servers had to pass certification tests
for PPC so probing for PM_UNSPECIFIED is a gamble. If bugs are filed,
it'll be necessary to revert this and introduce a patch that warns the
user that PPC was unused due to an unspecified profile and optionally
provide a command line switch for testing.

Signed-off-by: James Wang <jnwang@suse.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
---
 drivers/cpufreq/intel_pstate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index a75e1097af14..b97c7afe970e 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -378,7 +378,8 @@ static DEFINE_MUTEX(intel_pstate_limits_lock);
 static bool intel_pstate_acpi_pm_profile_server(void)
 {
 	if (acpi_gbl_FADT.preferred_profile == PM_ENTERPRISE_SERVER ||
-	    acpi_gbl_FADT.preferred_profile == PM_PERFORMANCE_SERVER)
+	    acpi_gbl_FADT.preferred_profile == PM_PERFORMANCE_SERVER ||
+	    acpi_gbl_FADT.preferred_profile == PM_UNSPECIFIED)
 		return true;
 
 	return false;