Skip to content

Commit e82a8d4

Browse files
Yang Wangalexdeucher
authored andcommitted
drm/amd/amdgpu: disable hwmon power1_cap* for gfx 11.0.3 on vf mode
the PPSMC_MSG_GetPptLimit msg is not valid for gfx 11.0.3 on vf mode, so skiped to create power1_cap* hwmon sysfs node. Signed-off-by: Yang Wang <kevinyang.wang@amd.com> Reviewed-by: Asad Kamal <asad.kamal@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent ec813f3 commit e82a8d4

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

drivers/gpu/drm/amd/pm/amdgpu_pm.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3586,14 +3586,16 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
35863586
effective_mode &= ~S_IWUSR;
35873587

35883588
/* not implemented yet for APUs other than GC 10.3.1 (vangogh) and 9.4.3 */
3589-
if (((adev->family == AMDGPU_FAMILY_SI) ||
3590-
((adev->flags & AMD_IS_APU) && (gc_ver != IP_VERSION(10, 3, 1)) &&
3591-
(gc_ver != IP_VERSION(9, 4, 3) && gc_ver != IP_VERSION(9, 4, 4)))) &&
3592-
(attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
3593-
attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr ||
3594-
attr == &sensor_dev_attr_power1_cap.dev_attr.attr ||
3595-
attr == &sensor_dev_attr_power1_cap_default.dev_attr.attr))
3596-
return 0;
3589+
if (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
3590+
attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr ||
3591+
attr == &sensor_dev_attr_power1_cap.dev_attr.attr ||
3592+
attr == &sensor_dev_attr_power1_cap_default.dev_attr.attr) {
3593+
if (adev->family == AMDGPU_FAMILY_SI ||
3594+
((adev->flags & AMD_IS_APU) && gc_ver != IP_VERSION(10, 3, 1) &&
3595+
(gc_ver != IP_VERSION(9, 4, 3) && gc_ver != IP_VERSION(9, 4, 4))) ||
3596+
(amdgpu_sriov_vf(adev) && gc_ver == IP_VERSION(11, 0, 3)))
3597+
return 0;
3598+
}
35973599

35983600
/* not implemented yet for APUs having < GC 9.3.0 (Renoir) */
35993601
if (((adev->family == AMDGPU_FAMILY_SI) ||

0 commit comments

Comments
 (0)