public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems
@ 2024-02-29  0:26 Srinivas Pandruvada
  2024-02-29 12:32 ` Ilpo Järvinen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Srinivas Pandruvada @ 2024-02-29  0:26 UTC (permalink / raw)
  To: hdegoede, markgross, ilpo.jarvinen, andriy.shevchenko
  Cc: platform-driver-x86, linux-kernel, Srinivas Pandruvada

When HWP (Hardware P-states) is disabled, dynamic SST features are
disabled. But user should still be able to read the current core-power
state, with legacy P-states. This will allow users to read current
configuration with static SST enabled from BIOS.

To address this, do not call disable_dynamic_sst_features() when the
request is for reading the state.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
index 2662fbbddf0c..1d918000d72b 100644
--- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
+++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
@@ -462,10 +462,10 @@ static long isst_if_core_power_state(void __user *argp)
 	struct tpmi_per_power_domain_info *power_domain_info;
 	struct isst_core_power core_power;
 
-	if (disable_dynamic_sst_features())
+	if (copy_from_user(&core_power, argp, sizeof(core_power)))
 		return -EFAULT;
 
-	if (copy_from_user(&core_power, argp, sizeof(core_power)))
+	if (core_power.get_set && disable_dynamic_sst_features())
 		return -EFAULT;
 
 	power_domain_info = get_instance(core_power.socket_id, core_power.power_domain_id);
-- 
2.40.1


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

* Re: [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems
  2024-02-29  0:26 [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems Srinivas Pandruvada
@ 2024-02-29 12:32 ` Ilpo Järvinen
  2024-02-29 15:11   ` srinivas pandruvada
  2024-02-29 21:18 ` Kuppuswamy Sathyanarayanan
  2024-03-04 13:17 ` Ilpo Järvinen
  2 siblings, 1 reply; 5+ messages in thread
From: Ilpo Järvinen @ 2024-02-29 12:32 UTC (permalink / raw)
  To: Srinivas Pandruvada
  Cc: Hans de Goede, markgross, Andy Shevchenko, platform-driver-x86,
	LKML

On Wed, 28 Feb 2024, Srinivas Pandruvada wrote:

> When HWP (Hardware P-states) is disabled, dynamic SST features are
> disabled. But user should still be able to read the current core-power
> state, with legacy P-states. This will allow users to read current
> configuration with static SST enabled from BIOS.
> 
> To address this, do not call disable_dynamic_sst_features() when the
> request is for reading the state.
> 
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Is this a fix? (It's lacking the tag if it is).

-- 
 i.

> ---
>  drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> index 2662fbbddf0c..1d918000d72b 100644
> --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> @@ -462,10 +462,10 @@ static long isst_if_core_power_state(void __user *argp)
>  	struct tpmi_per_power_domain_info *power_domain_info;
>  	struct isst_core_power core_power;
>  
> -	if (disable_dynamic_sst_features())
> +	if (copy_from_user(&core_power, argp, sizeof(core_power)))
>  		return -EFAULT;
>  
> -	if (copy_from_user(&core_power, argp, sizeof(core_power)))
> +	if (core_power.get_set && disable_dynamic_sst_features())
>  		return -EFAULT;
>  
>  	power_domain_info = get_instance(core_power.socket_id, core_power.power_domain_id);
> 


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

* Re: [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems
  2024-02-29 12:32 ` Ilpo Järvinen
@ 2024-02-29 15:11   ` srinivas pandruvada
  0 siblings, 0 replies; 5+ messages in thread
From: srinivas pandruvada @ 2024-02-29 15:11 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: Hans de Goede, markgross, Andy Shevchenko, platform-driver-x86,
	LKML

On Thu, 2024-02-29 at 14:32 +0200, Ilpo Järvinen wrote:
> On Wed, 28 Feb 2024, Srinivas Pandruvada wrote:
> 
> > When HWP (Hardware P-states) is disabled, dynamic SST features are
> > disabled. But user should still be able to read the current core-
> > power
> > state, with legacy P-states. This will allow users to read current
> > configuration with static SST enabled from BIOS.
> > 
> > To address this, do not call disable_dynamic_sst_features() when
> > the
> > request is for reading the state.
> > 
> > Signed-off-by: Srinivas Pandruvada
> > <srinivas.pandruvada@linux.intel.com>
> 
> Is this a fix? (It's lacking the tag if it is).
This is not a fix. This is a feature request from a customer.
Some customer wants to use in certain way.

Thanks,
Srinivas

> 


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

* Re: [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems
  2024-02-29  0:26 [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems Srinivas Pandruvada
  2024-02-29 12:32 ` Ilpo Järvinen
@ 2024-02-29 21:18 ` Kuppuswamy Sathyanarayanan
  2024-03-04 13:17 ` Ilpo Järvinen
  2 siblings, 0 replies; 5+ messages in thread
From: Kuppuswamy Sathyanarayanan @ 2024-02-29 21:18 UTC (permalink / raw)
  To: Srinivas Pandruvada, hdegoede, markgross, ilpo.jarvinen,
	andriy.shevchenko
  Cc: platform-driver-x86, linux-kernel


On 2/28/24 4:26 PM, Srinivas Pandruvada wrote:
> When HWP (Hardware P-states) is disabled, dynamic SST features are
> disabled. But user should still be able to read the current core-power
> state, with legacy P-states. This will allow users to read current
> configuration with static SST enabled from BIOS.
>
> To address this, do not call disable_dynamic_sst_features() when the
> request is for reading the state.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---

Looks good to me.

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

>  drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> index 2662fbbddf0c..1d918000d72b 100644
> --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> @@ -462,10 +462,10 @@ static long isst_if_core_power_state(void __user *argp)
>  	struct tpmi_per_power_domain_info *power_domain_info;
>  	struct isst_core_power core_power;
>  
> -	if (disable_dynamic_sst_features())
> +	if (copy_from_user(&core_power, argp, sizeof(core_power)))
>  		return -EFAULT;
>  
> -	if (copy_from_user(&core_power, argp, sizeof(core_power)))
> +	if (core_power.get_set && disable_dynamic_sst_features())
>  		return -EFAULT;
>  
>  	power_domain_info = get_instance(core_power.socket_id, core_power.power_domain_id);

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


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

* Re: [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems
  2024-02-29  0:26 [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems Srinivas Pandruvada
  2024-02-29 12:32 ` Ilpo Järvinen
  2024-02-29 21:18 ` Kuppuswamy Sathyanarayanan
@ 2024-03-04 13:17 ` Ilpo Järvinen
  2 siblings, 0 replies; 5+ messages in thread
From: Ilpo Järvinen @ 2024-03-04 13:17 UTC (permalink / raw)
  To: hdegoede, markgross, andriy.shevchenko, Srinivas Pandruvada
  Cc: platform-driver-x86, linux-kernel

On Wed, 28 Feb 2024 16:26:59 -0800, Srinivas Pandruvada wrote:

> When HWP (Hardware P-states) is disabled, dynamic SST features are
> disabled. But user should still be able to read the current core-power
> state, with legacy P-states. This will allow users to read current
> configuration with static SST enabled from BIOS.
> 
> To address this, do not call disable_dynamic_sst_features() when the
> request is for reading the state.
> 
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo branch. Note it will show up in the public
platform-drivers-x86/review-ilpo branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: ISST: Allow reading core-power state on HWP disabled systems
      commit: 959e640cf7b2d456052b346fa50574242ca56aaa

--
 i.


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

end of thread, other threads:[~2024-03-04 13:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-29  0:26 [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems Srinivas Pandruvada
2024-02-29 12:32 ` Ilpo Järvinen
2024-02-29 15:11   ` srinivas pandruvada
2024-02-29 21:18 ` Kuppuswamy Sathyanarayanan
2024-03-04 13:17 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox