Date: Sat, 19 Aug 2017 06:42:43 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 221621] Ryzen Threadripper - hwpstate0 - repeated set frequency failed err 6 Message-ID: <bug-221621-8-tP6K34hGHQ@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-221621-8@https.bugs.freebsd.org/bugzilla/> References: <bug-221621-8@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221621 Conrad Meyer <cem@freebsd.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|freebsd-bugs@FreeBSD.org |cem@freebsd.org --- Comment #3 from Conrad Meyer <cem@freebsd.org> --- Please try the following patch: --- a/sys/x86/cpufreq/hwpstate.c +++ b/sys/x86/cpufreq/hwpstate.c @@ -83,6 +83,10 @@ __FBSDID("$FreeBSD$"); #define AMD_10H_11H_CUR_DID(msr) (((msr) >> 6) & 0x0= 7) #define AMD_10H_11H_CUR_FID(msr) ((msr) & 0x3F) +#define AMD_17H_CUR_VID(msr) (((msr) >> 14) & 0x= FF) +#define AMD_17H_CUR_DID(msr) (((msr) >> 8) & 0x3= F) +#define AMD_17H_CUR_FID(msr) ((msr) & 0xFF) + #define HWPSTATE_DEBUG(dev, msg...) \ do{ \ if(hwpstate_verbose) \ @@ -427,6 +431,15 @@ hwpstate_get_info_from_msr(device_t dev) case 0x16: hwpstate_set[i].freq =3D (100 * (fid + 0x10)) >> di= d; break; + case 0x17: + did =3D AMD_17H_CUR_DID(msr); + if (did =3D=3D 0) { + HWPSTATE_DEBUG(dev, "unexpected did: 0\n"); + did =3D 1; + } + fid =3D AMD_17H_CUR_FID(msr); + hwpstate_set[i].freq =3D (200 * fid) / did; + break; default: HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family" " 0x%02x CPUs are not supported yet\n", family); It is based on the Family 17h Reference manual and compiles, but obviously = I am unable to test it. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-221621-8-tP6K34hGHQ>