Skip to content

Commit fc39660

Browse files
committed
platform/x86/amd/pmf: Preserve custom BIOS inputs for evaluating the policies
JIRA: https://issues.redhat.com/browse/RHEL-73301 commit b21ec88 Author: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Date: Mon Sep 1 16:31:38 2025 +0530 platform/x86/amd/pmf: Preserve custom BIOS inputs for evaluating the policies The current code fails to send multiple BIOS input data to the PMF-TA for policy condition evaluation. Only the most recent BIOS input data is properly sent to the PMF-TA, while previous inputs are overwritten with the zeros. To address this issue, the BIOS input data should be stored and passed on to the PMF-TA. Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Tested-by: Yijun Shen <Yijun.Shen@Dell.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20250901110140.2519072-8-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Steve Best <sbest@redhat.com>
1 parent 1f68682 commit fc39660

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,10 @@ enum power_modes_v2 {
354354
POWER_MODE_V2_MAX,
355355
};
356356

357+
struct pmf_bios_inputs_prev {
358+
u32 custom_bios_inputs[10];
359+
};
360+
357361
struct amd_pmf_dev {
358362
void __iomem *regbase;
359363
void __iomem *smu_virt_addr;
@@ -400,6 +404,7 @@ struct amd_pmf_dev {
400404
struct mutex cb_mutex;
401405
u32 notifications;
402406
struct apmf_sbios_req_v1 req1;
407+
struct pmf_bios_inputs_prev cb_prev; /* To preserve custom BIOS inputs */
403408
};
404409

405410
struct apmf_sps_prop_granular_v2 {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,18 @@ static void amd_pmf_update_bios_inputs(struct amd_pmf_dev *pdev, u32 pending_req
142142
if (!(pending_req & inputs[i].bit_mask))
143143
continue;
144144
amd_pmf_set_ta_custom_bios_input(in, i, custom_policy[i]);
145+
pdev->cb_prev.custom_bios_inputs[i] = custom_policy[i];
145146
}
146147
}
147148

148149
static void amd_pmf_get_custom_bios_inputs(struct amd_pmf_dev *pdev,
149150
struct ta_pmf_enact_table *in)
150151
{
152+
unsigned int i;
153+
154+
for (i = 0; i < ARRAY_SIZE(custom_bios_inputs); i++)
155+
amd_pmf_set_ta_custom_bios_input(in, i, pdev->cb_prev.custom_bios_inputs[i]);
156+
151157
if (!(pdev->req.pending_req || pdev->req1.pending_req))
152158
return;
153159

0 commit comments

Comments
 (0)