platform/x86: amd: pmf: Fix STT limits
Subsystems (3)
PATCH 1/1 platform/x86: amd: pmf: Fix STT limits
From: Mario Limonciello <[email protected]>
On some platforms it has been observed that STT limits are not being applied properly causing poor performance as power limits are set too low.
STT limits that are sent to the platform are supposed to be in Q8.8 format. Convert them before sending.
--- drivers/platform/x86/amd/pmf/tee-if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/amd/pmf/tee-if.c +2 -2
@@ -123,7 +123,7 @@ static void amd_pmf_apply_policies(struct amd_pmf_dev *dev, struct ta_pmf_enact_case PMF_POLICY_STT_SKINTEMP_APU :if (dev->prev_data->stt_skintemp_apu != val) { -amd_pmf_send_cmd (dev,SET_STT_LIMIT_APU , false, val,NULL ); +amd_pmf_send_cmd (dev,SET_STT_LIMIT_APU , false, val <<8 ,NULL );dev_dbg (dev->dev,"update STT_SKINTEMP_APU: %u\n" , val); dev->prev_data->stt_skintemp_apu = val; }
@@ -131,7 +131,7 @@ static void amd_pmf_apply_policies(struct amd_pmf_dev *dev, struct ta_pmf_enact_case PMF_POLICY_STT_SKINTEMP_HS2 :if (dev->prev_data->stt_skintemp_hs2 != val) { -amd_pmf_send_cmd (dev,SET_STT_LIMIT_HS2 , false, val,NULL ); +amd_pmf_send_cmd (dev,SET_STT_LIMIT_HS2 , false, val <<8 ,NULL );dev_dbg (dev->dev,"update STT_SKINTEMP_HS2: %u\n" , val); dev->prev_data->stt_skintemp_hs2 = val; }
Signature · 1 line
2.43.0
Internal Use - Confidential
Quoted 17 lines
-----Original Message-----
From: Mario Limonciello <[email protected]>
Sent: Thursday, April 3, 2025 11:11 AM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Shen, Yijun <[email protected]>; [email protected]; platform- [email protected]
Subject: [PATCH] platform/x86: amd: pmf: Fix STT limits[EXTERNAL EMAIL]
From: Mario Limonciello <[email protected]>
On some platforms it has been observed that STT limits are not being applied properly causing poor performance as power limits are set too low.
Quoted 8 lines
STT limits that are sent to the platform are supposed to be in Q8.8 format. Convert them before sending.
Reported-by Yijun Shen <[email protected]>Fixes 7c45534afa443 ("platform/x86/amd/pmf: Add support for PMF PolicyBinary")
Signed-off-by Mario Limonciello <[email protected]>
Verified the patch on the issued system, the issue is gone.
Quoted 37 lines
--- drivers/platform/x86/amd/pmf/tee-if.c | 4 +-+--- 1 file changed, 2 insertions(+-), 2 deletions(-)drivers/platform/x86/amd/pmf/tee-if.c +1
-1--- a/drivers/platform/x86/amd/pmf/tee-if.c +-+-+- b/drivers/platform/x86/amd/pmf/tee-if.c@@ -123,7 +-123,7 @@ static void amd_pmf_apply_policies(struct
amd_pmf_dev*dev, structta_pmf_enact_case PMF_POLICY_STT_SKINTEMP_APU: if (dev->prev_data->stt_skintemp_apu != val) { - amd_pmf_send_cmd(dev, SET_STT_LIMIT_APU, false, val, NULL); +- amd_pmf_send_cmd(dev, SET_STT_LIMIT_APU, false, val << 8, NULL); dev_dbg(dev->dev, "update STT_SKINTEMP_APU: %u\n", val); dev->prev_data->stt_skintemp_apu = val; }@@ -131,7 +-131,7 @@ static void amd_pmf_apply_policies(struct
amd_pmf_dev*dev, structta_pmf_enact_case PMF_POLICY_STT_SKINTEMP_HS2: if (dev->prev_data->stt_skintemp_hs2 != val) { - amd_pmf_send_cmd(dev, SET_STT_LIMIT_HS2, false, val, NULL); +- amd_pmf_send_cmd(dev, SET_STT_LIMIT_HS2, false, val << 8, NULL); dev_dbg(dev->dev, "update STT_SKINTEMP_HS2: %u\n", val); dev->prev_data->stt_skintemp_hs2 = val; }--
2.43.0
Shyam Sundar S K
maintainerQuoted 30 lines · Mario Limonciello
From: Mario Limonciello <[email protected]>
On some platforms it has been observed that STT limits are not being applied properly causing poor performance as power limits are set too low.
STT limits that are sent to the platform are supposed to be in Q8.8 format. Convert them before sending.
Reported-by Yijun Shen <[email protected]>Fixes 7c45534afa443 ("platform/x86/amd/pmf: Add support for PMF Policy Binary")Signed-off-by Mario Limonciello <[email protected]>--- drivers/platform/x86/amd/pmf/tee-if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/platform/x86/amd/pmf/tee-if.c +1
-1@@ -123,7 +123,7 @@ static void amd_pmf_apply_policies(struct amd_pmf_dev *dev, struct ta_pmf_enact_case PMF_POLICY_STT_SKINTEMP_APU :if (dev->prev_data->stt_skintemp_apu != val) { -amd_pmf_send_cmd (dev,SET_STT_LIMIT_APU , false, val,NULL ); +amd_pmf_send_cmd (dev,SET_STT_LIMIT_APU , false, val <<8 ,NULL );dev_dbg (dev->dev,"update STT_SKINTEMP_APU: %u\n" , val); dev->prev_data->stt_skintemp_apu = val; }
drivers/platform/x86/amd/pmf/tee-if.c static void amd_pmf_apply_policies(struct amd_pmf_dev *dev, struct ta_pmf_enact_ · line 137
Quoted 8 lines
drivers/platform/x86/amd/pmf/tee-if.c +1
-1@@ -131,7 +131,7 @@ static void amd_pmf_apply_policies(struct amd_pmf_dev *dev, struct ta_pmf_enact_case PMF_POLICY_STT_SKINTEMP_HS2 :if (dev->prev_data->stt_skintemp_hs2 != val) { -amd_pmf_send_cmd (dev,SET_STT_LIMIT_HS2 , false, val,NULL ); +amd_pmf_send_cmd (dev,SET_STT_LIMIT_HS2 , false, val <<8 ,NULL );dev_dbg (dev->dev,"update STT_SKINTEMP_HS2: %u\n" , val); dev->prev_data->stt_skintemp_hs2 = val; }
Thanks! can you please amend this across all other places like:amd_pmf_set_automode(), amd_pmf_set_cnqf(), amd_pmf_update_slider_v2(), amd_pmf_update_slider()
Thanks,
Shyam