* [PATCH 2.6] cpufreq longrun driver fix
@ 2004-04-05 15:50 Stelian Pop
2004-04-05 17:38 ` Dominik Brodowski
0 siblings, 1 reply; 3+ messages in thread
From: Stelian Pop @ 2004-04-05 15:50 UTC (permalink / raw)
To: Linux Kernel Mailing List; +Cc: davej, cpufreq, linux
Hi,
My TM5600 Crusoe processor, found inside a Sony Vaio C1VE laptop,
does not work with the longrun cpufreq driver.
Upon investigation, the reason is that trying to set the performance
to 80% in longrun_determine_freqs leaves the performance to 100%.
The performance level, at least on this particular model, can be lowered
only in 33% steps. And in order to put the performance to 66%, the
code should try to set the barrier to 70%.
The following patch does even more, it tries every value from 80%
to 10% in 10% steps, until it succeeds in lowering the performance.
I'm not sure this is the best way to do it but in any case,
it works for me (and should continue to work for everybody else).
Stelian.
===== arch/i386/kernel/cpu/cpufreq/longrun.c 1.18 vs edited =====
--- 1.18/arch/i386/kernel/cpu/cpufreq/longrun.c Thu Feb 19 03:48:38 2004
+++ edited/arch/i386/kernel/cpu/cpufreq/longrun.c Mon Apr 5 17:06:12 2004
@@ -142,6 +142,7 @@
u32 msr_lo, msr_hi;
u32 save_lo, save_hi;
u32 eax, ebx, ecx, edx;
+ u32 try_hi;
struct cpuinfo_x86 *c = cpu_data;
if (!low_freq || !high_freq)
@@ -184,12 +185,14 @@
* upper limit to make the calculation more accurate.
*/
cpuid(0x80860007, &eax, &ebx, &ecx, &edx);
- if (ecx > 90) {
- /* set to 0 to 80 perf_pctg */
+ /* try decreasing in 10% steps, some processors react only
+ * on some barrier values */
+ for (try_hi = 80; try_hi > 0 && ecx > 90; try_hi -=10) {
+ /* set to 0 to try_hi perf_pctg */
msr_lo &= 0xFFFFFF80;
msr_hi &= 0xFFFFFF80;
msr_lo |= 0;
- msr_hi |= 80;
+ msr_hi |= try_hi;
wrmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi);
/* read out current core MHz and current perf_pctg */
--
Stelian Pop <stelian@popies.net>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2.6] cpufreq longrun driver fix
2004-04-05 15:50 [PATCH 2.6] cpufreq longrun driver fix Stelian Pop
@ 2004-04-05 17:38 ` Dominik Brodowski
2004-04-05 17:59 ` Dave Jones
0 siblings, 1 reply; 3+ messages in thread
From: Dominik Brodowski @ 2004-04-05 17:38 UTC (permalink / raw)
To: Stelian Pop, Linux Kernel Mailing List, davej, cpufreq
[-- Attachment #1: Type: text/plain, Size: 911 bytes --]
On Mon, Apr 05, 2004 at 05:50:12PM +0200, Stelian Pop wrote:
> Hi,
>
> My TM5600 Crusoe processor, found inside a Sony Vaio C1VE laptop,
> does not work with the longrun cpufreq driver.
>
> Upon investigation, the reason is that trying to set the performance
> to 80% in longrun_determine_freqs leaves the performance to 100%.
> The performance level, at least on this particular model, can be lowered
> only in 33% steps. And in order to put the performance to 66%, the
> code should try to set the barrier to 70%.
>
> The following patch does even more, it tries every value from 80%
> to 10% in 10% steps, until it succeeds in lowering the performance.
> I'm not sure this is the best way to do it but in any case,
> it works for me (and should continue to work for everybody else).
Patch looks good to me -- thanks, Stelian!
Dave, could you merge it, please?
Thanks,
Dominik
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2.6] cpufreq longrun driver fix
2004-04-05 17:38 ` Dominik Brodowski
@ 2004-04-05 17:59 ` Dave Jones
0 siblings, 0 replies; 3+ messages in thread
From: Dave Jones @ 2004-04-05 17:59 UTC (permalink / raw)
To: Stelian Pop, Linux Kernel Mailing List, davej, cpufreq
> > The following patch does even more, it tries every value from 80%
> > to 10% in 10% steps, until it succeeds in lowering the performance.
> > I'm not sure this is the best way to do it but in any case,
> > it works for me (and should continue to work for everybody else).
>
> Patch looks good to me -- thanks, Stelian!
> Dave, could you merge it, please?
Yup, will be in cpufreq-bk soon, and the next -mm that
Andrew rolls up.
Dave
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-04-05 18:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-05 15:50 [PATCH 2.6] cpufreq longrun driver fix Stelian Pop
2004-04-05 17:38 ` Dominik Brodowski
2004-04-05 17:59 ` Dave Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox