aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2013-01-20 05:24:29 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-02-01 18:01:15 -0500
commit4827ea6ec9ca1e873a6d387a3ee287f78ea5ee83 (patch)
treecca16992018a553c4bbcbf0a80776589af1ae655
parent9d95046e5d6afd6d7ae86fb71ab59c6faf0db8de (diff)
powernow-k8: Cleanup module request
Check whether we've actually already loaded acpi-cpufreq before requesting it. Signed-off-by: Borislav Petkov <bp@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/powernow-k8.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
index 056faf6af1a9..0234d0c6d68c 100644
--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -1249,6 +1249,24 @@ static struct cpufreq_driver cpufreq_amd64_driver = {
1249 .attr = powernow_k8_attr, 1249 .attr = powernow_k8_attr,
1250}; 1250};
1251 1251
1252static void __request_acpi_cpufreq(void)
1253{
1254 const char *cur_drv, *drv = "acpi-cpufreq";
1255
1256 cur_drv = cpufreq_get_current_driver();
1257 if (!cur_drv)
1258 goto request;
1259
1260 if (strncmp(cur_drv, drv, min_t(size_t, strlen(cur_drv), strlen(drv))))
1261 pr_warn(PFX "WTF driver: %s\n", cur_drv);
1262
1263 return;
1264
1265 request:
1266 pr_warn(PFX "This CPU is not supported anymore, using acpi-cpufreq instead.\n");
1267 request_module(drv);
1268}
1269
1252/* driver entry point for init */ 1270/* driver entry point for init */
1253static int __cpuinit powernowk8_init(void) 1271static int __cpuinit powernowk8_init(void)
1254{ 1272{
@@ -1256,8 +1274,7 @@ static int __cpuinit powernowk8_init(void)
1256 int rv; 1274 int rv;
1257 1275
1258 if (static_cpu_has(X86_FEATURE_HW_PSTATE)) { 1276 if (static_cpu_has(X86_FEATURE_HW_PSTATE)) {
1259 pr_warn(PFX "this CPU is not supported anymore, using acpi-cpufreq instead.\n"); 1277 __request_acpi_cpufreq();
1260 request_module("acpi-cpufreq");
1261 return -ENODEV; 1278 return -ENODEV;
1262 } 1279 }
1263 1280