public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Josh Boyer <jwboyer@redhat.com>
To: Matthew Garrett <mjg@redhat.com>
Cc: linux-acpi@vger.kernel.org, lenb@kernel.org, rui.zhang@intel.com
Subject: Re: [PATCH] ACPI: Ensure thermal limits match CPU frequencies
Date: Tue, 30 Aug 2011 10:03:27 -0400	[thread overview]
Message-ID: <20110830140327.GQ2270@zod.bos.redhat.com> (raw)
In-Reply-To: <1314642507-32491-1-git-send-email-mjg@redhat.com>

On Mon, Aug 29, 2011 at 02:28:27PM -0400, Matthew Garrett wrote:
> The ACPI thermal management code supports slowing down a CPU when it's
> overheating. Right now that's done by choosing to run it at 100%, 75%, 50%
> or 25% of full speed. However, most CPUs do not allow an arbitrary
> frequency to be set and so will run at the first frequency below that value.
> This doesn't match the intent of the specification, which is to drop the
> frequency state by state until the temperature stabalises. Fix this up
> so it uses actual frequencies rather than percentages.
> 
> Reported by: Gene Snider <snider6982@comcast.net>
> Signed-off-by: Matthew Garrett <mjg@redhat.com>
> ---
>  drivers/acpi/processor_thermal.c |   45 +++++++++++++++++++++----------------
>  1 files changed, 25 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
> index 870550d..1c4eb60 100644
> --- a/drivers/acpi/processor_thermal.c
> +++ b/drivers/acpi/processor_thermal.c
> @@ -52,10 +52,8 @@ ACPI_MODULE_NAME("processor_thermal");
>   * _any_ cpufreq driver and not only the acpi-cpufreq driver.
>   */
>  
> -#define CPUFREQ_THERMAL_MIN_STEP 0
> -#define CPUFREQ_THERMAL_MAX_STEP 3
>  
> -static DEFINE_PER_CPU(unsigned int, cpufreq_thermal_reduction_pctg);
> +static DEFINE_PER_CPU(unsigned int, cpufreq_thermal_limit_state);
>  static unsigned int acpi_thermal_cpufreq_is_init = 0;
>  
>  static int cpu_has_cpufreq(unsigned int cpu)
> @@ -70,19 +68,19 @@ static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb,
>  					 unsigned long event, void *data)
>  {
>  	struct cpufreq_policy *policy = data;
> -	unsigned long max_freq = 0;
> +	int state = per_cpu(cpufreq_thermal_limit_state, policy->cpu);
> +	struct cpufreq_frequency_table *table;
>  
>  	if (event != CPUFREQ_ADJUST)
> -		goto out;
> +		return 0;
> +
> +	table = cpufreq_frequency_get_table(policy->cpu);

If CONFIG_CPU_FREQ_TABLE=m and CONFIG_ACPI_PROCESSOR=y, you'll get a
link error for an undefined symbol on this.  This requires
ACPI_PROCESSOR to select CPU_FREQ_TABLE.

josh

      reply	other threads:[~2011-08-30 14:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 18:28 [PATCH] ACPI: Ensure thermal limits match CPU frequencies Matthew Garrett
2011-08-30 14:03 ` Josh Boyer [this message]

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=20110830140327.GQ2270@zod.bos.redhat.com \
    --to=jwboyer@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=rui.zhang@intel.com \
    /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