drm/amdgpu/sriov: Only sriov runtime support use kiq
Subsystems (2)
PATCH v3 1/1 drm/amdgpu/sriov: Only sriov runtime support use kiq
Move the check into the caller instead of returning an error code here
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.
--- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +11 -8
@@ -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 );
@@ -389,11 +386,17 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev,for (i =0 ; i <AMDGPU_MAX_VMHUBS ; ++i) {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 ; +struct amdgpu_kiq *kiq = &adev->gfx.kiq; +struct amdgpu_ring *ring = &kiq->ring; + +if (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);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1534840863-14875-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org
Am 21.08.2018 um 10:41 schrieb Emily Deng:
Quoted 27 lines
Move the check into the caller instead of returning an error code here
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 <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0
-3@@ -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 );@@ -389,11 +386,17 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev,for (i =0 ; i <AMDGPU_MAX_VMHUBS ; ++i) {struct amdgpu_vmhub *hub = &adev->vmhub[i];
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, · line 392
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4
-5u32 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 ; +struct amdgpu_kiq *kiq = &adev->gfx.kiq; +struct amdgpu_ring *ring = &kiq->ring; + + if (ring->ready &&
Do you really need the local variable here? Just check adev->gfx.kiq.ring.ready directly.
Apart from that the patch is Reviewed-by: Christian König <[email protected]>.
Regards,
Christian.
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, · line 402
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +7
-0+ (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);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 18820ac3-2bd7-1c9c-3590-f798d0595096-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Quoted 35 lines
-----Original Message-----
From: Christian König <[email protected]>
Sent: Tuesday, August 21, 2018 5:05 PM
To: Deng, Emily <[email protected]>; [email protected]
Subject: Re: [PATCH v3] drm/amdgpu/sriov: Only sriov runtime support use kiqAm 21.08.2018 um 10:41 schrieb Emily Deng:
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c signed long amdgpu_kiq_reg_write_reg_wait(struct
Quoted 16 lines
Move the check into the caller instead of returning an error code here
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 <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0
-0@@ -321,9 +321,6 @@ signed long amdgpu_kiq_reg_write_reg_wait(struct
amdgpu_device*adev,drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static void gmc_v9_0_flush_gpu_tlb(struct
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0
-3struct 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 );@@ -389,11 +386,17 @@ static void gmc_v9_0_flush_gpu_tlb(struct
amdgpu_device*adev,
Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, · line 392
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4
-5for (i =0 ; i <AMDGPU_MAX_VMHUBS ; ++i) {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 ; + struct amdgpu_kiq *kiq = &adev->gfx.kiq; +struct amdgpu_ring *ring = &kiq->ring; + + if (ring->ready &&Do you really need the local variable here? Just check
adev->gfx.kiq.ring.readydirectly.
Ok, will modify.
Quoted 15 lines
Apart from that the patch is Reviewed-by: Christian König <[email protected]>.
Regards,
Christian.Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +7
-0+ (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 ; + }
Quoted 2 lines
Quoted 2 lines
spin_lock(&adev->gmc.invalidate_lock);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx