From owner-freebsd-bugs@freebsd.org Sat Aug 19 06:42:44 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22990DD4F62 for ; Sat, 19 Aug 2017 06:42:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 111416851C for ; Sat, 19 Aug 2017 06:42:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v7J6gh20024278 for ; Sat, 19 Aug 2017 06:42:43 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 221621] Ryzen Threadripper - hwpstate0 - repeated set frequency failed err 6 Date: Sat, 19 Aug 2017 06:42:43 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: cem@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: cem@freebsd.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2017 06:42:44 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D221621 Conrad Meyer changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|freebsd-bugs@FreeBSD.org |cem@freebsd.org --- Comment #3 from Conrad Meyer --- 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.=