summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/pm/amdgpu_pm.c
diff options
context:
space:
mode:
authorDanijel Slivka <danijel.slivka@amd.com>2022-02-11 02:06:01 +0100
committerAlex Deucher <alexander.deucher@amd.com>2022-02-24 17:24:31 -0500
commit4f0f1b58fbacc3d4f60e0cf17b01a6273df1d415 (patch)
tree448ef8425fe077261a443c36113be42b71d40016 /drivers/gpu/drm/amd/pm/amdgpu_pm.c
parente776a755abf0dbe14001e4db22aa1ee70290c1dc (diff)
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. Signed-off-by: Danijel Slivka <danijel.slivka@amd.com> Acked-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/amdgpu_pm.c')
-rw-r--r--drivers/gpu/drm/amd/pm/amdgpu_pm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index 541c9f237e9c..cbbbd4079249 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -3182,6 +3182,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 ||