summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
diff options
context:
space:
mode:
authorYintian Tao <yttao@amd.com>2020-04-13 14:31:27 +0800
committerAlex Deucher <alexander.deucher@amd.com>2020-04-13 12:01:56 -0400
commitd32709dac627e5602fb3e66bcf4316906356120d (patch)
treea6c31edc229fcf2c134b204f9b3267ffe528bf91 /drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
parent6952e99cfd52d32098540fe8d9e592828b9e774c (diff)
downloadlinux-d32709dac627e5602fb3e66bcf4316906356120d.tar.bz2
drm/amdgpu: resume kiq access debugfs
If there is no GPU hang, user still can access debugfs through kiq. Signed-off-by: Yintian Tao <yttao@amd.com> Reviewed-by: Monk Liu <Monk.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 6a81c2ee7c7b..8c10084f44ef 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -335,17 +335,23 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev)
}
}
-bool amdgpu_virt_can_access_debugfs(struct amdgpu_device *adev)
+bool amdgpu_virt_access_debugfs_is_mmio(struct amdgpu_device *adev)
{
return amdgpu_sriov_is_debug(adev) ? true : false;
}
+bool amdgpu_virt_access_debugfs_is_kiq(struct amdgpu_device *adev)
+{
+ return amdgpu_sriov_is_normal(adev) ? true : false;
+}
+
int amdgpu_virt_enable_access_debugfs(struct amdgpu_device *adev)
{
- if (!amdgpu_sriov_vf(adev))
+ if (!amdgpu_sriov_vf(adev) ||
+ amdgpu_virt_access_debugfs_is_kiq(adev))
return 0;
- if (amdgpu_virt_can_access_debugfs(adev))
+ if (amdgpu_virt_access_debugfs_is_mmio(adev))
adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME;
else
return -EPERM;