summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmily Deng <Emily.Deng@amd.com>2018-08-21 12:51:38 +0200
committerAlex Deucher <alexander.deucher@amd.com>2018-08-27 18:11:12 +0200
commitfc0faf04400133393faa0a289aeba5d82069e52e (patch)
treef7564f70b7a3f0fe49575703b7a3c2183128f527
parentdrm/amdgpu: fix sdma doorbell range setting (diff)
downloadlinux-fc0faf04400133393faa0a289aeba5d82069e52e.tar.xz
linux-fc0faf04400133393faa0a289aeba5d82069e52e.zip
drm/amdgpu/sriov: Only sriov runtime support use kiq
For sriov, don't use kiq in exclusive mode, as don't know how long time it will take, some times it will occur exclusive timeout. Signed-off-by: Emily Deng <Emily.Deng@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index 46183c7730c4..b6b5ede0ca35 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -321,9 +321,6 @@ signed long amdgpu_kiq_reg_write_reg_wait(struct amdgpu_device *adev,
struct amdgpu_kiq *kiq = &adev->gfx.kiq;
struct amdgpu_ring *ring = &kiq->ring;
- if (!ring->ready)
- return -EINVAL;
-
spin_lock_irqsave(&kiq->ring_lock, flags);
amdgpu_ring_alloc(ring, 32);
@@ -390,10 +387,14 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev,
struct amdgpu_vmhub *hub = &adev->vmhub[i];
u32 tmp = gmc_v9_0_get_invalidate_req(vmid);
- r = amdgpu_kiq_reg_write_reg_wait(adev, hub->vm_inv_eng0_req + eng,
- hub->vm_inv_eng0_ack + eng, tmp, 1 << vmid);
- if (!r)
- continue;
+ if (adev->gfx.kiq.ring.ready &&
+ (amdgpu_sriov_runtime(adev) ||
+ !amdgpu_sriov_vf(adev))) {
+ r = amdgpu_kiq_reg_write_reg_wait(adev, hub->vm_inv_eng0_req + eng,
+ hub->vm_inv_eng0_ack + eng, tmp, 1 << vmid);
+ if (!r)
+ continue;
+ }
spin_lock(&adev->gmc.invalidate_lock);