aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c
diff options
context:
space:
mode:
authorMonk Liu <[email protected]>2017-10-16 11:50:44 +0000
committerAlex Deucher <[email protected]>2017-10-20 17:28:44 +0000
commit6867e1b5fbd1a9deaf95a1bd23ea930063c8d216 (patch)
tree4f59ac885dd43f65fb07ecedfadd6ca3c535985b /drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c
parentdrm/amdgpu/sriov:now must reinit psp (diff)
downloadkernel-6867e1b5fbd1a9deaf95a1bd23ea930063c8d216.tar.gz
kernel-6867e1b5fbd1a9deaf95a1bd23ea930063c8d216.zip
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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vf_error.c7
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;