From: Danijel Slivka Date: Fri, 11 Feb 2022 01:06:01 +0000 (+0100) Subject: amdgpu/pm: Disable managing hwmon sysfs attributes for ONEVF mode X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4f0f1b58fbacc3d4f60e0cf17b01a6273df1d415;p=linux.git 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 Acked-by: Harish Kasiviswanathan Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c index 541c9f237e9c7..cbbbd4079249e 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 ||