Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F158597453
D55009.id.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
D55009.id.diff
View Options
diff --git a/sys/x86/cpufreq/hwpstate_amd.c b/sys/x86/cpufreq/hwpstate_amd.c
--- a/sys/x86/cpufreq/hwpstate_amd.c
+++ b/sys/x86/cpufreq/hwpstate_amd.c
@@ -428,30 +428,25 @@
{
const u_int max_epp =
BITS_VALUE(AMD_CPPC_REQUEST_EPP_BITS, (uint64_t)-1);
- const device_t dev = oidp->oid_arg1;
+ const device_t dev = arg1;
struct hwpstate_softc *const sc = device_get_softc(dev);
u_int val;
- int error = 0;
+ int error;
/* Sysctl knob does not exist if PSTATE_CPPC is not set. */
check_cppc_enabled(sc, __func__);
- val = BITS_VALUE(AMD_CPPC_REQUEST_EPP_BITS, sc->cppc.request) * 100 /
- max_epp;
+ val = BITS_VALUE(AMD_CPPC_REQUEST_EPP_BITS, sc->cppc.request);
+
error = sysctl_handle_int(oidp, &val, 0, req);
if (error != 0 || req->newptr == NULL)
- goto end;
- if (val > 100) {
- error = EINVAL;
- goto end;
- }
- val = (val * max_epp) / 100;
+ return (error);
+ if (val > max_epp)
+ return (EINVAL);
error = set_cppc_request(dev,
BITS_WITH_VALUE(AMD_CPPC_REQUEST_EPP_BITS, val),
BITS_WITH_VALUE(AMD_CPPC_REQUEST_EPP_BITS, -1));
-
-end:
return (error);
}
@@ -924,7 +919,7 @@
"epp", CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, dev, 0,
sysctl_epp_handler, "IU",
"Efficiency/Performance Preference "
- "(range from 0, most performant, through 100, most efficient)");
+ "(range from 0, most performant, through 255, most efficient)");
}
return (cpufreq_register(dev));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jun 4, 7:42 PM (17 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33729248
Default Alt Text
D55009.id.diff (1 KB)
Attached To
Mode
D55009: hwpstate_amd(4): 'epp' sysctl leaf to operate on real EPP hardware values
Attached
Detach File
Event Timeline
Log In to Comment