Commit 4827ea6e authored by Borislav Petkov's avatar Borislav Petkov Committed by Rafael J. Wysocki

powernow-k8: Cleanup module request

Check whether we've actually already loaded acpi-cpufreq before
requesting it.
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 9d95046e
...@@ -1249,6 +1249,24 @@ static struct cpufreq_driver cpufreq_amd64_driver = { ...@@ -1249,6 +1249,24 @@ static struct cpufreq_driver cpufreq_amd64_driver = {
.attr = powernow_k8_attr, .attr = powernow_k8_attr,
}; };
static void __request_acpi_cpufreq(void)
{
const char *cur_drv, *drv = "acpi-cpufreq";
cur_drv = cpufreq_get_current_driver();
if (!cur_drv)
goto request;
if (strncmp(cur_drv, drv, min_t(size_t, strlen(cur_drv), strlen(drv))))
pr_warn(PFX "WTF driver: %s\n", cur_drv);
return;
request:
pr_warn(PFX "This CPU is not supported anymore, using acpi-cpufreq instead.\n");
request_module(drv);
}
/* driver entry point for init */ /* driver entry point for init */
static int __cpuinit powernowk8_init(void) static int __cpuinit powernowk8_init(void)
{ {
...@@ -1256,8 +1274,7 @@ static int __cpuinit powernowk8_init(void) ...@@ -1256,8 +1274,7 @@ static int __cpuinit powernowk8_init(void)
int rv; int rv;
if (static_cpu_has(X86_FEATURE_HW_PSTATE)) { if (static_cpu_has(X86_FEATURE_HW_PSTATE)) {
pr_warn(PFX "this CPU is not supported anymore, using acpi-cpufreq instead.\n"); __request_acpi_cpufreq();
request_module("acpi-cpufreq");
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment