public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
To: Thomas Renninger <trenn@suse.de>
Cc: "lenb@kernel.org" <lenb@kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>
Subject: Re: [PATCH 4/8] acpi-cpufreq: Do not let get_measured perf depend on internal variable
Date: Fri, 17 Apr 2009 10:24:37 -0700	[thread overview]
Message-ID: <1239989077.4529.8644.camel@localhost.localdomain> (raw)
In-Reply-To: <1239978132-6261-5-git-send-email-trenn@suse.de>


Ack.

I am not sure below printk is adding much value though, considering
cpufreq_frequency_table_cpuinfo() that is initializing cpuinfo.max_freq
is getting called just one line before this code.

Thanks,
Venki

> +	if (perf->states[0].core_frequency * 1000 !=
policy->cpuinfo.max_freq)
> +		printk(KERN_WARNING FW_WARN "P-state 0 is not max freq\n");
> +


On Fri, 2009-04-17 at 07:22 -0700, Thomas Renninger wrote:
> 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>
> Cc: <linux-acpi@vger.kernel.org>
> Cc: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
> Cc: <cpufreq@vger.kernel.org>
> ---
>  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 7948d88..7a9a161 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 */


  reply	other threads:[~2009-04-17 17:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17 14:22 acpi-cpufreq: Move average performance code and make it available to userspace and several cleanups in this area Thomas Renninger
2009-04-17 14:22 ` [PATCH 1/8] Fix for a regression that was introduced by earlier commit Thomas Renninger
2009-04-18  5:30   ` Len Brown
2009-04-17 14:22 ` [PATCH 2/8] acpi-cpufreq: Cleanup: Use printk_once Thomas Renninger
2009-04-18  5:31   ` Len Brown
2009-04-17 14:22 ` [PATCH 3/8] acpi-cpufreq: First multiply then divide to avoid zero results Thomas Renninger
2009-04-17 17:10   ` Pallipadi, Venkatesh
2009-04-18  5:37     ` Len Brown
2009-04-17 14:22 ` [PATCH 4/8] acpi-cpufreq: Do not let get_measured perf depend on internal variable Thomas Renninger
2009-04-17 17:24   ` Pallipadi, Venkatesh [this message]
2009-04-18  9:49     ` Thomas Renninger
2009-04-17 14:22 ` [PATCH 5/8] acpi-cpufreq: Move average performance funtions into separate file and KConfig Thomas Renninger
2009-04-17 17:32   ` Pallipadi, Venkatesh
2009-04-20 11:41     ` Thomas Renninger
2009-04-20 17:04       ` Pallipadi, Venkatesh
2009-04-17 14:22 ` [PATCH 6/8] CPUFREQ: Add average frequency to sysfs exported files of cpufreq_stats Thomas Renninger
2009-04-17 14:22 ` [PATCH 7/8] acpi-cpufreq: Use already defined IDA feature flag instead of checking cpuid Thomas Renninger
2009-04-17 17:35   ` Pallipadi, Venkatesh
2009-04-17 14:22 ` [PATCH 8/8] CPUFREQ: Add documentation for new average_freq cpufreq_stats sysfs file Thomas Renninger

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=1239989077.4529.8644.camel@localhost.localdomain \
    --to=venkatesh.pallipadi@intel.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=lenb@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox