Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2060958 authored by Andre Przywara's avatar Andre Przywara Committed by Rafael J. Wysocki
Browse files

powernow-k8: delay info messages until initialization has succeeded



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: default avatarAndre Przywara <andre.przywara@amd.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent 034be8fd
Loading
Loading
Loading
Loading
+14 −10
Original line number Original line Diff line number Diff line
@@ -1576,9 +1576,6 @@ static int __cpuinit powernowk8_init(void)
	if (supported_cpus != num_online_cpus())
	if (supported_cpus != num_online_cpus())
		return -ENODEV;
		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)) {
	if (boot_cpu_has(X86_FEATURE_CPB)) {


		cpb_capable = true;
		cpb_capable = true;
@@ -1597,16 +1594,23 @@ static int __cpuinit powernowk8_init(void)
			struct msr *reg = per_cpu_ptr(msrs, cpu);
			struct msr *reg = per_cpu_ptr(msrs, cpu);
			cpb_enabled |= !(!!(reg->l & BIT(25)));
			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);
	rv = cpufreq_register_driver(&cpufreq_amd64_driver);
	if (rv < 0 && boot_cpu_has(X86_FEATURE_CPB)) {

	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);
			unregister_cpu_notifier(&cpb_nb);
			msrs_free(msrs);
			msrs_free(msrs);
			msrs = NULL;
			msrs = NULL;
		} else
			pr_info(PFX "Core Performance Boosting: %s.\n",
				(cpb_enabled ? "on" : "off"));
	}
	}
	return rv;
	return rv;
}
}