From: Mario Limonciello mario.limonciello@amd.com
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 Yijun.Shen@dell.com Fixes: 7c45534afa443 ("platform/x86/amd/pmf: Add support for PMF Policy Binary") Cc: stable@vger.kernel.org Signed-off-by: Mario Limonciello mario.limonciello@amd.com --- drivers/platform/x86/amd/pmf/tee-if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/amd/pmf/tee-if.c b/drivers/platform/x86/amd/pmf/tee-if.c index 5d513161d7302..9a51258df0564 100644 --- 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, 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; }
Internal Use - Confidential
-----Original Message----- From: Mario Limonciello superm1@kernel.org Sent: Thursday, April 3, 2025 11:11 AM To: mario.limonciello@amd.com; Shyam-sundar.S-k@amd.com; hdegoede@redhat.com; ilpo.jarvinen@linux.intel.com Cc: Shen, Yijun Yijun_Shen@Dell.com; stable@vger.kernel.org; platform- driver-x86@vger.kernel.org Subject: [PATCH] platform/x86: amd: pmf: Fix STT limits
[EXTERNAL EMAIL]
From: Mario Limonciello mario.limonciello@amd.com
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 Yijun.Shen@dell.com Fixes: 7c45534afa443 ("platform/x86/amd/pmf: Add support for PMF Policy Binary") Cc: stable@vger.kernel.org Signed-off-by: Mario Limonciello mario.limonciello@amd.com
Verified the patch on the issued system, the issue is gone.
Tested-By: Yijun Shen Yijun_Shen@Dell.com
drivers/platform/x86/amd/pmf/tee-if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/amd/pmf/tee-if.c b/drivers/platform/x86/amd/pmf/tee-if.c index 5d513161d7302..9a51258df0564 100644 --- 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, 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; } -- 2.43.0
On 4/3/2025 08:41, Mario Limonciello wrote:
From: Mario Limonciello mario.limonciello@amd.com
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 Yijun.Shen@dell.com Fixes: 7c45534afa443 ("platform/x86/amd/pmf: Add support for PMF Policy Binary") Cc: stable@vger.kernel.org Signed-off-by: Mario Limonciello mario.limonciello@amd.com
drivers/platform/x86/amd/pmf/tee-if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/amd/pmf/tee-if.c b/drivers/platform/x86/amd/pmf/tee-if.c index 5d513161d7302..9a51258df0564 100644 --- 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, 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; }
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
linux-stable-mirror@lists.linaro.org