Commit d32709da authored by Yintian Tao's avatar Yintian Tao Committed by Alex Deucher

drm/amdgpu: resume kiq access debugfs

If there is no GPU hang, user still can access
debugfs through kiq.
Signed-off-by: default avatarYintian Tao <yttao@amd.com>
Reviewed-by: default avatarMonk Liu <Monk.liu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6952e99c
...@@ -335,17 +335,23 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev) ...@@ -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; 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) 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; return 0;
if (amdgpu_virt_can_access_debugfs(adev)) if (amdgpu_virt_access_debugfs_is_mmio(adev))
adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME; adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME;
else else
return -EPERM; return -EPERM;
......
...@@ -299,6 +299,8 @@ static inline bool is_virtual_machine(void) ...@@ -299,6 +299,8 @@ static inline bool is_virtual_machine(void)
((adev)->virt.gim_feature & AMDGIM_FEATURE_PP_ONE_VF) ((adev)->virt.gim_feature & AMDGIM_FEATURE_PP_ONE_VF)
#define amdgpu_sriov_is_debug(adev) \ #define amdgpu_sriov_is_debug(adev) \
((!adev->in_gpu_reset) && adev->virt.tdr_debug) ((!adev->in_gpu_reset) && adev->virt.tdr_debug)
#define amdgpu_sriov_is_normal(adev) \
((!adev->in_gpu_reset) && (!adev->virt.tdr_debug))
bool amdgpu_virt_mmio_blocked(struct amdgpu_device *adev); bool amdgpu_virt_mmio_blocked(struct amdgpu_device *adev);
void amdgpu_virt_init_setting(struct amdgpu_device *adev); void amdgpu_virt_init_setting(struct amdgpu_device *adev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment