Skip to contentSkip to conversation

drm/amd/amdgpu: hide voltage and power sensors on SI and KV parts

PATCH In review Jean Delvare 2 participants 2 messages Aug 28, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/amdgpu: hide voltage and power sensors on SI and KV parts

The driver does not support these sensors yet and there is no point in creating sysfs attributes which will always return an error.

Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc "David (ChunMing) Zhou" <[email protected]>

---
This works for me however I couldn't seen any other place in the driver where adev->family is tested directly like that, so I'm not sure if this is the right way to perform the test?

 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +9 -1
@@ -2150,7 +2150,9 @@ static umode_t hwmon_attributes_visible(
 			effective_mode &= ~S_IWUSR;
 	}
 
-	if ((adev->flags & AMD_IS_APU) &&
+	if (((adev->flags & AMD_IS_APU) ||
+	     adev->family == AMDGPU_FAMILY_SI ||	/* not implemented yet */
+	     adev->family == AMDGPU_FAMILY_KV) &&	/* not implemented yet */
 	    (attr == &sensor_dev_attr_power1_average.dev_attr.attr ||
 	     attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
 	     attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr||
@@ -2174,6 +2176,12 @@ static umode_t hwmon_attributes_visible(
 			return 0;
 	}
 
+	if ((adev->family == AMDGPU_FAMILY_SI ||	/* not implemented yet */
+	     adev->family == AMDGPU_FAMILY_KV) &&	/* not implemented yet */
+	    (attr == &sensor_dev_attr_in0_input.dev_attr.attr ||
+	     attr == &sensor_dev_attr_in0_label.dev_attr.attr))
+		return 0;
+
 	/* only APUs have vddnb */
 	if (!(adev->flags & AMD_IS_APU) &&
 	    (attr == &sensor_dev_attr_in1_input.dev_attr.attr ||
Signature · 6 lines
Jean Delvare
SUSE L3 Support
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw
Quoted 4 lines · Jean Delvare

The driver does not support these sensors yet and there is no point in creating sysfs attributes which will always return an error.

Quoted 8 lines
Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
Cc "David (ChunMing) Zhou" <[email protected]>

---
This works for me however I couldn't seen any other place in the driver where adev->family is tested directly like that, so I'm not sure if this is the right way to perform the test?

That's fine. Applied. Thanks!

Alex

Quoted 33 lines
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c 2019-08-28 09:58:59.896314948 +0200 renamed from drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c 2019-08-28 09:38:11.245376539 +0200 +9 -2
@@ -2150,7 +2150,9 @@ static umode_t hwmon_attributes_visible(
                        effective_mode &= ~S_IWUSR;
        }
 
-       if ((adev->flags & AMD_IS_APU) &&
+       if (((adev->flags & AMD_IS_APU) ||
+            adev->family == AMDGPU_FAMILY_SI ||        /* not implemented yet */
+            adev->family == AMDGPU_FAMILY_KV) &&       /* not implemented yet */
            (attr == &sensor_dev_attr_power1_average.dev_attr.attr ||
             attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr ||
             attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr||
@@ -2174,6 +2176,12 @@ static umode_t hwmon_attributes_visible(
                        return 0;
        }
 
+       if ((adev->family == AMDGPU_FAMILY_SI ||        /* not implemented yet */
+            adev->family == AMDGPU_FAMILY_KV) &&       /* not implemented yet */
+           (attr == &sensor_dev_attr_in0_input.dev_attr.attr ||
+            attr == &sensor_dev_attr_in0_label.dev_attr.attr))
+               return 0;
+
        /* only APUs have vddnb */
        if (!(adev->flags & AMD_IS_APU) &&
            (attr == &sensor_dev_attr_in1_input.dev_attr.attr ||
 
 
--
Quoted 6 lines

Jean Delvare
SUSE L3 Support
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx