[AMD Official Use Only - AMD Internal Distribution Only] Please ignore this patch. Thanks.
Best Regards, Kevin -----Original Message----- From: amd-gfx <[email protected]> On Behalf Of Yang Wang Sent: Friday, October 10, 2025 7:49 PM To: [email protected] Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]> Subject: [PATCH] drm/amdgpu: re-enable power1_cap* hwmon nodes for gfx 11.0.3 vf mode get power limitation information from pptable instead of sending PPSMC_MSG_GetPptLimit to pmfw on gfx 11.0.3 vf mode. Fixes: 21129c51c616 ("drm/amd/amdgpu: disable hwmon power1_cap* for gfx 11.0.3 on vf mode") Signed-off-by: Yang Wang <[email protected]> --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 3 +-- .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c index b5fbb0fd1dc0..4622dbf1cb91 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -3721,8 +3721,7 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, attr == &sensor_dev_attr_power1_cap_default.dev_attr.attr) { if (adev->family == AMDGPU_FAMILY_SI || ((adev->flags & AMD_IS_APU) && gc_ver != IP_VERSION(10, 3, 1) && - (gc_ver != IP_VERSION(9, 4, 3) && gc_ver != IP_VERSION(9, 4, 4))) || - (amdgpu_sriov_vf(adev) && gc_ver == IP_VERSION(11, 0, 3))) + (gc_ver != IP_VERSION(9, 4, 3) && gc_ver != IP_VERSION(9, 4, +4)))) return 0; } diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c index 657dfdf76829..decb10ec0b0f 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c @@ -448,9 +448,6 @@ static int smu_v13_0_0_setup_pptable(struct smu_context *smu) struct amdgpu_device *adev = smu->adev; int ret = 0; - if (amdgpu_sriov_vf(smu->adev)) - return 0; - ret = smu_v13_0_0_get_pptable_from_pmfw(smu, &smu_table->power_play_table, &smu_table->power_play_table_size); @@ -461,6 +458,9 @@ static int smu_v13_0_0_setup_pptable(struct smu_context *smu) if (ret) return ret; + if (amdgpu_sriov_vf(smu->adev)) + return 0; + /* * With SCPM enabled, the operation below will be handled * by PSP. Driver involvment is unnecessary and useless. @@ -2464,7 +2464,10 @@ static int smu_v13_0_0_get_power_limit(struct smu_context *smu, uint32_t power_limit, od_percent_upper = 0, od_percent_lower = 0; uint32_t msg_limit = skutable->MsgLimits.Power[PPT_THROTTLER_PPT0][POWER_SOURCE_AC]; - if (smu_v13_0_get_current_power_limit(smu, &power_limit)) + /* NOTE: PPSMC_MSG_GetPptLimit msg is not valid on vf mode, so get power limit from pptable */ + if (amdgpu_sriov_vf(smu->adev)) + power_limit = skutable->SocketPowerLimitAc[PPT_THROTTLER_PPT0]; + else if (smu_v13_0_get_current_power_limit(smu, &power_limit)) power_limit = smu->adev->pm.ac_power ? skutable->SocketPowerLimitAc[PPT_THROTTLER_PPT0] : skutable->SocketPowerLimitDc[PPT_THROTTLER_PPT0]; @@ -2474,7 +2477,7 @@ static int smu_v13_0_0_get_power_limit(struct smu_context *smu, if (default_power_limit) *default_power_limit = power_limit; - if (powerplay_table) { + if (!amdgpu_sriov_vf(smu->adev) && powerplay_table) { if (smu->od_enabled && smu_v13_0_0_is_od_feature_supported(smu, PP_OD_FEATURE_PPT_BIT)) { od_percent_upper = le32_to_cpu(powerplay_table->overdrive_table.max[SMU_13_0_0_ODSETTING_POWERPERCENTAGE]); -- 2.34.1
