public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: linux-JhLEnvuH02M@public.gmane.org
To: Pavel Machek <pavel-AlSwsSmVLrQ@public.gmane.org>,
	len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: [PATCH] acpi 2.6: consistent user-forced throttling (9/8) [Was: Re: [PATCHES] ACPI Processor update [idle, throttling, thermal, cpufreq]]
Date: Wed, 10 Sep 2003 02:17:16 +0200	[thread overview]
Message-ID: <20030910001716.GA10324@brodo.de> (raw)
In-Reply-To: <20030910000041.GC217-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>

As Pavel Machek has noted, it may be desireable for an user to force a
ceratin throttling level which is kept even if a thermal "decrease cooling"
commands are issued. So, save the user input, and make sure throttling is at
least set to this user_state

diff -ruN linux-original/drivers/acpi/processor_throttling.c linux/drivers/acpi/processor_throttling.c
--- linux-original/drivers/acpi/processor_throttling.c	2003-09-09 23:07:10.000000000 +0200
+++ linux/drivers/acpi/processor_throttling.c	2003-09-10 02:13:05.491536944 +0200
@@ -77,6 +77,7 @@
 struct acpi_processor_throttling {
 	acpi_handle		handle;
 	int			state;
+	int			user_state;
 	u32			address;
 	u8			duty_offset;
 	u8			duty_width;
@@ -211,8 +212,9 @@
 
 	seq_puts(seq, "states:\n");
 	for (i = 0; i < throttle_data[cpu].state_count; i++)
-		seq_printf(seq, "   %cT%d:                  %02d%%\n",
+		seq_printf(seq, " %c%cT%d:                  %02d%%\n",
 			(i == throttle_data[cpu].state?'*':' '), i,
+			(i >= throttle_data[cpu].user_state?'u':' '), i,
 			(throttle_data[cpu].states[i].performance?throttle_data[cpu].states[i].performance/10:0));
 
 end:
@@ -252,6 +254,8 @@
 	if (result)
 		return_VALUE(result);
 
+	throttle_data[cpu].user_state = simple_strtoul(state_string, NULL, 0);
+
 	return_VALUE(count);
 }
 
@@ -536,6 +540,9 @@
 	if (throttle_data[cpu].state == 0)
 		return -ERANGE;
 
+	if (throttle_data[cpu].state == throttle_data[cpu].user_state)
+		return -ERANGE;
+
 	ret = acpi_processor_set_throttling(cpu, throttle_data[cpu].state - 1);
 
 	return ret;




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

  parent reply	other threads:[~2003-09-10  0:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-04 22:24 [PATCHES] ACPI Processor update [idle,throttling,thermal,cpufreq] Dominik Brodowski
     [not found] ` <20030904222434.GC6350-JhLEnvuH02M@public.gmane.org>
2003-09-05  5:23   ` [ACPI] [PATCHES] ACPI Processor update [idle, throttling, thermal, cpufreq] Dmitry Torokhov
     [not found]     ` <200309050023.06761.dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
2003-09-05  6:52       ` Dominik Brodowski
2003-09-08 13:29   ` Pavel Machek
     [not found]     ` <20030908132939.GD3944-u08AdweFZfgxtPtxi4kahqVXKuFTiq87@public.gmane.org>
2003-09-09 17:21       ` linux-JhLEnvuH02M
     [not found]         ` <20030909172135.GA4106-JhLEnvuH02M@public.gmane.org>
2003-09-09 23:13           ` Pavel Machek
     [not found]             ` <20030909231303.GH211-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2003-09-09 23:29               ` linux-JhLEnvuH02M
     [not found]                 ` <20030909232916.GA9561-JhLEnvuH02M@public.gmane.org>
2003-09-10  0:00                   ` Pavel Machek
     [not found]                     ` <20030910000041.GC217-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2003-09-10  0:17                       ` linux-JhLEnvuH02M [this message]
     [not found]                         ` <20030910001716.GA10324-JhLEnvuH02M@public.gmane.org>
2003-09-10 10:54                           ` [PATCH] acpi 2.6: consistent user-forced throttling (9/8) [Was: Re: [PATCHES] ACPI Processor update [idle, throttling, thermal, cpufreq]] Nils Faerber
     [not found]                             ` <1063191264.23733.1320.camel-65LrUGLyukAb1SvskN2V4Q@public.gmane.org>
2003-09-10 12:53                               ` linux-JhLEnvuH02M

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=20030910001716.GA10324@brodo.de \
    --to=linux-jhlenvuh02m@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=pavel-AlSwsSmVLrQ@public.gmane.org \
    /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