]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amd/amdgpu: disable hwmon power1_cap* for gfx 11.0.3 on vf mode
authorYang Wang <kevinyang.wang@amd.com>
Mon, 25 Aug 2025 04:54:01 +0000 (12:54 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 Aug 2025 18:01:08 +0000 (14:01 -0400)
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 e82a8d441038d8cb10b63047a9e705c42479d156)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/pm/amdgpu_pm.c

index 4b64851fdb42e4bb47dc4d3df2a5004ded55c149..5fbfe7333b54df51942c43b8bf2577cf7270c561 100644 (file)
@@ -3458,14 +3458,16 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
                effective_mode &= ~S_IWUSR;
 
        /* not implemented yet for APUs other than GC 10.3.1 (vangogh) and 9.4.3 */
-       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)))) &&
-           (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
-            attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr ||
-            attr == &sensor_dev_attr_power1_cap.dev_attr.attr ||
-            attr == &sensor_dev_attr_power1_cap_default.dev_attr.attr))
-               return 0;
+       if (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
+           attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr ||
+           attr == &sensor_dev_attr_power1_cap.dev_attr.attr ||
+           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)))
+                       return 0;
+       }
 
        /* not implemented yet for APUs having < GC 9.3.0 (Renoir) */
        if (((adev->family == AMDGPU_FAMILY_SI) ||