summaryrefslogtreecommitdiffstats
path: root/sys/x86
diff options
context:
space:
mode:
authorsbruno <sbruno@FreeBSD.org>2013-12-05 17:57:51 +0000
committersbruno <sbruno@FreeBSD.org>2013-12-05 17:57:51 +0000
commit07f179266d161f0883f10fc89f19e9830e7f6ca3 (patch)
tree17f978d40749d4753d4b78d2535c75f9979ba2cd /sys/x86
parentd3ef2c77471b3537f24e68e982161b3d767da853 (diff)
downloadFreeBSD-src-07f179266d161f0883f10fc89f19e9830e7f6ca3.zip
FreeBSD-src-07f179266d161f0883f10fc89f19e9830e7f6ca3.tar.gz
MFC r257769 to stable/10
Fix powerd/states on AMD cpus. Resolves issues with system reporting: hwpstate0: set freq failed, err 6 Tested on FX-8150 and others. PR: kern/167018 Submitted by: avg@ Approved by: re (gjb)
Diffstat (limited to 'sys/x86')
-rw-r--r--sys/x86/cpufreq/hwpstate.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/x86/cpufreq/hwpstate.c b/sys/x86/cpufreq/hwpstate.c
index 27279265..e86e31a 100644
--- a/sys/x86/cpufreq/hwpstate.c
+++ b/sys/x86/cpufreq/hwpstate.c
@@ -184,16 +184,21 @@ hwpstate_goto_pstate(device_t dev, int pstate)
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;
}
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) {
OpenPOWER on IntegriCloud