* powersaved is backwards on my machine...
@ 2006-08-28 16:45 Erich Boleyn
2006-10-02 23:18 ` Dominik Brodowski
0 siblings, 1 reply; 4+ messages in thread
From: Erich Boleyn @ 2006-08-28 16:45 UTC (permalink / raw)
To: cpufreq
[just being clear, I am an AMD employee, though I am writing for
myself at the moment]
Greetings,
Maybe this is a FAQ of some sort, but I couldn't find it with the
searches I tried, so I'm sending it here to know what the right thing
to do is...
I have an AMD machine which, when I enabled the powernow-k8 module and
powersaved, sets the power states opposite of what they should be.
I.e. when the machine is unloaded, it runs at the highest clock speed/
power state, and which the machine is loaded, it runs at the lowest
clock speed/power state.
I looked at the code a bit, and figured out the root causes:
-- My old machine does not have correct ACPI power-state tables, so
I disabled that. (no, I can't get a BIOS update, sigh)
-- It *does* have a functioning old Athlon64 PSB BIOS interface.
-- powernow-k8 reports PSB-based power-states in ascending order
instead of descending order like ACPI.
-- powersaved assumes that the cpufreq interface will always
report the power-states in descending order.
Fixing either cpufreq to report them always in descending order, or
powersaved to not assume it is in descending order is possebl... but
the question is what the cpufreq interface *should* support.
So, I could not find any documentation on cpufreq that claimed the
frequency states listed should be in any particular order, but maybe
I was just not looking in the right place for the documentation...
--
Erich Stefan Boleyn <erich@uruk.org> http://www.uruk.org/
"Reality is truly stranger than fiction; Probably why fiction is so popular"
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: powersaved is backwards on my machine...
2006-08-28 16:45 powersaved is backwards on my machine Erich Boleyn
@ 2006-10-02 23:18 ` Dominik Brodowski
2006-10-03 14:10 ` Holger Macht
0 siblings, 1 reply; 4+ messages in thread
From: Dominik Brodowski @ 2006-10-02 23:18 UTC (permalink / raw)
To: Erich Boleyn; +Cc: cpufreq
Hi,
On Mon, Aug 28, 2006 at 09:45:48AM -0700, Erich Boleyn wrote:
> So, I could not find any documentation on cpufreq that claimed the
> frequency states listed should be in any particular order, but maybe
> I was just not looking in the right place for the documentation...
There's no such documentation that I'm aware of :) and I don't see why we
should enforce any particular order here. So I'd say fixing powernowd is the
right approach here.
Thanks for debugging this!
Dominik
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: powersaved is backwards on my machine...
2006-10-02 23:18 ` Dominik Brodowski
@ 2006-10-03 14:10 ` Holger Macht
2006-10-03 16:59 ` Erich Boleyn
0 siblings, 1 reply; 4+ messages in thread
From: Holger Macht @ 2006-10-03 14:10 UTC (permalink / raw)
To: Erich Boleyn, cpufreq
On Mon 02. Oct - 19:18:48, Dominik Brodowski wrote:
> Hi,
>
> On Mon, Aug 28, 2006 at 09:45:48AM -0700, Erich Boleyn wrote:
> > So, I could not find any documentation on cpufreq that claimed the
> > frequency states listed should be in any particular order, but maybe
> > I was just not looking in the right place for the documentation...
>
> There's no such documentation that I'm aware of :) and I don't see why we
> should enforce any particular order here. So I'd say fixing powernowd is the
> right approach here.
Ok, so I will fix powersaved to sort the values after reading them from
scaling_avaialable_frequencies because I can't even assume that they are
in any particular order, neither descending nor ascending.
Regards,
Holger
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: powersaved is backwards on my machine...
2006-10-03 14:10 ` Holger Macht
@ 2006-10-03 16:59 ` Erich Boleyn
0 siblings, 0 replies; 4+ messages in thread
From: Erich Boleyn @ 2006-10-03 16:59 UTC (permalink / raw)
To: Holger Macht, cpufreq
[-- Attachment #1: Type: text/plain, Size: 931 bytes --]
Holger Macht <hmacht@suse.de> wrote:
> On Mon 02. Oct - 19:18:48, Dominik Brodowski wrote:
> > Hi,
> >
> > On Mon, Aug 28, 2006 at 09:45:48AM -0700, Erich Boleyn wrote:
> > > So, I could not find any documentation on cpufreq that claimed the
> > > frequency states listed should be in any particular order, but maybe
> > > I was just not looking in the right place for the documentation...
> >
> > There's no such documentation that I'm aware of :) and I don't see why we
> > should enforce any particular order here. So I'd say fixing powernowd is the
> > right approach here.
>
> Ok, so I will fix powersaved to sort the values after reading them from
> scaling_avaialable_frequencies because I can't even assume that they are
> in any particular order, neither descending nor ascending.
I had come to that conclusion as well, and made a tiny patch which did a
"qsort" on the values involved as a quick and dirty solution.
[-- Attachment #2: /home/erich/powersave-0.13.5-sort.patch --]
[-- Type: text/plain, Size: 789 bytes --]
diff -ruN powersave-0.13.5.orig/daemon/cpufreq_userspace.cpp powersave-0.13.5/daemon/cpufreq_userspace.cpp
--- powersave-0.13.5.orig/daemon/cpufreq_userspace.cpp 2006-08-14 03:57:16.000000000 -0700
+++ powersave-0.13.5/daemon/cpufreq_userspace.cpp 2006-08-29 21:54:02.000000000 -0700
@@ -24,6 +24,7 @@
#include <sstream>
#include <cpufreq.h>
+#include <stdlib.h>
#include "cpufreq_interface.h"
#include "globals.h"
@@ -328,6 +329,10 @@
}
#endif
+static int myqsortcmp(const void *a, const void *b)
+{
+ return (*(unsigned*)b) - (*(unsigned*)a);
+}
int CPUFreq_Userspace::initFreqsViaFile()
{
@@ -351,6 +356,9 @@
}
}
+ // Sort frequencies
+ qsort(&_speeds_kHz[0], speed_no, sizeof(unsigned), myqsortcmp);
+
_speeds_kHz[speed_no + 1] = 0;
_last_step = speed_no;
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
--
Erich Stefan Boleyn <erich@uruk.org> http://www.uruk.org/
"Reality is truly stranger than fiction; Probably why fiction is so popular"
[-- Attachment #4: Type: text/plain, Size: 147 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-10-03 16:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-28 16:45 powersaved is backwards on my machine Erich Boleyn
2006-10-02 23:18 ` Dominik Brodowski
2006-10-03 14:10 ` Holger Macht
2006-10-03 16:59 ` Erich Boleyn
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.