mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
drm/amdgpu: Disallow partition query during reset
Reject queries to get current partition modes during reset. Also, don't accept sysfs interface requests to switch compute partition mode while in reset. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Asad Kamal <asad.kamal@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -1230,6 +1230,10 @@ static ssize_t current_memory_partition_show(
|
||||
struct amdgpu_device *adev = drm_to_adev(ddev);
|
||||
enum amdgpu_memory_partition mode;
|
||||
|
||||
/* Only minimal precaution taken to reject requests while in reset */
|
||||
if (amdgpu_in_reset(adev))
|
||||
return -EPERM;
|
||||
|
||||
mode = adev->gmc.gmc_funcs->query_mem_partition_mode(adev);
|
||||
if ((mode >= ARRAY_SIZE(nps_desc)) ||
|
||||
(BIT(mode) & AMDGPU_ALL_NPS_MASK) != BIT(mode))
|
||||
|
||||
Reference in New Issue
Block a user