Skip to contentSkip to conversation

MSI K8N Neo + powernow-k8: ACPI info is worse than BIOS PST

DISCUSSION Randall Nortman 2 participants 4 messages Jul 31, 2004 – Aug 2, 2004

lore
Share & tools
lore
#0 lore raw

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!)

#1 lore raw
Quoted 7 lines · Randall Nortman

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

#2 lore raw
Quoted 9 lines · Tony Lindgren
Quoted 7 lines · Randall Nortman

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.

Quoted 3 lines

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

#3 lore raw
Quoted 15 lines · Randall Nortman
Quoted 9 lines · Tony Lindgren
Quoted 7 lines · Randall Nortman

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.

Quoted 3 lines

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.

Quoted 14 lines

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 :)

Quoted 5 lines

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