public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	platform-driver-x86@vger.kernel.org,
	 LKML <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH] platform/x86: ISST: Correct command storage data length
Date: Tue, 1 Apr 2025 14:35:01 +0300 (EEST)	[thread overview]
Message-ID: <4049a875-fb64-c84d-c092-daa11fcc9a6c@linux.intel.com> (raw)
In-Reply-To: <20250328224749.2691272-1-srinivas.pandruvada@linux.intel.com>

On Fri, 28 Mar 2025, Srinivas Pandruvada wrote:

> After resume/online turbo limit ratio (TRL) is restored partially if
> the admin explicitly changed TRL from user space.
> 
> A hash table is used to store SST mail box and MSR settings when modified
> to restore those settings after resume or online. This uses a struct
> isst_cmd field "data" to store these settings. This is a 64 bit field.
> But isst_store_new_cmd() is only assigning as u32. This results in
> truncation of 32 bits.
> 
> Change the argument to u64 from u32.
> 
> Fixes: f607874f35cb ("platform/x86: ISST: Restore state on resume")
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: stable@vger.kernel.org

Thanks, I've applied this to the review-ilpo-fixes branch.

While reviewing this, I noticed full_cmd is currently typed as int but I 
think it should be u32 to match the type in the struct.

The construction of full_cmd also open codes FIELD_PREP() and doesn't use 
named defines for the fields. And ->cmd is also decomposed in 
isst_mbox_resume_command() which should use FIELD_GET() and the same 
defines.

> ---
>  drivers/platform/x86/intel/speed_select_if/isst_if_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c
> index dbcd3087aaa4..31239a93dd71 100644
> --- a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c
> +++ b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c
> @@ -84,7 +84,7 @@ static DECLARE_HASHTABLE(isst_hash, 8);
>  static DEFINE_MUTEX(isst_hash_lock);
>  
>  static int isst_store_new_cmd(int cmd, u32 cpu, int mbox_cmd_type, u32 param,
> -			      u32 data)
> +			      u64 data)
>  {
>  	struct isst_cmd *sst_cmd;

-- 
 i.


      reply	other threads:[~2025-04-01 11:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-28 22:47 [PATCH] platform/x86: ISST: Correct command storage data length Srinivas Pandruvada
2025-04-01 11:35 ` Ilpo Järvinen [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=4049a875-fb64-c84d-c092-daa11fcc9a6c@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=stable@vger.kernel.org \
    /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