public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* MSI K8N Neo + powernow-k8: ACPI info is worse than BIOS PST
@ 2004-07-31 14:00 Randall Nortman
  2004-08-02 10:07 ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Randall Nortman @ 2004-07-31 14:00 UTC (permalink / raw)
  To: linux-kernel

I'm running kernel 2.6.7 (as distributed by Gentoo in
gentoo-dev-sources) on an Athlon 3000+ with an MSI K8N Neo Platinum
motherboard, BIOS v1.1 (most recent available).  The stock powernow-k8
first queries ACPI for CPU frequency/voltage tables, and on this
system that information is hopeless:

-----
Jul 29 19:09:34 terry powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09b)
Jul 29 19:09:34 terry powernow-k8:    0 : fid 0xc (2000 MHz), vid 0x2 (1500 mV)
Jul 29 19:09:34 terry powernow-k8:    1 : fid 0xa (1800 MHz), vid 0x6 (1400 mV)
Jul 29 19:09:34 terry powernow-k8:    2 : fid 0xa (1800 MHz), vid 0x6 (1400 mV)
Jul 29 19:09:34 terry powernow-k8: cpu_init done, current fid 0xc, vid 0x2
-----

I hacked arch/i386/kernel/cpu/cpufreq/powernow-k8.c a bit so that the
ACPI info is ingored in favor of the BIOS PST table, with this result:

-----
Jul 30 21:49:23 terry powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09b)
Jul 30 21:49:23 terry powernow-k8: BIOS error: numpst must be 1
-----

So, I found a patch that Tony Lindgren posted back in May to work
around buggy BIOSes, which included a change to make it ignore the
numpst error, and then I got this:

-----
Jul 30 21:38:39 terry powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09b)
Jul 30 21:38:39 terry powernow-k8: BIOS error: numpst listed as 2 should be 1. Ignoring it.
Jul 30 21:38:39 terry powernow-k8:    0 : fid 0x2 (1000 MHz), vid 0x12 (1100 mV)
Jul 30 21:38:39 terry powernow-k8:    1 : fid 0xa (1800 MHz), vid 0x6 (1400 mV)
Jul 30 21:38:39 terry powernow-k8:    2 : fid 0xc (2000 MHz), vid 0x2 (1500 mV)
Jul 30 21:38:39 terry powernow-k8: cpu_init done, current fid 0xc, vid 0x2
-----

That's much better, but this CPU really ought to be able to clock all
the way down to 800MHz, so then I did a little more hacking to ignore
both the BIOS and ACPI info, and just use the hardcoded tables
provided in Tony's patch, which gives me what I want:

-----
Jul 30 22:04:55 terry powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09b)
Jul 30 22:04:55 terry powernow-k8: BIOS error: numpst listed as 2 should be 1. Ignoring it.
Jul 30 22:04:55 terry powernow-k8: BIOS error: overriding frequency table
Jul 30 22:04:55 terry powernow-k8:    0 : fid 0x0 (800 MHz), vid 0x12 (1100 mV)
Jul 30 22:04:55 terry powernow-k8:    1 : fid 0xc (2000 MHz), vid 0x2 (1500 mV)
Jul 30 22:04:55 terry powernow-k8: cpu_init done, current fid 0xc, vid 0x2
-----

My "patch" is brute-force and ugly, and I didn't bother understanding
the code fully before I hacked it to pieces, so I refuse to release it
into the wild.  However, if you have this mobo and want to live
dangerously, you may write to me directly to get my code.

If anybody qualified to hack this code is interested in creating a
real workaround for BIOSes like this, I offer my system (and my time,
as I cannot give remote access) for testing.  I would suggest adding a
compile-time or load-time option to prefer the BIOS over ACPI (as in
powernow-k7, I think), and maybe a compile-time option to use Tony's
hardcoded tables.

(I do not read this list regularly, but I'll try to follow this thread
for the next few weeks.  Past that time, I request that you CC me
directly on anything related to this issue.  Thanks!)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: MSI K8N Neo + powernow-k8: ACPI info is worse than BIOS PST
  2004-07-31 14:00 MSI K8N Neo + powernow-k8: ACPI info is worse than BIOS PST Randall Nortman
@ 2004-08-02 10:07 ` Tony Lindgren
  2004-08-02 11:46   ` Randall Nortman
  0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2004-08-02 10:07 UTC (permalink / raw)
  To: Randall Nortman; +Cc: linux-kernel

* Randall Nortman <linuxkernellist@wonderclown.com> [040731 07:01]:
> 
> If anybody qualified to hack this code is interested in creating a
> real workaround for BIOSes like this, I offer my system (and my time,
> as I cannot give remote access) for testing.  I would suggest adding a
> compile-time or load-time option to prefer the BIOS over ACPI (as in
> powernow-k7, I think), and maybe a compile-time option to use Tony's
> hardcoded tables.

Just to clarify a bit, my patch only uses the 800MHz hardcoded, which
should work on all AMD64 processors. The max value used is the current
running value.

Tony

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: MSI K8N Neo + powernow-k8: ACPI info is worse than BIOS PST
  2004-08-02 10:07 ` Tony Lindgren
@ 2004-08-02 11:46   ` Randall Nortman
  2004-08-02 12:43     ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Randall Nortman @ 2004-08-02 11:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Tony Lindgren

On Mon, Aug 02, 2004 at 03:07:01AM -0700, Tony Lindgren wrote:
> * Randall Nortman <linuxkernellist@wonderclown.com> [040731 07:01]:
> > 
> > If anybody qualified to hack this code is interested in creating a
> > real workaround for BIOSes like this, I offer my system (and my time,
> > as I cannot give remote access) for testing.  I would suggest adding a
> > compile-time or load-time option to prefer the BIOS over ACPI (as in
> > powernow-k7, I think), and maybe a compile-time option to use Tony's
> > hardcoded tables.
> 
> Just to clarify a bit, my patch only uses the 800MHz hardcoded, which
> should work on all AMD64 processors. The max value used is the current
> running value.


