All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/power/x86/intel-speed-select: Display error on turbo mode disabled
@ 2022-05-10  2:34 Srinivas Pandruvada
  2022-05-11 15:53 ` Hans de Goede
  2022-05-11 15:56 ` Hans de Goede
  0 siblings, 2 replies; 4+ messages in thread
From: Srinivas Pandruvada @ 2022-05-10  2:34 UTC (permalink / raw)
  To: hdegoede, markgross
  Cc: platform-driver-x86, linux-kernel, Srinivas Pandruvada

For Intel SST turbo-freq feature to be enabled, the turbo mode on the
platform must be enabled also. If turbo mode is disabled, display error
while enabling turbo-freq feature.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
Since this is a trivial patch, I am not sending a PULL request.

 tools/power/x86/intel-speed-select/isst-config.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index 060390e88e37..9d35614995ee 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -1892,6 +1892,12 @@ static void set_fact_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
 	int ret;
 	int status = *(int *)arg4;
 
+	if (status && no_turbo()) {
+		isst_display_error_info_message(1, "Turbo mode is disabled", 0, 0);
+		ret = -1;
+		goto disp_results;
+	}
+
 	ret = isst_get_ctdp_levels(cpu, &pkg_dev);
 	if (ret) {
 		isst_display_error_info_message(1, "Failed to get number of levels", 0, 0);
-- 
2.35.1


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

* Re: [PATCH] tools/power/x86/intel-speed-select: Display error on turbo mode disabled
  2022-05-10  2:34 [PATCH] tools/power/x86/intel-speed-select: Display error on turbo mode disabled Srinivas Pandruvada
@ 2022-05-11 15:53 ` Hans de Goede
  2022-05-11 15:56 ` Hans de Goede
  1 sibling, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2022-05-11 15:53 UTC (permalink / raw)
  To: Srinivas Pandruvada, markgross; +Cc: platform-driver-x86, linux-kernel

Hi,

On 5/10/22 04:34, Srinivas Pandruvada wrote:
> For Intel SST turbo-freq feature to be enabled, the turbo mode on the
> platform must be enabled also. If turbo mode is disabled, display error
> while enabling turbo-freq feature.
> 
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
> Since this is a trivial patch, I am not sending a PULL request.

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans


> 
>  tools/power/x86/intel-speed-select/isst-config.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
> index 060390e88e37..9d35614995ee 100644
> --- a/tools/power/x86/intel-speed-select/isst-config.c
> +++ b/tools/power/x86/intel-speed-select/isst-config.c
> @@ -1892,6 +1892,12 @@ static void set_fact_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
>  	int ret;
>  	int status = *(int *)arg4;
>  
> +	if (status && no_turbo()) {
> +		isst_display_error_info_message(1, "Turbo mode is disabled", 0, 0);
> +		ret = -1;
> +		goto disp_results;
> +	}
> +
>  	ret = isst_get_ctdp_levels(cpu, &pkg_dev);
>  	if (ret) {
>  		isst_display_error_info_message(1, "Failed to get number of levels", 0, 0);


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

* Re: [PATCH] tools/power/x86/intel-speed-select: Display error on turbo mode disabled
  2022-05-10  2:34 [PATCH] tools/power/x86/intel-speed-select: Display error on turbo mode disabled Srinivas Pandruvada
  2022-05-11 15:53 ` Hans de Goede
@ 2022-05-11 15:56 ` Hans de Goede
  2022-05-11 16:04   ` srinivas pandruvada
  1 sibling, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2022-05-11 15:56 UTC (permalink / raw)
  To: Srinivas Pandruvada, markgross; +Cc: platform-driver-x86, linux-kernel

Hi,

On 5/10/22 04:34, Srinivas Pandruvada wrote:
> For Intel SST turbo-freq feature to be enabled, the turbo mode on the
> platform must be enabled also. If turbo mode is disabled, display error
> while enabling turbo-freq feature.
> 
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
> Since this is a trivial patch, I am not sending a PULL request.

Note not related to this patch, but when test building intel-speed-select
I got the following compiler warning:

  CC      hfi-events.o
In function ‘process_hfi_event’,
    inlined from ‘handle_event’ at hfi-events.c:220:5:
hfi-events.c:184:9: warning: ‘perf_cap.cpu’ may be used uninitialized [-Wmaybe-uninitialized]
  184 |         process_level_change(perf_cap->cpu);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hfi-events.c: In function ‘handle_event’:
hfi-events.c:193:25: note: ‘perf_cap.cpu’ was declared here
  193 |         struct perf_cap perf_cap;
      |                         ^~~~~~~~


Regards,

Hans



> 
>  tools/power/x86/intel-speed-select/isst-config.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
> index 060390e88e37..9d35614995ee 100644
> --- a/tools/power/x86/intel-speed-select/isst-config.c
> +++ b/tools/power/x86/intel-speed-select/isst-config.c
> @@ -1892,6 +1892,12 @@ static void set_fact_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
>  	int ret;
>  	int status = *(int *)arg4;
>  
> +	if (status && no_turbo()) {
> +		isst_display_error_info_message(1, "Turbo mode is disabled", 0, 0);
> +		ret = -1;
> +		goto disp_results;
> +	}
> +
>  	ret = isst_get_ctdp_levels(cpu, &pkg_dev);
>  	if (ret) {
>  		isst_display_error_info_message(1, "Failed to get number of levels", 0, 0);


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

* Re: [PATCH] tools/power/x86/intel-speed-select: Display error on turbo mode disabled
  2022-05-11 15:56 ` Hans de Goede
@ 2022-05-11 16:04   ` srinivas pandruvada
  0 siblings, 0 replies; 4+ messages in thread
From: srinivas pandruvada @ 2022-05-11 16:04 UTC (permalink / raw)
  To: Hans de Goede, markgross; +Cc: platform-driver-x86, linux-kernel

Hi Hans,

On Wed, 2022-05-11 at 17:56 +0200, Hans de Goede wrote:
> Hi,
> 
> On 5/10/22 04:34, Srinivas Pandruvada wrote:
> > For Intel SST turbo-freq feature to be enabled, the turbo mode on
> > the
> > platform must be enabled also. If turbo mode is disabled, display
> > error
> > while enabling turbo-freq feature.
> > 
> > Signed-off-by: Srinivas Pandruvada
> > <srinivas.pandruvada@linux.intel.com>
> > ---
> > Since this is a trivial patch, I am not sending a PULL request.
> 
> Note not related to this patch, but when test building intel-speed-
> select
> I got the following compiler warning:
> 
>   CC      hfi-events.o
> In function ‘process_hfi_event’,
>     inlined from ‘handle_event’ at hfi-events.c:220:5:
> hfi-events.c:184:9: warning: ‘perf_cap.cpu’ may be used uninitialized
> [-Wmaybe-uninitialized]
>   184 |         process_level_change(perf_cap->cpu);
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> hfi-events.c: In function ‘handle_event’:
> hfi-events.c:193:25: note: ‘perf_cap.cpu’ was declared here
>   193 |         struct perf_cap perf_cap;
>       |                         ^~~~~~~~
> 
> 
Let me send a patch to fix. In reality this will not happen as HFI
message will always have a CPU.

Thanks,
Srinivas


> Regards,
> 
> Hans
> 
> 
> 
> > 
> >  tools/power/x86/intel-speed-select/isst-config.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/tools/power/x86/intel-speed-select/isst-config.c
> > b/tools/power/x86/intel-speed-select/isst-config.c
> > index 060390e88e37..9d35614995ee 100644
> > --- a/tools/power/x86/intel-speed-select/isst-config.c
> > +++ b/tools/power/x86/intel-speed-select/isst-config.c
> > @@ -1892,6 +1892,12 @@ static void set_fact_for_cpu(int cpu, void
> > *arg1, void *arg2, void *arg3,
> >         int ret;
> >         int status = *(int *)arg4;
> >  
> > +       if (status && no_turbo()) {
> > +               isst_display_error_info_message(1, "Turbo mode is
> > disabled", 0, 0);
> > +               ret = -1;
> > +               goto disp_results;
> > +       }
> > +
> >         ret = isst_get_ctdp_levels(cpu, &pkg_dev);
> >         if (ret) {
> >                 isst_display_error_info_message(1, "Failed to get
> > number of levels", 0, 0);
> 


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

end of thread, other threads:[~2022-05-11 16:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10  2:34 [PATCH] tools/power/x86/intel-speed-select: Display error on turbo mode disabled Srinivas Pandruvada
2022-05-11 15:53 ` Hans de Goede
2022-05-11 15:56 ` Hans de Goede
2022-05-11 16:04   ` srinivas pandruvada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.