summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-01-27 23:12:16 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-01-27 23:12:16 +0000
commita2b9931694fafdcca50c175ca786205e30b0009d (patch)
tree9077d67d245f720f7e5553c0617dad21d6ddcdf0 /sys/dev/pci
parent35e7ca6288992470e34c6b14fa090411cf4db973 (diff)
amdgpu/pm: Make sysfs pm attributes as read-only for VFs
From Marina Nikolic e4066c05d3327b530bb00d11d3492bac1e69982d in linux 5.15.y/5.15.17 11c9cc95f818f0f187e9b579a7f136f532b42445 in mainline linux
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/amd/pm/amdgpu_pm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/amd/pm/amdgpu_pm.c b/sys/dev/pci/drm/amd/pm/amdgpu_pm.c
index fc350a2557b..50e7874c6e5 100644
--- a/sys/dev/pci/drm/amd/pm/amdgpu_pm.c
+++ b/sys/dev/pci/drm/amd/pm/amdgpu_pm.c
@@ -2119,6 +2119,12 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
}
}
+ /* setting should not be allowed from VF */
+ if (amdgpu_sriov_vf(adev)) {
+ dev_attr->attr.mode &= ~S_IWUGO;
+ dev_attr->store = NULL;
+ }
+
#undef DEVICE_ATTR_IS
return 0;