X86 platform drivers
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Cc: Hans de Goede <hansg@kernel.org>,
	platform-driver-x86@vger.kernel.org,  Patil.Reddy@amd.com,
	mario.limonciello@amd.com, lizhi.hou@amd.com
Subject: Re: [PATCH v2 3/5] platform/x86/amd/pmf: replace magic table id with METRICS_TABLE_ID
Date: Tue, 18 Nov 2025 17:44:06 +0200 (EET)	[thread overview]
Message-ID: <bb865b1a-0c88-0b5a-e282-377d17095cab@linux.intel.com> (raw)
In-Reply-To: <20251111063737.4156385-4-Shyam-sundar.S-k@amd.com>

[-- Attachment #1: Type: text/plain, Size: 2572 bytes --]

On Tue, 11 Nov 2025, Shyam Sundar S K wrote:

> Add METRICS_TABLE_ID (7) and use it when requesting the metrics
> transfer table instead of the hard-coded literal. This clarifies the
> meaning of the argument to amd_pmf_send_cmd() and centralizes the table
> ID definition for easier maintenance.
> 
> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
> ---
>  drivers/platform/x86/amd/pmf/core.c | 2 +-
>  drivers/platform/x86/amd/pmf/pmf.h  | 1 +
>  drivers/platform/x86/amd/pmf/spc.c  | 2 +-
>  3 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/amd/pmf/core.c b/drivers/platform/x86/amd/pmf/core.c
> index a659cedc4533..a6a5d416edf9 100644
> --- a/drivers/platform/x86/amd/pmf/core.c
> +++ b/drivers/platform/x86/amd/pmf/core.c
> @@ -131,7 +131,7 @@ static void amd_pmf_get_metrics(struct work_struct *work)
>  
>  	/* Transfer table contents */
>  	memset(dev->buf, 0, sizeof(dev->m_table));
> -	amd_pmf_send_cmd(dev, SET_TRANSFER_TABLE, SET_CMD, 7, NULL);
> +	amd_pmf_send_cmd(dev, SET_TRANSFER_TABLE, SET_CMD, METRICS_TABLE_ID, NULL);
>  	memcpy(&dev->m_table, dev->buf, sizeof(dev->m_table));
>  
>  	time_elapsed_ms = ktime_to_ms(ktime_get()) - dev->start_time;
> diff --git a/drivers/platform/x86/amd/pmf/pmf.h b/drivers/platform/x86/amd/pmf/pmf.h
> index 19e413bd89bc..561919b9f671 100644
> --- a/drivers/platform/x86/amd/pmf/pmf.h
> +++ b/drivers/platform/x86/amd/pmf/pmf.h
> @@ -122,6 +122,7 @@ struct cookie_header {
>  
>  #define SET_CMD		0
>  #define GET_CMD		1
> +#define METRICS_TABLE_ID	7
>  
>  typedef void (*apmf_event_handler_t)(acpi_handle handle, u32 event, void *data);
>  
> diff --git a/drivers/platform/x86/amd/pmf/spc.c b/drivers/platform/x86/amd/pmf/spc.c
> index b10229def18a..0a37dc6a7950 100644
> --- a/drivers/platform/x86/amd/pmf/spc.c
> +++ b/drivers/platform/x86/amd/pmf/spc.c
> @@ -202,7 +202,7 @@ static void amd_pmf_get_smu_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_ta
>  {
>  	/* Get the updated metrics table data */
>  	memset(dev->buf, 0, dev->mtable_size);
> -	amd_pmf_send_cmd(dev, SET_TRANSFER_TABLE, SET_CMD, 7, NULL);
> +	amd_pmf_send_cmd(dev, SET_TRANSFER_TABLE, SET_CMD, METRICS_TABLE_ID, NULL);
>  
>  	switch (dev->cpu_id) {
>  	case AMD_CPU_ID_PS:
> 

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>


-- 
 i.

  reply	other threads:[~2025-11-18 15:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11  6:37 [PATCH v2 0/5] PMF NPU metrics cleanup, command flag cleanup, and amdxdna integration Shyam Sundar S K
2025-11-11  6:37 ` [PATCH v2 1/5] platform/x86/amd/pmf: Rename IPU metrics fields to NPU for consistency Shyam Sundar S K
2025-11-18 15:36   ` Ilpo Järvinen
2025-11-11  6:37 ` [PATCH v2 2/5] platform/x86/amd/pmf: Use explicit SET_CMD/GET_CMD flags in amd_pmf_send_cmd() Shyam Sundar S K
2025-11-18 15:41   ` Ilpo Järvinen
2025-11-18 17:03     ` Shyam Sundar S K
2025-11-18 17:08       ` Ilpo Järvinen
2025-11-11  6:37 ` [PATCH v2 3/5] platform/x86/amd/pmf: replace magic table id with METRICS_TABLE_ID Shyam Sundar S K
2025-11-18 15:44   ` Ilpo Järvinen [this message]
2025-11-11  6:37 ` [PATCH v2 4/5] platform/x86/amd/pmf: Introduce new interface to export NPU metrics Shyam Sundar S K
2025-11-18 15:54   ` Ilpo Järvinen
2025-11-11  6:37 ` [PATCH v2 5/5] accel/amdxdna: Provide real-time NPU power estimate via AMD PMF Shyam Sundar S K
2025-11-12 18:03   ` Mario Limonciello
2025-11-13  7:33     ` Shyam Sundar S K
2025-11-14 16:56       ` Mario Limonciello
2025-11-18 15:59         ` Ilpo Järvinen
2025-11-18 16:01           ` Ilpo Järvinen
2025-11-18 16:46             ` Shyam Sundar S K
2025-11-19 12:44               ` Ilpo Järvinen
2025-11-20 10:55                 ` Shyam Sundar S K
2025-11-12 17:21 ` [PATCH v2 0/5] PMF NPU metrics cleanup, command flag cleanup, and amdxdna integration Mario Limonciello
2025-11-13  7:37   ` Shyam Sundar S K

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=bb865b1a-0c88-0b5a-e282-377d17095cab@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=Patil.Reddy@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=hansg@kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=mario.limonciello@amd.com \
    --cc=platform-driver-x86@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