acpi: Create cppc_notify sysctl before it is checked

Reported by:	Henrix
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D37081
This commit is contained in:
Tom Jones 2022-10-23 10:09:28 +01:00
parent 35a33d14b5
commit 15bd2f366d

View file

@ -381,6 +381,14 @@ acpi_cpu_attach(device_t dev)
cpu_sysctl_tree = SYSCTL_ADD_NODE(&cpu_sysctl_ctx,
SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "cpu",
CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "node for CPU children");
#if defined(__i386__) || defined(__amd64__)
/* Add sysctl handler to control registering for CPPC notifications */
cppc_notify = 1;
SYSCTL_ADD_BOOL(&cpu_sysctl_ctx, SYSCTL_CHILDREN(cpu_sysctl_tree),
OID_AUTO, "cppc_notify", CTLFLAG_RDTUN | CTLFLAG_MPSAFE,
&cppc_notify, 0, "Register for CPPC Notifications");
#endif
}
/*
@ -987,14 +995,6 @@ acpi_cpu_startup(void *arg)
NULL, 0, acpi_cpu_global_cx_lowest_sysctl, "A",
"Global lowest Cx sleep state to use");
#if defined(__i386__) || defined(__amd64__)
/* Add sysctl handler to control registering for CPPC notifications */
cppc_notify = 1;
SYSCTL_ADD_BOOL(&cpu_sysctl_ctx, SYSCTL_CHILDREN(cpu_sysctl_tree),
OID_AUTO, "cppc_notify", CTLFLAG_RDTUN | CTLFLAG_MPSAFE,
&cppc_notify, 0, "Register for CPPC Notifications");
#endif
/* Take over idling from cpu_idle_default(). */
cpu_cx_lowest_lim = 0;
CPU_FOREACH(i) {