Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110687928
D7587.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7587.diff
View Options
Index: head/sys/x86/cpufreq/hwpstate.c
===================================================================
--- head/sys/x86/cpufreq/hwpstate.c
+++ head/sys/x86/cpufreq/hwpstate.c
@@ -408,25 +408,27 @@
hwpstate_set = sc->hwpstate_settings;
for (i = 0; i < sc->cfnum; i++) {
msr = rdmsr(MSR_AMD_10H_11H_CONFIG + i);
- if ((msr & ((uint64_t)1 << 63)) != ((uint64_t)1 << 63)) {
+ if ((msr & ((uint64_t)1 << 63)) == 0) {
HWPSTATE_DEBUG(dev, "msr is not valid.\n");
return (ENXIO);
}
did = AMD_10H_11H_CUR_DID(msr);
fid = AMD_10H_11H_CUR_FID(msr);
+
+ /* Convert fid/did to frequency. */
switch(family) {
case 0x11:
- /* fid/did to frequency */
- hwpstate_set[i].freq = 100 * (fid + 0x08) / (1 << did);
+ hwpstate_set[i].freq = (100 * (fid + 0x08)) >> did;
break;
case 0x10:
- /* fid/did to frequency */
- hwpstate_set[i].freq = 100 * (fid + 0x10) / (1 << did);
+ case 0x12:
+ case 0x15:
+ case 0x16:
+ hwpstate_set[i].freq = (100 * (fid + 0x10)) >> did;
break;
default:
- HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family %d CPU's are not implemented yet. sorry.\n", family);
+ HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family 0x%02x CPU's are not implemented yet. sorry.\n", family);
return (ENXIO);
- break;
}
hwpstate_set[i].pstate_id = i;
/* There was volts calculation, but deleted it. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 22, 10:13 PM (5 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16781410
Default Alt Text
D7587.diff (1 KB)
Attached To
Mode
D7587: Bug 212020 - Add powerd(8) support for newer AMD CPUs
Attached
Detach File
Event Timeline
Log In to Comment