Skip to content

Commit 56f3765

Browse files
Yang Wanggregkh
authored andcommitted
drm/amd/amdgpu: disable hwmon power1_cap* for gfx 11.0.3 on vf mode
commit 5dff508 upstream. 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> (cherry picked from commit e82a8d4) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 31ce7c0 commit 56f3765

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
@@ -3668,14 +3668,16 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
36683668
effective_mode &= ~S_IWUSR;
36693669

36703670
/* not implemented yet for APUs other than GC 10.3.1 (vangogh) and 9.4.3 */
3671-
if (((adev->family == AMDGPU_FAMILY_SI) ||
3672-
((adev->flags & AMD_IS_APU) && (gc_ver != IP_VERSION(10, 3, 1)) &&
3673-
(gc_ver != IP_VERSION(9, 4, 3) && gc_ver != IP_VERSION(9, 4, 4)))) &&
3674-
(attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
3675-
attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr ||
3676-
attr == &sensor_dev_attr_power1_cap.dev_attr.attr ||
3677-
attr == &sensor_dev_attr_power1_cap_default.dev_attr.attr))
3678-
return 0;
3671+
if (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
3672+
attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr ||
3673+
attr == &sensor_dev_attr_power1_cap.dev_attr.attr ||
3674+
attr == &sensor_dev_attr_power1_cap_default.dev_attr.attr) {
3675+
if (adev->family == AMDGPU_FAMILY_SI ||
3676+
((adev->flags & AMD_IS_APU) && gc_ver != IP_VERSION(10, 3, 1) &&
3677+
(gc_ver != IP_VERSION(9, 4, 3) && gc_ver != IP_VERSION(9, 4, 4))) ||
3678+
(amdgpu_sriov_vf(adev) && gc_ver == IP_VERSION(11, 0, 3)))
3679+
return 0;
3680+
}
36793681

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

0 commit comments

Comments
 (0)