All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: linux-acpi@vger.kernel.org
Cc: Thomas Renninger <trenn@suse.de>, Len Brown <len.brown@intel.com>
Subject: [PATCH 25/29] acpi-cpufreq: Do not let get_measured perf depend on internal variable
Date: Thu, 23 Apr 2009 02:23:47 -0400	[thread overview]
Message-ID: <d876dfbbf5c8728102fb4f683450fa9ae3259cda.1240467665.git.len.brown@intel.com> (raw)
In-Reply-To: <1240467831-32613-1-git-send-email-lenb@kernel.org>
In-Reply-To: <50a4da890102a455e5cd3dd358c38650d07178d3.1240467664.git.len.brown@intel.com>

From: Thomas Renninger <trenn@suse.de>

Take already available policy->cpuinfo.max_freq and get rid of acpi-cpufreq
specific max_freq variable.

This implies that P0 is always the highest frequency which should always
be true as ACPI spec says:
As a result, the zeroth entry describes the highest performance state

Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index aec3161..208ecf6 100644
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -65,7 +65,6 @@ enum {
 struct acpi_cpufreq_data {
 	struct acpi_processor_performance *acpi_data;
 	struct cpufreq_frequency_table *freq_table;
-	unsigned int max_freq;
 	unsigned int resume;
 	unsigned int cpu_feature;
 };
@@ -340,7 +339,7 @@ static unsigned int get_measured_perf(struct cpufreq_policy *policy,
 
 #endif
 
-	retval = (per_cpu(drv_data, policy->cpu)->max_freq * perf_percent) / 100;
+	retval = (policy->cpuinfo.max_freq * perf_percent) / 100;
 
 	return retval;
 }
@@ -698,7 +697,6 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
 				    " latency at 20 uS\n");
 	}
 
-	data->max_freq = perf->states[0].core_frequency * 1000;
 	/* table init */
 	for (i = 0; i < perf->state_count; i++) {
 		if (i > 0 && perf->states[i].core_frequency >=
@@ -717,6 +715,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	if (result)
 		goto err_freqfree;
 
+	if (perf->states[0].core_frequency * 1000 != policy->cpuinfo.max_freq)
+		printk(KERN_WARNING FW_WARN "P-state 0 is not max freq\n");
+
 	switch (perf->control_register.space_id) {
 	case ACPI_ADR_SPACE_SYSTEM_IO:
 		/* Current speed is unknown and not detectable by IO port */
-- 
1.6.0.6


  parent reply	other threads:[~2009-04-23  6:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23  6:23 ACPI patches queued for 2.6.30-rc3 Len Brown
2009-04-23  6:23 ` [PATCH 01/29] ACPI: button: whitespace changes Len Brown
2009-04-23  6:23   ` [PATCH 02/29] ACPI: button: remove unnecessary null pointer checks Len Brown
2009-04-23  6:23   ` [PATCH 03/29] ACPI: button: use Linux style for getting driver_data Len Brown
2009-04-23  6:23   ` [PATCH 04/29] ACPI: button: cache hid/name/class pointers Len Brown
2009-04-23  6:23   ` [PATCH 05/29] ACPI: button: remove button->device pointer Len Brown
2009-04-23  6:23   ` [PATCH 06/29] ACPI: button: remove control method/fixed hardware distinctions Len Brown
2009-04-23  6:23   ` [PATCH 07/29] ACPI: Revert conflicting workaround for BIOS w/ mangled PRT entries Len Brown
2009-04-23  6:23   ` [PATCH 08/29] ACPI video: handle indexed _BQC correctly Len Brown
2009-04-23  6:23   ` [PATCH 09/29] ACPI: Disable _GTS and _BFS support by default Len Brown
2009-04-23  6:23   ` [PATCH 10/29] thermal: Fix polling frequency for systems without passive cooling Len Brown
2009-04-23  6:23   ` [PATCH 11/29] sony-laptop: Duplicate SNC 127 Event Fix Len Brown
2009-04-23  6:23   ` [PATCH 12/29] sony-laptop: SNC 127 Initialization Fix Len Brown
2009-04-23  6:23   ` [PATCH 13/29] sony-laptop: SNC input event 38 fix Len Brown
2009-04-23  6:23   ` [PATCH 14/29] ec.c: Fix ACPI EC resume non-query interrupt message Len Brown
2009-04-23  6:23   ` [PATCH 15/29] sony-laptop: fix bogus error message display on resume Len Brown
2009-04-23  6:23   ` [PATCH 16/29] sony-laptop: always try to unblock rfkill on load Len Brown
2009-04-23  6:23   ` [PATCH 17/29] thinkpad-acpi: silence hotkey enable warning for module parameter Len Brown
2009-04-23  6:23   ` [PATCH 18/29] thinkpad-acpi: fix LED blinking through timer trigger Len Brown
2009-04-23  6:23   ` [PATCH 19/29] thinkpad-acpi: fix use of MODULE_AUTHOR Len Brown
2009-04-23  6:23   ` [PATCH 20/29] thinkpad-acpi: simplify module autoloading Len Brown
2009-04-23  6:23   ` [PATCH 21/29] thinkpad-acpi: bump up version to 0.23 Len Brown
2009-04-23  6:23   ` [PATCH 22/29] x86, acpi_cpufreq: Fix the NULL pointer dereference in get_measured_perf Len Brown
2009-04-23  6:23   ` [PATCH 23/29] acpi-cpufreq: Cleanup: Use printk_once Len Brown
2009-04-23  6:23   ` [PATCH 24/29] acpi-cpufreq: style-only: add parens to math expression Len Brown
2009-04-23  6:23   ` Len Brown [this message]
2009-04-23  6:23   ` [PATCH 26/29] ACPI video: fix an error when the brightness levels on AC and on Battery are same Len Brown
2009-04-23  6:23   ` [PATCH 27/29] ACPI: add /sys/firmware/acpi/interrupts/sci_not counter Len Brown
2009-04-23  6:23   ` [PATCH 28/29] ACPI: idle: mark_tsc_unstable() at init-time, not run-time Len Brown
2009-04-23  6:23   ` [PATCH 29/29] ACPI: delete obsolete "bus master activity" proc field Len Brown

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=d876dfbbf5c8728102fb4f683450fa9ae3259cda.1240467665.git.len.brown@intel.com \
    --to=lenb@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=trenn@suse.de \
    /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.