[Public] This is because currently only Vangogh has Fast PPT limit. The limit for that is not the same as default one. It will be higher than the max_power_limit. Since this is Vangogh-only, it's left to the implementation to handle that check.
Thanks, Lijo -----Original Message----- From: Limonciello, Mario <[email protected]> Sent: Wednesday, October 1, 2025 10:44 PM To: Limonciello, Mario <[email protected]>; [email protected] Cc: Lazar, Lijo <[email protected]> Subject: [PATCH] drm/amd: Drop superfluous call to set_power_limit() smu_set_power_limit() will call set_power_limit() if the limit type isn't default ppt, but after a bound check will call set_power_limit() regardless. The first callpath is not necessary, remove it and do the bounds check for all calls. Cc: Lijo Lazar <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index ac99bb7e2e7b..431333060b72 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -2939,10 +2939,6 @@ static int smu_set_power_limit(void *handle, uint32_t limit) return -EOPNOTSUPP; limit &= (1<<24)-1; - if (limit_type != SMU_DEFAULT_PPT_LIMIT) - if (smu->ppt_funcs->set_power_limit) - return smu->ppt_funcs->set_power_limit(smu, limit_type, limit); - if ((limit > smu->max_power_limit) || (limit < smu->min_power_limit)) { dev_err(smu->adev->dev, "New power limit (%d) is out of range [%d,%d]\n", -- 2.51.0
