Skip to content

Commit 7ec374c

Browse files
Shyam Sundar S Kij-intel
authored andcommitted
platform/x86/amd/pmf: Replace magic table id with METRICS_TABLE_ID
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> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://patch.msgid.link/20251120105210.3945710-4-Shyam-sundar.S-k@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent 83f0442 commit 7ec374c

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/platform/x86/amd/pmf/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static void amd_pmf_get_metrics(struct work_struct *work)
131131

132132
/* Transfer table contents */
133133
memset(dev->buf, 0, sizeof(dev->m_table));
134-
amd_pmf_send_cmd(dev, SET_TRANSFER_TABLE, SET_CMD, 7, NULL);
134+
amd_pmf_send_cmd(dev, SET_TRANSFER_TABLE, SET_CMD, METRICS_TABLE_ID, NULL);
135135
memcpy(&dev->m_table, dev->buf, sizeof(dev->m_table));
136136

137137
time_elapsed_ms = ktime_to_ms(ktime_get()) - dev->start_time;

drivers/platform/x86/amd/pmf/pmf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ struct cookie_header {
124124
#define SET_CMD false
125125
#define GET_CMD true
126126

127+
#define METRICS_TABLE_ID 7
128+
127129
typedef void (*apmf_event_handler_t)(acpi_handle handle, u32 event, void *data);
128130

129131
/* APTS PMF BIOS Interface */

drivers/platform/x86/amd/pmf/spc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ static void amd_pmf_get_smu_info(struct amd_pmf_dev *dev, struct ta_pmf_enact_ta
202202
{
203203
/* Get the updated metrics table data */
204204
memset(dev->buf, 0, dev->mtable_size);
205-
amd_pmf_send_cmd(dev, SET_TRANSFER_TABLE, SET_CMD, 7, NULL);
205+
amd_pmf_send_cmd(dev, SET_TRANSFER_TABLE, SET_CMD, METRICS_TABLE_ID, NULL);
206206

207207
switch (dev->cpu_id) {
208208
case AMD_CPU_ID_PS:

0 commit comments

Comments
 (0)