Actually, thanks to an off-list response from Anton Ertl (anton at
mips dot complang dot tuwien dot ac dot at), I have made an important
discovery that's relevant to my situation and your patch: newer amd64
cores (Newcastle cores) cannot clock down to 800MHz!  I apparently am
lucky enough to have gotten the CG stepping of my CPU, which supports
1000, 1800, and 2000MHz modes, exactly as reported by the BIOS.  I
have therefore backed out your patch, and the result is that my system
is actually snappier.  (I suspect that really weird things were
happening when cpufreq tried to clock down to 800MHz; I was getting
high CPU load, periodic temporary freezes, and audio glitches, all of
which went away when I set the minimum clock to 1000MHz.  I hope I
didn't do any permanent damage.)  These new cores actually consume
less power at 1000MHz than the old ones did at 800MHz, so it's a
win-win for the lucky ones like me.

Now that I see that my BIOS table was correct after all, I'm left
wondering why MSI would have gotten that right but the ACPI wrong,
since Windows uses the ACPI information afaik.  And that leads me to
suspect that perhaps the bug is in the powernow-k8 ACPI code rather
than my firmware.  Any thoughts?

Randall Nortman

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: MSI K8N Neo + powernow-k8: ACPI info is worse than BIOS PST
  2004-08-02 11:46   ` Randall Nortman
@ 2004-08-02 12:43     ` Tony Lindgren
  0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2004-08-02 12:43 UTC (permalink / raw)
  To: linux-kernel

* Randall Nortman <linuxkernellist@wonderclown.com> [040802 04:47]:
> On Mon, Aug 02, 2004 at 03:07:01AM -0700, Tony Lindgren wrote:
> > * Randall Nortman <linuxkernellist@wonderclown.com> [040731 07:01]:
> > > 
> > > If anybody qualified to hack this code is interested in creating a
> > > real workaround for BIOSes like this, I offer my system (and my time,
> > > as I cannot give remote access) for testing.  I would suggest adding a
> > > compile-time or load-time option to prefer the BIOS over ACPI (as in
> > > powernow-k7, I think), and maybe a compile-time option to use Tony's
> > > hardcoded tables.
> > 
> > Just to clarify a bit, my patch only uses the 800MHz hardcoded, which
> > should work on all AMD64 processors. The max value used is the current
> > running value.
> 
> 
> Actually, thanks to an off-list response from Anton Ertl (anton at
> mips dot complang dot tuwien dot ac dot at), I have made an important
> discovery that's relevant to my situation and your patch: newer amd64
> cores (Newcastle cores) cannot clock down to 800MHz!  I apparently am
> lucky enough to have gotten the CG stepping of my CPU, which supports
> 1000, 1800, and 2000MHz modes, exactly as reported by the BIOS.  I
> have therefore backed out your patch, and the result is that my system
> is actually snappier.  (I suspect that really weird things were
> happening when cpufreq tried to clock down to 800MHz; I was getting
> high CPU load, periodic temporary freezes, and audio glitches, all of
> which went away when I set the minimum clock to 1000MHz.  I hope I
> didn't do any permanent damage.)  These new cores actually consume
> less power at 1000MHz than the old ones did at 800MHz, so it's a
> win-win for the lucky ones like me.

OK, then my patch does not work any more unless there's some way to
detect what's the correct minimum speed. Since my system works with
just the ACPI tables, it's unlikely that I'll spend more time on 
this :)

> Now that I see that my BIOS table was correct after all, I'm left
> wondering why MSI would have gotten that right but the ACPI wrong,
> since Windows uses the ACPI information afaik.  And that leads me to
> suspect that perhaps the bug is in the powernow-k8 ACPI code rather
> than my firmware.  Any thoughts?

No idea...

Tony

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: MSI K8N Neo + powernow-k8: ACPI info is worse than BIOS PST
       [not found] ` <2oI5h-3A8-7@gated-at.bofh.it>
@ 2004-08-02 12:49   ` Andi Kleen
  2004-08-02 17:34     ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2004-08-02 12:49 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linuxkernellist, linux-kernel

Tony Lindgren <tony@atomide.com> writes:
>
> Just to clarify a bit, my patch only uses the 800MHz hardcoded, which
> should work on all AMD64 processors. The max value used is the current
> running value.

No, it won't. It will fail on the new/upcomming CPUs with 1Ghz HyperTransport. 
The minimum frequency cannot be lower than the HyperTransport speed.

And for others sometimes laptop batteries are not designed to support
more than 800Mhz.

Overall hardcoding such tables is imho a bad idea, unless you
*really* know what you're doing.

-Andi


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: MSI K8N Neo + powernow-k8: ACPI info is worse than BIOS PST
  2004-08-02 12:49   ` Andi Kleen
@ 2004-08-02 17:34     ` Tony Lindgren
  0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2004-08-02 17:34 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linuxkernellist, linux-kernel

* Andi Kleen <ak@muc.de> [040802 05:49]:
> Tony Lindgren <tony@atomide.com> writes:
> >
> > Just to clarify a bit, my patch only uses the 800MHz hardcoded, which
> > should work on all AMD64 processors. The max value used is the current
> > running value.
> 
> No, it won't. It will fail on the new/upcomming CPUs with 1Ghz HyperTransport. 
> The minimum frequency cannot be lower than the HyperTransport speed.
> 
> And for others sometimes laptop batteries are not designed to support
> more than 800Mhz.

OK, that's good to know.

> Overall hardcoding such tables is imho a bad idea, unless you
> *really* know what you're doing.

Yes, sounds like it's not needed any longer. The ACPI tables seem to
work fine.

Tony

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-08-02 17:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-31 14:00 MSI K8N Neo + powernow-k8: ACPI info is worse than BIOS PST Randall Nortman
2004-08-02 10:07 ` Tony Lindgren
2004-08-02 11:46   ` Randall Nortman
2004-08-02 12:43     ` Tony Lindgren
     [not found] <2o2IK-8gu-7@gated-at.bofh.it>
     [not found] ` <2oI5h-3A8-7@gated-at.bofh.it>
2004-08-02 12:49   ` Andi Kleen
2004-08-02 17:34     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox