From: Jos Delbar <jos.delbar-Cru1EgDzd7c@public.gmane.org>
To: Dominik Brodowski
<linux-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>
Cc: Len Brown <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
ACPI Developers
<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
Robert Moore
<robert.moore-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
James P Ketrenos
<james.p.ketrenos-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: Re: Linux ACPI processor driver patch: user-definable power state limit
Date: Sat, 6 Nov 2004 14:15:20 +0100 [thread overview]
Message-ID: <200411061415.20364.jos.delbar@ugent.be> (raw)
In-Reply-To: <20041106002935.GA30467-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>
On Saturday 06 November 2004 01:29, Dominik Brodowski wrote:
> If that is the case, my patch is "overkill". If there's a chance to do more
> fine-tuned disabling of C3, my patch seems to be better.
Maybe you could reduce the overkill by using a counter instead of a linked
list to keep track of the limits imposed by other modules. I don't think you
need any extra code in the idle handler, Len's additions should be enough to
handle a limit change. The only possible danger that I can see is one or more
extra idle cycles with an outdated limit.
As it is, is there a way for a module such as ipw2100 to detect when its limit
request has been commited? Does the processor module export the current C
state, or should the module rely on the /proc file?
Anyway, here is some code to illustrate the counter. And now I'm going to stop
spending time on workarounds! ;-)
static unsigned int cstate_limit_counter[ACPI_C_STATES_MAX];
static spinlock_t cstate_limit_lock = SPIN_LOCK_UNLOCKED;
inline void acpi_update_cstate_limit(unsigned int limit, int gain)
{
unsigned long flags;
int c;
if(new_limit >= ACPI_C_STATES_MAX)
return;
spin_lock_irqsave(&cstate_limit_lock, flags);
if (gain > 0)
cstate_limit_counter[limit]++;
else if (cstate_limit_counter[limit] > 0)
cstate_limit_counter[limit]--;
for (c = 0; c < ACPI_C_STATES_MAX; c++) {
if (cstate_limit_counter[c]) {
acpi_cstate_limit = c;
spin_unlock_irqrestore(&cstate_limit_lock, flags);
return;
}
}
acpi_cstate_limit = ACPI_C_STATES_MAX;
spin_unlock_irqrestore(&cstate_limit_lock, flags);
}
static void acpi_remove_cstate_limit(unsigned int limit)
{
acpi_update_cstate_limit(limit, -1);
}
static void acpi_set_cstate_limit(unsigned int limit)
{
acpi_update_cstate_limit(limit, 1);
}
--
Jos Delbar
jos.delbar-Cru1EgDzd7c@public.gmane.org
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
next prev parent reply other threads:[~2004-11-06 13:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-10 16:56 Linux ACPI processor driver patch: user-definable power state limit Brown, Len
[not found] ` <F7DC2337C7631D4386A2DF6E8FB22B3001A193B6-N2PTB0HCzHKkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-10-11 21:35 ` Jos Delbar
[not found] ` <200410112335.19159.jos.delbar-Cru1EgDzd7c@public.gmane.org>
2004-10-19 17:19 ` Len Brown
2004-11-05 19:45 ` Len Brown
2004-11-05 22:54 ` Dominik Brodowski
[not found] ` <20041105225438.GA8262-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>
2004-11-05 23:11 ` Len Brown
2004-11-05 23:41 ` Dominik Brodowski
[not found] ` <20041105234120.GA20761-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>
2004-11-06 0:25 ` Len Brown
2004-11-06 0:29 ` Dominik Brodowski
[not found] ` <20041106002935.GA30467-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>
2004-11-06 0:44 ` Len Brown
2004-11-06 13:15 ` Jos Delbar [this message]
2004-11-05 23:54 ` Dominik Brodowski
[not found] ` <20041105235403.GA21880-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org>
2004-11-06 0:33 ` Len Brown
2004-11-05 23:39 ` Jos Delbar
[not found] ` <200411060039.28067.jos.delbar-Cru1EgDzd7c@public.gmane.org>
2004-11-05 23:55 ` Dominik Brodowski
2004-11-05 22:58 ` Len Brown
2004-11-05 23:21 ` Jos Delbar
[not found] ` <200411060021.49794.jos.delbar-Cru1EgDzd7c@public.gmane.org>
2004-11-06 1:01 ` Len Brown
2004-11-06 2:59 ` Len Brown
-- strict thread matches above, loose matches on Subject: below --
2004-10-10 7:14 Brown, Len
[not found] <200408071959.10529.jos.delbar@ugent.be>
2004-10-09 5:52 ` Len Brown
2004-10-09 18:56 ` Dominik Brodowski
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=200411061415.20364.jos.delbar@ugent.be \
--to=jos.delbar-cru1egdzd7c@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=james.p.ketrenos-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-X3ehHDuj6sIIGcDfoQAp7BvVK+yQ3ZXh@public.gmane.org \
--cc=robert.moore-ral2JQCrhuEAvxtiuMwx3w@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 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.