diff mbox

powerpc/pseries: energy driver only print message when LPAR guest

Message ID 20170720115900.455-1-npiggin@gmail.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Nicholas Piggin July 20, 2017, 11:59 a.m. UTC
This driver currently reports the H_BEST_ENERGY is unsupported even
when booting in a non-LPAR environment (e.g., powernv). Prevent it.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/platforms/pseries/pseries_energy.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Ellerman July 20, 2017, 1:03 p.m. UTC | #1
Nicholas Piggin <npiggin@gmail.com> writes:

> This driver currently reports the H_BEST_ENERGY is unsupported even
> when booting in a non-LPAR environment (e.g., powernv). Prevent it.

Just delete the printk(). Users don't know what that means, and
developers have other better ways to detect that the hcall is missing if
anyone cares.

cheers
diff mbox

Patch

diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c b/arch/powerpc/platforms/pseries/pseries_energy.c
index 164a13d3998a..832b3d7898a3 100644
--- a/arch/powerpc/platforms/pseries/pseries_energy.c
+++ b/arch/powerpc/platforms/pseries/pseries_energy.c
@@ -229,6 +229,9 @@  static int __init pseries_energy_init(void)
 	int cpu, err;
 	struct device *cpu_dev;
 
+	if (!firmware_has_feature(FW_FEATURE_LPAR))
+		return 0;
+
 	if (!firmware_has_feature(FW_FEATURE_BEST_ENERGY)) {
 		printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n");
 		return 0;