Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Shyam Sundar S K and committed by
Ilpo Järvinen
b21ec883 04199ef4

+11
+5
drivers/platform/x86/amd/pmf/pmf.h
··· 354 354 POWER_MODE_V2_MAX, 355 355 }; 356 356 357 + struct pmf_bios_inputs_prev { 358 + u32 custom_bios_inputs[10]; 359 + }; 360 + 357 361 struct amd_pmf_dev { 358 362 void __iomem *regbase; 359 363 void __iomem *smu_virt_addr; ··· 404 400 struct mutex cb_mutex; 405 401 u32 notifications; 406 402 struct apmf_sbios_req_v1 req1; 403 + struct pmf_bios_inputs_prev cb_prev; /* To preserve custom BIOS inputs */ 407 404 }; 408 405 409 406 struct apmf_sps_prop_granular_v2 {
+6
drivers/platform/x86/amd/pmf/spc.c
··· 142 142 if (!(pending_req & inputs[i].bit_mask)) 143 143 continue; 144 144 amd_pmf_set_ta_custom_bios_input(in, i, custom_policy[i]); 145 + pdev->cb_prev.custom_bios_inputs[i] = custom_policy[i]; 145 146 } 146 147 } 147 148 148 149 static void amd_pmf_get_custom_bios_inputs(struct amd_pmf_dev *pdev, 149 150 struct ta_pmf_enact_table *in) 150 151 { 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 + 151 157 if (!(pdev->req.pending_req || pdev->req1.pending_req)) 152 158 return; 153 159