Skip to contentSkip to conversation

amdgpu/pm: Disable managing hwmon sysfs attributes for ONEVF mode

PATCH In review Danijel Slivka 2 participants 3 messages Feb 10, 2022 – Feb 23, 2022

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

PATCH 1/1 amdgpu/pm: Disable managing hwmon sysfs attributes for ONEVF mode

This patch prohibits performing of set commands on all hwmon attributes through sysfs in ONEVF mode.

---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +4 -0
index ad5da252228b..3cec023a7b06 100644
@@ -3161,6 +3161,10 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
 	if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev))
 		return 0;
 
+	/* under pp one vf mode manage of hwmon attributes is not supported */
+	if (amdgpu_sriov_is_pp_one_vf(adev))
+		effective_mode &= ~S_IWUSR;
+
 	/* Skip fan attributes if fan is not present */
 	if (adev->pm.no_fan && (attr == &sensor_dev_attr_pwm1.dev_attr.attr ||
 	    attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw

[AMD Official Use Only]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Danijel Slivka
Sent: Thursday, February 10, 2022 8:24 PM
To: [email protected]
Cc: Slivka, Danijel <[email protected]>
Subject: [PATCH] amdgpu/pm: Disable managing hwmon sysfs attributes for ONEVF mode

This patch prohibits performing of set commands on all hwmon attributes through sysfs in ONEVF mode.

---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +4 -0
index ad5da252228b..3cec023a7b06 100644
@@ -3161,6 +3161,10 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
 	if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev))
 		return 0;
 
+	/* under pp one vf mode manage of hwmon attributes is not supported */
+	if (amdgpu_sriov_is_pp_one_vf(adev))
+		effective_mode &= ~S_IWUSR;
+
 	/* Skip fan attributes if fan is not present */
 	if (adev->pm.no_fan && (attr == &sensor_dev_attr_pwm1.dev_attr.attr ||
 	    attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||

--
2.25.1

Reviewed-by Acked-by
#2 lore raw

[AMD Official Use Only]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Kasiviswanathan, Harish
Sent: Thursday, February 17, 2022 2:17 PM
To: Slivka, Danijel <[email protected]>; [email protected]
Cc: Slivka, Danijel <[email protected]>
Subject: RE: [PATCH] amdgpu/pm: Disable managing hwmon sysfs attributes for ONEVF mode

[AMD Official Use Only]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Danijel Slivka
Sent: Thursday, February 10, 2022 8:24 PM
To: [email protected]
Cc: Slivka, Danijel <[email protected]>
Subject: [PATCH] amdgpu/pm: Disable managing hwmon sysfs attributes for ONEVF mode

This patch prohibits performing of set commands on all hwmon attributes through sysfs in ONEVF mode.

---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +4 -0
index ad5da252228b..3cec023a7b06 100644
@@ -3161,6 +3161,10 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
 	if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev))
 		return 0;
 
+	/* under pp one vf mode manage of hwmon attributes is not supported */
+	if (amdgpu_sriov_is_pp_one_vf(adev))
+		effective_mode &= ~S_IWUSR;
+
 	/* Skip fan attributes if fan is not present */
 	if (adev->pm.no_fan && (attr == &sensor_dev_attr_pwm1.dev_attr.attr ||
 	    attr == &sensor_dev_attr_pwm1_enable.dev_attr.attr ||

--
2.25.1