linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: update user_policy.max when _PPC updated
@ 2013-06-05  0:52 Joe Jin
  2013-06-05 20:40 ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Jin @ 2013-06-05  0:52 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: Neil Gu, cpufreq, linux-pm, linux-kernel@vger.kernel.org

When _PPC changed dynamically the user_policy.max will not be updated,
this prevent CPU run on the highest frequency.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/acpi/processor_perflib.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index e854582..e01aa7d 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -180,6 +180,7 @@ static void acpi_processor_ppc_ost(acpi_handle handle, int status)
 int acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag)
 {
 	int ret;
+	unsigned int saved = (unsigned int)pr->performance_platform_limit;
 
 	if (ignore_ppc) {
 		/*
@@ -204,8 +205,22 @@ int acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag)
 	}
 	if (ret < 0)
 		return (ret);
-	else
+	else {
+		unsigned int ppc = (unsigned int)pr->performance_platform_limit;
+
+		if (saved != ppc) {
+			struct cpufreq_policy *policy;
+
+			policy = cpufreq_cpu_get(pr->id);
+			if (likely(policy))
+				policy->user_policy.max =
+					pr->performance->states[ppc].
+					core_frequency * 1000;
+			cpufreq_cpu_put(policy);
+		}
+
 		return cpufreq_update_policy(pr->id);
+	}
 }
 
 int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
-- 
1.8.1.4


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

end of thread, other threads:[~2013-06-07  1:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-05  0:52 [PATCH] ACPI: update user_policy.max when _PPC updated Joe Jin
2013-06-05 20:40 ` Rafael J. Wysocki
2013-06-06  0:27   ` Joe Jin
2013-06-06 11:06     ` Rafael J. Wysocki
2013-06-06 13:29       ` Joe Jin
2013-06-06 19:54         ` Rafael J. Wysocki
2013-06-07  1:48           ` Joe Jin

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