[Midnightbsd-cvs] src [6576] trunk/sys/x86/cpufreq/hwpstate.c: fix powerd on newer AMD CPUs such as the 8150.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Dec 29 15:41:55 EST 2013
Revision: 6576
http://svnweb.midnightbsd.org/src/?rev=6576
Author: laffer1
Date: 2013-12-29 15:41:54 -0500 (Sun, 29 Dec 2013)
Log Message:
-----------
fix powerd on newer AMD CPUs such as the 8150.
Modified Paths:
--------------
trunk/sys/x86/cpufreq/hwpstate.c
Modified: trunk/sys/x86/cpufreq/hwpstate.c
===================================================================
--- trunk/sys/x86/cpufreq/hwpstate.c 2013-12-29 20:31:14 UTC (rev 6575)
+++ trunk/sys/x86/cpufreq/hwpstate.c 2013-12-29 20:41:54 UTC (rev 6576)
@@ -184,8 +184,15 @@
id, PCPU_GET(cpuid));
/* Go To Px-state */
wrmsr(MSR_AMD_10H_11H_CONTROL, id);
+ }
+ CPU_FOREACH(i) {
+ /* Bind to each cpu. */
+ thread_lock(curthread);
+ sched_bind(curthread, i);
+ thread_unlock(curthread);
/* wait loop (100*100 usec is enough ?) */
for(j = 0; j < 100; j++){
+ /* get the result. not assure msr=id */
msr = rdmsr(MSR_AMD_10H_11H_STATUS);
if(msr == id){
break;
@@ -192,8 +199,6 @@
}
DELAY(100);
}
- /* get the result. not assure msr=id */
- msr = rdmsr(MSR_AMD_10H_11H_STATUS);
HWPSTATE_DEBUG(dev, "result P%d-state on cpu%d\n",
(int)msr, PCPU_GET(cpuid));
if (msr != id) {
More information about the Midnightbsd-cvs
mailing list