linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/pseries: energy driver only print message when LPAR guest
@ 2017-07-20 11:59 Nicholas Piggin
  2017-07-20 13:03 ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Nicholas Piggin @ 2017-07-20 11:59 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nicholas Piggin

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(+)

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;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc/pseries: energy driver only print message when LPAR guest
  2017-07-20 11:59 [PATCH] powerpc/pseries: energy driver only print message when LPAR guest Nicholas Piggin
@ 2017-07-20 13:03 ` Michael Ellerman
  2017-07-21  1:16   ` Nicholas Piggin
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2017-07-20 13:03 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc/pseries: energy driver only print message when LPAR guest
  2017-07-20 13:03 ` Michael Ellerman
@ 2017-07-21  1:16   ` Nicholas Piggin
  2017-07-21  4:35     ` Vaidyanathan Srinivasan
  2017-08-11 12:19     ` Michael Ellerman
  0 siblings, 2 replies; 7+ messages in thread
From: Nicholas Piggin @ 2017-07-21  1:16 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Vaidyanathan Srinivasan

On Thu, 20 Jul 2017 23:03:21 +1000
Michael Ellerman <mpe@ellerman.id.au> wrote:

> 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

powerpc/pseries: energy driver do not print failure message

This driver currently reports the H_BEST_ENERGY is unsupported (even
when booting in a non-LPAR environment). This is not something the
administrator can do much with, and not significant for debugging.

Remove it.

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

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 */
+
 	/* Create the sysfs files */
 	err = device_create_file(cpu_subsys.dev_root,
 				&attr_cpu_activate_hint_list);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc/pseries: energy driver only print message when LPAR guest
  2017-07-21  1:16   ` Nicholas Piggin
@ 2017-07-21  4:35     ` Vaidyanathan Srinivasan
  2017-07-21  6:33       ` Michael Ellerman
  2017-08-11 12:19     ` Michael Ellerman
  1 sibling, 1 reply; 7+ messages in thread
From: Vaidyanathan Srinivasan @ 2017-07-21  4:35 UTC (permalink / raw)
  To: Nicholas Piggin; +Cc: Michael Ellerman, linuxppc-dev

* Nicholas Piggin <npiggin@gmail.com> [2017-07-21 11:16:44]:

> On Thu, 20 Jul 2017 23:03:21 +1000
> Michael Ellerman <mpe@ellerman.id.au> wrote:
> 
> > 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
> 
> powerpc/pseries: energy driver do not print failure message
> 
> This driver currently reports the H_BEST_ENERGY is unsupported (even
> when booting in a non-LPAR environment). This is not something the
> administrator can do much with, and not significant for debugging.
> 
> Remove it.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>


> ---
>  arch/powerpc/platforms/pseries/pseries_energy.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> 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. Hence I take
mpe's suggestion.  Removing the print is fine.

--Vaidy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc/pseries: energy driver only print message when LPAR guest
  2017-07-21  4:35     ` Vaidyanathan Srinivasan
@ 2017-07-21  6:33       ` Michael Ellerman
  2017-07-21  8:02         ` Vaidyanathan Srinivasan
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2017-07-21  6:33 UTC (permalink / raw)
  To: svaidy, Nicholas Piggin; +Cc: linuxppc-dev

Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> writes:
> * Nicholas Piggin <npiggin@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@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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] powerpc/pseries: energy driver only print message when LPAR guest
  2017-07-21  6:33       ` Michael Ellerman
@ 2017-07-21  8:02         ` Vaidyanathan Srinivasan
  0 siblings, 0 replies; 7+ messages in thread
From: Vaidyanathan Srinivasan @ 2017-07-21  8:02 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Nicholas Piggin, linuxppc-dev

* Michael Ellerman <mpe@ellerman.id.au> [2017-07-21 16:33:07]:

> Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> writes:
> > * Nicholas Piggin <npiggin@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@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().

oops... I meant that FW_FEATURE_BEST_ENERGY is not found in KVM and we
will see the print needlessly.

If we have a check for phyp LPAR, then we can enable the print
"H_BEST_ENERGY hcall not supported"

Since the FW_FEATURE_LPAR is common for all PAPR guest (both pHyp and
KVM), I agree that deleting the print is the right thing to do since
we see it on both powernv and KVM where it is not supported and there
is no point reporting it.

--Vaidy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: powerpc/pseries: energy driver only print message when LPAR guest
  2017-07-21  1:16   ` Nicholas Piggin
  2017-07-21  4:35     ` Vaidyanathan Srinivasan
@ 2017-08-11 12:19     ` Michael Ellerman
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2017-08-11 12:19 UTC (permalink / raw)
  To: Nicholas Piggin; +Cc: linuxppc-dev

On Fri, 2017-07-21 at 01:16:44 UTC, Nicholas Piggin wrote:
> On Thu, 20 Jul 2017 23:03:21 +1000
> Michael Ellerman <mpe@ellerman.id.au> wrote:
> 
> > 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
> 
> powerpc/pseries: energy driver do not print failure message
> 
> This driver currently reports the H_BEST_ENERGY is unsupported (even
> when booting in a non-LPAR environment). This is not something the
> administrator can do much with, and not significant for debugging.
> 
> Remove it.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/a70a0b9f4404d8edb72ca0e0272731

cheers

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-08-11 12:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-20 11:59 [PATCH] powerpc/pseries: energy driver only print message when LPAR guest Nicholas Piggin
2017-07-20 13:03 ` Michael Ellerman
2017-07-21  1:16   ` Nicholas Piggin
2017-07-21  4:35     ` Vaidyanathan Srinivasan
2017-07-21  6:33       ` Michael Ellerman
2017-07-21  8:02         ` Vaidyanathan Srinivasan
2017-08-11 12:19     ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).