]> git.baikalelectronics.ru Git - kernel.git/commit
amdgpu/pm: Make sysfs pm attributes as read-only for VFs
authorMarina Nikolic <Marina.Nikolic@amd.com>
Tue, 14 Dec 2021 12:57:53 +0000 (20:57 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Dec 2021 13:54:45 +0000 (08:54 -0500)
commitcc83e79fbaa13d581b2e445e269c0d42efa3bcf3
tree82454b125262dc63a90e5ecabf10f236f10e2a56
parent0d80d84245c8dbd4c9e5a60cbe68d849f0e70377
amdgpu/pm: Make sysfs pm attributes as read-only for VFs

== Description ==
Setting values of pm attributes through sysfs
should not be allowed in SRIOV mode.
These calls will not be processed by FW anyway,
but error handling on sysfs level should be improved.

== Changes ==
This patch prohibits performing of all set commands
in SRIOV mode on sysfs level.
It offers better error handling as calls that are
not allowed will not be propagated further.

== Test ==
Writing to any sysfs file in passthrough mode will succeed.
Writing to any sysfs file in ONEVF mode will yield error:
"calling process does not have sufficient permission to execute a command".

Signed-off-by: Marina Nikolic <Marina.Nikolic@amd.com>
Acked-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_pm.c