Skip to content

Commit

Permalink
amdgpu/pm: Disable managing hwmon sysfs attributes for ONEVF mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Danijel Slivka authored and alexdeucher committed Feb 24, 2022
1 parent e776a75 commit 4f0f1b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/amd/pm/amdgpu_pm.c
Expand Up @@ -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 ||
Expand Down

0 comments on commit 4f0f1b5

Please sign in to comment.