]> nv-tegra.nvidia Code Review - linux-3.10.git/commitdiff
powernow-k8: delay info messages until initialization has succeeded
authorAndre Przywara <andre.przywara@amd.com>
Tue, 4 Sep 2012 08:28:05 +0000 (08:28 +0000)
committerRafael J. Wysocki <rjw@sisk.pl>
Sun, 9 Sep 2012 20:04:53 +0000 (22:04 +0200)
powernow-k8 is quite prematurely crying Hooray and outputs diagnostic
messages, although the actual initialization can still fail.
Since now we may have acpi-cpufreq already loaded, we move the
messages at the end of the init routine to avoid confusing output
if the loading of powernow-k8 should not succeed.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
drivers/cpufreq/powernow-k8.c

index e2defb822bb1d149f52d4cfbfbf05536dc86ef7c..f1035a920b0ae4964d12686b4ce2198b926b751f 100644 (file)
@@ -1576,9 +1576,6 @@ static int __cpuinit powernowk8_init(void)
        if (supported_cpus != num_online_cpus())
                return -ENODEV;
 
-       printk(KERN_INFO PFX "Found %d %s (%d cpu cores) (" VERSION ")\n",
-               num_online_nodes(), boot_cpu_data.x86_model_id, supported_cpus);
-
        if (boot_cpu_has(X86_FEATURE_CPB)) {
 
                cpb_capable = true;
@@ -1597,16 +1594,23 @@ static int __cpuinit powernowk8_init(void)
                        struct msr *reg = per_cpu_ptr(msrs, cpu);
                        cpb_enabled |= !(!!(reg->l & BIT(25)));
                }
-
-               printk(KERN_INFO PFX "Core Performance Boosting: %s.\n",
-                       (cpb_enabled ? "on" : "off"));
        }
 
        rv = cpufreq_register_driver(&cpufreq_amd64_driver);
-       if (rv < 0 && boot_cpu_has(X86_FEATURE_CPB)) {
-               unregister_cpu_notifier(&cpb_nb);
-               msrs_free(msrs);
-               msrs = NULL;
+
+       if (!rv)
+               pr_info(PFX "Found %d %s (%d cpu cores) (" VERSION ")\n",
+                       num_online_nodes(), boot_cpu_data.x86_model_id,
+                       supported_cpus);
+
+       if (boot_cpu_has(X86_FEATURE_CPB)) {
+               if (rv < 0) {
+                       unregister_cpu_notifier(&cpb_nb);
+                       msrs_free(msrs);
+                       msrs = NULL;
+               } else
+                       pr_info(PFX "Core Performance Boosting: %s.\n",
+                               (cpb_enabled ? "on" : "off"));
        }
        return rv;
 }