diff options
author | Monk Liu <Monk.Liu@amd.com> | 2017-10-16 19:50:44 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-10-20 13:28:44 -0400 |
commit | 6867e1b5fbd1a9deaf95a1bd23ea930063c8d216 (patch) | |
tree | 4f59ac885dd43f65fb07ecedfadd6ca3c535985b /drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c | |
parent | ef4c166dc2335bf20c7a854a0de52d17ed9f2f38 (diff) |
drm/amdgpu:fix vf_error_put
1,it should not work on non-SR-IOV case
2,the NO_VBIOS error is incorrect, should
handle it under detect_sriov_bios.
3,wrap the whole detect_sriov_bios with sriov check
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c index 746b81339835..7f7097931c6f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c @@ -31,7 +31,12 @@ void amdgpu_vf_error_put(struct amdgpu_device *adev, uint64_t error_data) { int index; - uint16_t error_code = AMDGIM_ERROR_CODE(AMDGIM_ERROR_CATEGORY_VF, sub_error_code); + uint16_t error_code; + + if (!amdgpu_sriov_vf(adev)) + return; + + error_code = AMDGIM_ERROR_CODE(AMDGIM_ERROR_CATEGORY_VF, sub_error_code); mutex_lock(&adev->virt.vf_errors.lock); index = adev->virt.vf_errors.write_count % AMDGPU_VF_ERROR_ENTRY_SIZE; |