Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154431882
D55002.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D55002.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
@@ -316,7 +316,7 @@
}
static void
-sysctl_epp_select_per_core(device_t hwp_device, uint32_t val)
+set_epp(device_t hwp_device, u_int val)
{
struct hwpstate_softc *sc;
@@ -331,15 +331,15 @@
}
static int
-sysctl_epp_select(SYSCTL_HANDLER_ARGS)
+sysctl_epp_handler(SYSCTL_HANDLER_ARGS)
{
device_t dev, hwp_dev;
devclass_t dc;
struct hwpstate_softc *sc;
- const uint32_t max_energy_perf =
+ const u_int max_epp =
BITS_VALUE(AMD_CPPC_REQUEST_EPP_BITS, (uint64_t)-1);
- uint32_t val;
- int ret = 0;
+ u_int val;
+ int error = 0;
int cpu;
dev = oidp->oid_arg1;
@@ -349,29 +349,27 @@
check_cppc_enabled(sc, __func__);
val = BITS_VALUE(AMD_CPPC_REQUEST_EPP_BITS, sc->req) * 100 /
- max_energy_perf;
- ret = sysctl_handle_int(oidp, &val, 0, req);
- if (ret != 0 || req->newptr == NULL)
+ max_epp;
+ error = sysctl_handle_int(oidp, &val, 0, req);
+ if (error != 0 || req->newptr == NULL)
goto end;
if (val > 100) {
- ret = EINVAL;
+ error = EINVAL;
goto end;
}
- val = (val * max_energy_perf) / 100;
+ val = (val * max_epp) / 100;
if (hwpstate_pkg_ctrl_enable) {
dc = devclass_find(HWP_AMD_CLASSNAME);
- KASSERT(dc != NULL,
- (HWP_AMD_CLASSNAME ": devclass cannot be null"));
CPU_FOREACH(cpu) {
hwp_dev = devclass_get_device(dc, cpu);
- sysctl_epp_select_per_core(hwp_dev, val);
+ set_epp(hwp_dev, val);
}
} else
- sysctl_epp_select_per_core(dev, val);
+ set_epp(dev, val);
end:
- return (ret);
+ return (error);
}
static driver_t hwpstate_driver = {
@@ -786,8 +784,8 @@
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
- "epp", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, dev, 0,
- sysctl_epp_select, "I",
+ "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)");
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 29, 12:36 PM (6 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28457349
Default Alt Text
D55002.diff (2 KB)
Attached To
Mode
D55002: hwpstate_amd(4): Rename EPP handler, convert to unsigned int
Attached
Detach File
Event Timeline
Log In to Comment