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

Michael Ellerman mpe at ellerman.id.au
Fri Jul 21 16:33:07 AEST 2017


Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com> writes:
> * Nicholas Piggin <npiggin at gmail.com> [2017-07-21 11:16:44]:
>> diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c b/arch/powerpc/platforms/pseries/pseries_energy.c
>> index 164a13d3998a..35c891aabef0 100644
>> --- a/arch/powerpc/platforms/pseries/pseries_energy.c
>> +++ b/arch/powerpc/platforms/pseries/pseries_energy.c
>> @@ -229,10 +229,9 @@ static int __init pseries_energy_init(void)
>>  	int cpu, err;
>>  	struct device *cpu_dev;
>> 
>> -	if (!firmware_has_feature(FW_FEATURE_BEST_ENERGY)) {
>> -		printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n");
>> -		return 0;
>> -	}
>> +	if (!firmware_has_feature(FW_FEATURE_BEST_ENERGY))
>> +		return 0; /* H_BEST_ENERGY hcall not supported */
>> +
>
> The first patch (!firmware_has_feature(FW_FEATURE_LPAR)) would be
> ideal, but we do not have this in KVM guest case also.

Yeah we do.

It should really be called FW_FEATURE_RUNNING_UNDER_PAPR_HYPERVISOR.

static int __init probe_fw_features(unsigned long node, const char *uname, int
				    depth, void *data)
{
	....
	if (!strcmp(uname, "rtas") || !strcmp(uname, "rtas at 0")) {
		prop = of_get_flat_dt_prop(node, "ibm,hypertas-functions", &len);
		if (prop) {
			powerpc_firmware_features |= FW_FEATURE_LPAR;


Qemu initialises that property unconditionally in spapr_dt_rtas().

cheers


More information about the Linuxppc-dev mailing list