Skip to contentSkip to conversation

drm/amdgpu/sriov: Only sriov runtime support use kiq

PATCH Superseded Emily Deng 2 participants 3 messages Aug 21, 2018 2 messages not in the archive

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Emily Deng

author
#0 lore raw

PATCH v2 1/1 drm/amdgpu/sriov: Only sriov runtime support use kiq

Refine the code style, add brackets.

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +1 -1
index f71615e..adfd0bd 100644
@@ -320,7 +320,7 @@ 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)
+	if (!ring->ready || (!amdgpu_sriov_runtime(adev) && amdgpu_sriov_vf(adev)))
 		return -EINVAL;
 
 	spin_lock_irqsave(&kiq->ring_lock, flags);
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): 1534828612-6608-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 21.08.2018 um 07:16 schrieb Emily Deng:

Quoted 15 lines

Refine the code style, add brackets.

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 | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
index f71615e..adfd0bd 100644

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c signed long amdgpu_kiq_reg_write_reg_wait(struct amdgpu_device *adev, · line 323

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +1 -1
@@ -320,7 +320,7 @@ 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)
+	if (!ring->ready || (!amdgpu_sriov_runtime(adev) && amdgpu_sriov_vf(adev)))

Please rework the code flow a bit to make it more obvious what happens here.

E.g. move the check into the caller instead of returning an error code here.

Christian.

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c signed long amdgpu_kiq_reg_write_reg_wait(struct amdgpu_device *adev, · line 326

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
  		return -EINVAL;
 
  	spin_lock_irqsave(&kiq->ring_lock, flags);

_______________________________________________
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): 03c57e23-8f97-9d95-27d9-214fea8b7529-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#4 lore raw
Quoted 27 lines

-----Original Message-----
From: Christian König <[email protected]>
Sent: Tuesday, August 21, 2018 3:51 PM
To: Deng, Emily <[email protected]>; [email protected]
Subject: Re: [PATCH v2] drm/amdgpu/sriov: Only sriov runtime support use kiq

Am 21.08.2018 um 07:16 schrieb Emily Deng:

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c signed long amdgpu_kiq_reg_write_reg_wait(struct

Quoted 16 lines

Refine the code style, add brackets.

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 | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
index f71615e..adfd0bd 100644
@@ -320,7 +320,7 @@ signed long  amdgpu_kiq_reg_write_reg_wait(struct

amdgpu_device *adev,

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
  	struct amdgpu_kiq *kiq = &adev->gfx.kiq;
  	struct amdgpu_ring *ring = &kiq->ring;
 
Quoted 7 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c signed long amdgpu_kiq_reg_write_reg_wait(struct · line 324

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -1
-	if (!ring->ready)
+	if (!ring->ready || (!amdgpu_sriov_runtime(adev) &&
+amdgpu_sriov_vf(adev)))

Please rework the code flow a bit to make it more obvious what happens here.

E.g. move the check into the caller instead of returning an error code here.

Thanks, will refine.

Quoted 5 lines

Christian.

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
  		return -EINVAL;
 
  	spin_lock_irqsave(&kiq->ring_lock, flags);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx