Platform-driver-x86 archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	ilpo.jarvinen@linux.intel.com, andriy.shevchenko@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, Zhang Rui <rui.zhang@intel.com>
Subject: Re: [PATCH] platform/x86: ISST: Support SST-BF and SST-TF per level
Date: Wed, 1 May 2024 12:04:54 +0200	[thread overview]
Message-ID: <7940339d-e9a9-4367-9fce-1e5a201e7ab7@redhat.com> (raw)
In-Reply-To: <20240430221052.15825-1-srinivas.pandruvada@linux.intel.com>

Hi,

On 5/1/24 12:10 AM, Srinivas Pandruvada wrote:
> SST SST-BF and SST-TF can be enabled/disabled per SST-PP level. So return
> a mask of all levels, where the feature is supported, instead of just for
> level 0.
> 
> Since the return value returns all levels mask, not just level 0, update
> API version.
> 
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Reviewed-by: Zhang Rui <rui.zhang@intel.com>

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

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

> ---
>  .../intel/speed_select_if/isst_tpmi_core.c    | 38 +++++++++++++++----
>  1 file changed, 31 insertions(+), 7 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 6bcbb97b0101..7bac7841ff0a 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
> @@ -847,6 +847,8 @@ static int isst_if_get_perf_level(void __user *argp)
>  {
>  	struct isst_perf_level_info perf_level;
>  	struct tpmi_per_power_domain_info *power_domain_info;
> +	unsigned long level_mask;
> +	u8 level, support;
>  
>  	if (copy_from_user(&perf_level, argp, sizeof(perf_level)))
>  		return -EFAULT;
> @@ -866,12 +868,34 @@ static int isst_if_get_perf_level(void __user *argp)
>  		      SST_PP_FEATURE_STATE_START, SST_PP_FEATURE_STATE_WIDTH, SST_MUL_FACTOR_NONE)
>  	perf_level.enabled = !!(power_domain_info->sst_header.cap_mask & BIT(1));
>  
> -	_read_bf_level_info("bf_support", perf_level.sst_bf_support, 0, 0,
> -			    SST_BF_FEATURE_SUPPORTED_START, SST_BF_FEATURE_SUPPORTED_WIDTH,
> -			    SST_MUL_FACTOR_NONE);
> -	_read_tf_level_info("tf_support", perf_level.sst_tf_support, 0, 0,
> -			    SST_TF_FEATURE_SUPPORTED_START, SST_TF_FEATURE_SUPPORTED_WIDTH,
> -			    SST_MUL_FACTOR_NONE);
> +	level_mask = perf_level.level_mask;
> +	perf_level.sst_bf_support = 0;
> +	for_each_set_bit(level, &level_mask, BITS_PER_BYTE) {
> +		/*
> +		 * Read BF support for a level. Read output is updated
> +		 * to "support" variable by the below macro.
> +		 */
> +		_read_bf_level_info("bf_support", support, level, 0, SST_BF_FEATURE_SUPPORTED_START,
> +				    SST_BF_FEATURE_SUPPORTED_WIDTH, SST_MUL_FACTOR_NONE);
> +
> +		/* If supported set the bit for the level */
> +		if (support)
> +			perf_level.sst_bf_support |= BIT(level);
> +	}
> +
> +	perf_level.sst_tf_support = 0;
> +	for_each_set_bit(level, &level_mask, BITS_PER_BYTE) {
> +		/*
> +		 * Read TF support for a level. Read output is updated
> +		 * to "support" variable by the below macro.
> +		 */
> +		_read_tf_level_info("tf_support", support, level, 0, SST_TF_FEATURE_SUPPORTED_START,
> +				    SST_TF_FEATURE_SUPPORTED_WIDTH, SST_MUL_FACTOR_NONE);
> +
> +		/* If supported set the bit for the level */
> +		if (support)
> +			perf_level.sst_tf_support |= BIT(level);
> +	}
>  
>  	if (copy_to_user(argp, &perf_level, sizeof(perf_level)))
>  		return -EFAULT;
> @@ -1648,7 +1672,7 @@ void tpmi_sst_dev_resume(struct auxiliary_device *auxdev)
>  }
>  EXPORT_SYMBOL_NS_GPL(tpmi_sst_dev_resume, INTEL_TPMI_SST);
>  
> -#define ISST_TPMI_API_VERSION	0x02
> +#define ISST_TPMI_API_VERSION	0x03
>  
>  int tpmi_sst_init(void)
>  {


      reply	other threads:[~2024-05-01 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 22:10 [PATCH] platform/x86: ISST: Support SST-BF and SST-TF per level Srinivas Pandruvada
2024-05-01 10:04 ` Hans de Goede [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7940339d-e9a9-4367-9fce-1e5a201e7ab7@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).