@@ -1033,7 +1033,7 @@ static int __init acpi_cpufreq_init(void)
return ret;
}
-static void __exit acpi_cpufreq_exit(void)
+void acpi_cpufreq_exit(void)
{
pr_debug("%s\n", __func__);
@@ -1043,6 +1043,12 @@ static void __exit acpi_cpufreq_exit(void)
free_acpi_perf_data();
}
+EXPORT_SYMBOL_GPL(acpi_cpufreq_exit);
+
+void __exit acpi_cpufreq_module_exit(void)
+{
+ acpi_cpufreq_exit();
+}
module_param(acpi_pstate_strict, uint, 0644);
MODULE_PARM_DESC(acpi_pstate_strict,
@@ -1050,7 +1056,7 @@ MODULE_PARM_DESC(acpi_pstate_strict,
"performed during frequency changes.");
late_initcall(acpi_cpufreq_init);
-module_exit(acpi_cpufreq_exit);
+module_exit(acpi_cpufreq_module_exit);
static const struct x86_cpu_id __maybe_unused acpi_cpufreq_ids[] = {
X86_MATCH_FEATURE(X86_FEATURE_ACPI, NULL),
@@ -273,6 +273,9 @@ static inline void cpufreq_stats_record_transition(struct cpufreq_policy *policy
unsigned int new_freq) { }
#endif /* CONFIG_CPU_FREQ_STAT */
+#if defined(CONFIG_X86_ACPI_CPUFREQ) || defined(CONFIG_X86_ACPI_CPUFREQ_MODULE)
+void acpi_cpufreq_exit(void);
+#endif
/*********************************************************************
* CPUFREQ DRIVER INTERFACE *
*********************************************************************/
Currently, the only way to load an alternative cpufreq driver is to unload acpi-cpufreq first. Loosen that restriction to allow other kernel modules to unregister a registered driver. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> --- v2->v3: * Move to include header * Create a new symbol to prevent NX protected page fault calling exit function from other modules. v1->v2: * Export symbol instead of changing internals drivers/cpufreq/acpi-cpufreq.c | 10 ++++++++-- include/linux/cpufreq.h | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-)