When I start the powerd daemon I get a lot of kernel messages: hwpstate0: set freq failed, err 6 The cpufreq works as I can seen in kernel messages with hwpmc.ko loaded: hwpstate0: going to fetch info from acpi_perf hwpstate0: <Cool`n'Quiet 2.0> on cpu0 hwpmc: TSC/1/64/0x20<REA> K8/4/48/0x1ff<INT,USR,SYS,EDG,THR,REA,WRI,INV,QUA> and I get the sysctl variables: dev.cpu.0.freq: 1400 dev.cpu.0.freq_levels: 3100/14210 2800/12250 2450/10718 2300/8677 2012/7592 1900/5431 1662/4752 1425/4073 1400/3558 1225/3113 1050/2668 875/2223 700/1779 525/1334 350/889 175/444 I also test to set "hint.acpi_throttle.0.disabled=1" in boot/loader.conf, but this only reduce the frequency dev.cpu.0.freq_levels: 3100/14210 2800/12250 2300/8677 1900/5431 1400/3558 that's exactly the same what dev.hwpstate.0.freq_settings: 3100/14210 2800/12250 2300/8677 1900/5431 1400/3558 have. But the error is still there. So I try "debug.hwpstate_verbose=1" and get now hwpstate0: setting P1-state on cpu0 hwpstate0: result P0-state on cpu0 hwpstate0: error: loop is not enough. hwpstate0: setting P1-state on cpu1 hwpstate0: result P1-state on cpu1 hwpstate0: setting P1-state on cpu2 hwpstate0: result P0-state on cpu2 hwpstate0: error: loop is not enough. hwpstate0: setting P1-state on cpu3 hwpstate0: result P1-state on cpu3 hwpstate0: setting P1-state on cpu4 hwpstate0: result P0-state on cpu4 hwpstate0: error: loop is not enough. hwpstate0: setting P1-state on cpu5 hwpstate0: result P1-state on cpu5 hwpstate0: setting P1-state on cpu6 hwpstate0: result P0-state on cpu6 hwpstate0: error: loop is not enough. hwpstate0: setting P1-state on cpu7 hwpstate0: result P1-state on cpu7 hwpstate0: set freq failed, err 6 and so on. Then I try to increase the loop in "src/sys/x86/cpufreq/hwpstate.c" without success. I don't have any Idee now to fix. May something is missing in the hwpmc code for the CPU or is this only a result from a buggy bios with incomplete acpi cpu code? Can anybody confirm that the powerd is working correctly with this CPU on an other Mainboard than the MSI 870A-G54 (FX)? How-To-Repeat: Start powerd with an AMD 8 Core FX 8120 CPU
The patch from Andriy Gapon and Yamagi discussed at freebsd-stabe http://lists.freebsd.org/pipermail/freebsd-stable/2012-May/067758.html fix the problem for me now.
Andriy's patch http://lists.freebsd.org/pipermail/freebsd-stable/2012-May/067758.html fixes the issue for me as well on a DELL R515 with two AMD Opteron(tm) 4386 processors, with in total 16 cores. Perhaps commit to head? Bengt
Responsible Changed From-To: freebsd-bugs->hiren Will talk to avg@ and get closure on this one.
this patch has been working to stop hwpstate0 errors on AMD A8-5500 4-core cpu. patch from list is being reposted here as attachment for easier download for applying.
Firstly, sorry for holding on to this PR for so long. I feel the patch is correct but I no longer have any AMD to test myself. If someone feels strongly, he/she can go ahead and commit this. I will put this back in the queue.
Responsible Changed From-To: hiren->freebsd-bugs
Author: sbruno Date: Wed Nov 6 23:29:25 2013 New Revision: 257769 URL: http://svnweb.freebsd.org/changeset/base/257769 Log: 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 Modified: head/sys/x86/cpufreq/hwpstate.c Modified: head/sys/x86/cpufreq/hwpstate.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate.c Wed Nov 6 22:36:36 2013 (r257768) +++ head/sys/x86/cpufreq/hwpstate.c Wed Nov 6 23:29:25 2013 (r257769) @@ -184,16 +184,21 @@ hwpstate_goto_pstate(device_t dev, int p 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) { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Patches from avg@ applied to resolve this P/R http://lists.freebsd.org/pipermail/freebsd-stable/2012-May/067758.html
sbruno@ mentioned via IRC he has already sent a merge request for this to re@, and as such doesn't require another PR to be opened [1] Thanks Sean! [1] http://lists.freebsd.org/pipermail/freebsd-stable/2013-December/076107.html
Author: sbruno Date: Thu Dec 5 17:57:51 2013 New Revision: 258994 URL: http://svnweb.freebsd.org/changeset/base/258994 Log: 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) Modified: stable/10/sys/x86/cpufreq/hwpstate.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/x86/cpufreq/hwpstate.c ============================================================================== --- stable/10/sys/x86/cpufreq/hwpstate.c Thu Dec 5 17:50:18 2013 (r258993) +++ stable/10/sys/x86/cpufreq/hwpstate.c Thu Dec 5 17:57:51 2013 (r258994) @@ -184,16 +184,21 @@ hwpstate_goto_pstate(device_t dev, int p 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) { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"