diff options
author | sbruno <sbruno@FreeBSD.org> | 2013-11-06 23:29:25 +0000 |
---|---|---|
committer | sbruno <sbruno@FreeBSD.org> | 2013-11-06 23:29:25 +0000 |
commit | dce4ab5a66b1758e0feba883d333ebe40ca796c0 (patch) | |
tree | 80a7bc38e2105d04a58c7eb09fb1d7e8091593cc | |
parent | da8821dbf4e7c491fa0bb307b55caa5affd04e6c (diff) | |
download | FreeBSD-src-dce4ab5a66b1758e0feba883d333ebe40ca796c0.zip FreeBSD-src-dce4ab5a66b1758e0feba883d333ebe40ca796c0.tar.gz |
Fix powerd/states on AMD cpus. Resolves issues with system reporting:
hwpstate0: set freq failed, err 6
Tested on FX-8150 and others.
PR: 167018
Submitted by: avg
MFC after: 2 weeks
-rw-r--r-- | sys/x86/cpufreq/hwpstate.c | 9 |
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) { |