Date: Wed, 6 Nov 2013 23:29:25 +0000 (UTC) From: Sean Bruno <sbruno@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257769 - head/sys/x86/cpufreq Message-ID: <201311062329.rA6NTPr4095174@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311062329.rA6NTPr4095174>