drm/amdgpu: avoid using invalidate semaphore for SRIOV
Subsystems (2)
PATCH 1/2 drm/amdgpu: avoid using invalidate semaphore for SRIOV
From: changzhu <[email protected]>
It may fail to load guest driver in round 2 when using invalidate semaphore for SRIOV. So it needs to avoid using invalidate semaphore for SRIOV.
Fix for:http://ontrack-internal.amd.com/browse/SWDEV-214157
Change-Id I1e498d33df2f8a53dbbec7a28672085cea68acb8
Signed-off-by changzhu <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 21 +++++++++++++-------- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 20 ++++++++++++-------- 2 files changed, 25 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +13 -8
@@ -243,8 +243,9 @@ static void gmc_v10_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,*/ /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ -if (vmhub ==AMDGPU_MMHUB_0 || - vmhub ==AMDGPU_MMHUB_1 ) { +if ((vmhub ==AMDGPU_MMHUB_0 || + vmhub ==AMDGPU_MMHUB_1 ) && + (!amdgpu_sriov_vf (adev))) {for (i =0 ; i < adev->usec_timeout; i++) {/* a read return value of 1 means semaphore acuqire */ tmp =RREG32_NO_KIQ (hub->vm_inv_eng0_sem + eng);
@@ -277,8 +278,9 @@ static void gmc_v10_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid, }/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ -if (vmhub ==AMDGPU_MMHUB_0 || - vmhub ==AMDGPU_MMHUB_1 ) +if ((vmhub ==AMDGPU_MMHUB_0 || + vmhub ==AMDGPU_MMHUB_1 ) && + (!amdgpu_sriov_vf (adev)))/* * add semaphore release after invalidation, * write with 0 means semaphore release
@@ -368,6 +370,7 @@ static void gmc_v10_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,static uint64_t gmc_v10_0_emit_flush_gpu_tlb (struct amdgpu_ring *ring,unsigned vmid,uint64_t pd_addr) { +struct amdgpu_device *adev = ring->adev;struct amdgpu_vmhub *hub = &ring->adev->vmhub[ring->funcs->vmhub];uint32_t req =gmc_v10_0_get_invalidate_req (vmid,0 );unsigned eng = ring->vm_inv_eng;
@@ -380,8 +383,9 @@ static uint64_t gmc_v10_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,*/ /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ -if (ring->funcs->vmhub ==AMDGPU_MMHUB_0 || - ring->funcs->vmhub ==AMDGPU_MMHUB_1 ) +if ((ring->funcs->vmhub ==AMDGPU_MMHUB_0 || + ring->funcs->vmhub ==AMDGPU_MMHUB_1 ) && + (!amdgpu_sriov_vf (adev)))/* a read return value of 1 means semaphore acuqire */ amdgpu_ring_emit_reg_wait (ring, hub->vm_inv_eng0_sem + eng,0x1 ,0x1 );
@@ -397,8 +401,9 @@ static uint64_t gmc_v10_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring, req, 1 << vmid);/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ -if (ring->funcs->vmhub ==AMDGPU_MMHUB_0 || - ring->funcs->vmhub ==AMDGPU_MMHUB_1 ) +if ((ring->funcs->vmhub ==AMDGPU_MMHUB_0 || + ring->funcs->vmhub ==AMDGPU_MMHUB_1 ) && + (!amdgpu_sriov_vf (adev)))/* * add semaphore release after invalidation, * write with 0 means semaphore release
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +12 -8
@@ -464,8 +464,9 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,*/ /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ -if (vmhub ==AMDGPU_MMHUB_0 || - vmhub ==AMDGPU_MMHUB_1 ) { +if ((vmhub ==AMDGPU_MMHUB_0 || + vmhub ==AMDGPU_MMHUB_1 ) && + (!amdgpu_sriov_vf (adev))) {for (j =0 ; j < adev->usec_timeout; j++) {/* a read return value of 1 means semaphore acuqire */ tmp =RREG32_NO_KIQ (hub->vm_inv_eng0_sem + eng);
@@ -495,8 +496,9 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid, }/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ -if (vmhub ==AMDGPU_MMHUB_0 || - vmhub ==AMDGPU_MMHUB_1 ) +if ((vmhub ==AMDGPU_MMHUB_0 || + vmhub ==AMDGPU_MMHUB_1 ) && + (!amdgpu_sriov_vf (adev)))/* * add semaphore release after invalidation, * write with 0 means semaphore release
@@ -527,8 +529,9 @@ static uint64_t gmc_v9_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,*/ /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ -if (ring->funcs->vmhub ==AMDGPU_MMHUB_0 || - ring->funcs->vmhub ==AMDGPU_MMHUB_1 ) +if ((ring->funcs->vmhub ==AMDGPU_MMHUB_0 || + ring->funcs->vmhub ==AMDGPU_MMHUB_1 ) && + (!amdgpu_sriov_vf (adev)))/* a read return value of 1 means semaphore acuqire */ amdgpu_ring_emit_reg_wait (ring, hub->vm_inv_eng0_sem + eng,0x1 ,0x1 );
@@ -544,8 +547,9 @@ static uint64_t gmc_v9_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring, req, 1 << vmid);/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */ -if (ring->funcs->vmhub ==AMDGPU_MMHUB_0 || - ring->funcs->vmhub ==AMDGPU_MMHUB_1 ) +if ((ring->funcs->vmhub ==AMDGPU_MMHUB_0 || + ring->funcs->vmhub ==AMDGPU_MMHUB_1 ) && + (!amdgpu_sriov_vf (adev)))/* * add semaphore release after invalidation, * write with 0 means semaphore release
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx