Skip to contentSkip to conversation

drm/amdgpu: drop compute ring timeout setting for non-sriov only (v2)

PATCH In review Evan Quan 2 participants 3 messages Mar 27, 2018 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Evan Quan

author
#0 lore raw

PATCH 1/1 drm/amdgpu: drop compute ring timeout setting for non-sriov only (v2)

Sriov still wants these error messags on timeout. So, for sriov use case, the timeout setting on compute rings is kept.

-v2: clean the code

Change-Id Id0af6959a8023c8d683ff680de7c583f84cfeab3
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +9 -3
index 455a81e..0000569 100644
@@ -411,6 +411,7 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
 				  unsigned num_hw_submission)
 {
 	int r;
+	long timeout;
 
 	/* Check that num_hw_submission is a power of two */
 	if ((num_hw_submission & (num_hw_submission - 1)) != 0)
@@ -433,11 +434,16 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
 
 	/* No need to setup the GPU scheduler for KIQ ring */
 	if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {
+		/* for non-sriov case, no timeout enforce on compute ring */
+		if ((ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE)
+				&& !amdgpu_sriov_vf(ring->adev))
+			timeout = MAX_SCHEDULE_TIMEOUT;
+		else
+			timeout = msecs_to_jiffies(amdgpu_lockup_timeout);
+
 		r = drm_sched_init(&ring->sched, &amdgpu_sched_ops,
 				   num_hw_submission, amdgpu_job_hang_limit,
-				   (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) ?
-				   MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(amdgpu_lockup_timeout),
-				   ring->name);
+				   timeout, ring->name);
 		if (r) {
 			DRM_ERROR("Failed to create scheduler on ring %s.\n",
 				  ring->name);
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): 1522138531-10121-1-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Am 27.03.2018 um 10:15 schrieb Evan Quan:

Quoted 16 lines

Sriov still wants these error messags on timeout. So, for sriov use case, the timeout setting on compute rings is kept.

-v2: clean the code

Change-Id Id0af6959a8023c8d683ff680de7c583f84cfeab3
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 12 +++++++++---
  1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +0 -0
index 455a81e..0000569 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, · line 414

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +1 -0
@@ -411,6 +411,7 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
  				  unsigned num_hw_submission)
  {
  	int r;
+	long timeout;

Minor nit pick, common coding style would be:

long timeout;
int r;

Anyway the patch is Reviewed-by: Christian König <[email protected]>

Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +6 -0
  	/* Check that num_hw_submission is a power of two */
  	if ((num_hw_submission & (num_hw_submission - 1)) != 0)
@@ -433,11 +434,16 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
 
  	/* No need to setup the GPU scheduler for KIQ ring */
  	if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {
+		/* for non-sriov case, no timeout enforce on compute ring */
+		if ((ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE)
+				&& !amdgpu_sriov_vf(ring->adev))
+			timeout = MAX_SCHEDULE_TIMEOUT;
+		else
+			timeout = msecs_to_jiffies(amdgpu_lockup_timeout);

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, · line 449

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +2 -3
+
  		r = drm_sched_init(&ring->sched, &amdgpu_sched_ops,
  				   num_hw_submission, amdgpu_job_hang_limit,
-				   (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) ?
-				   MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(amdgpu_lockup_timeout),
-				   ring->name);
+				   timeout, ring->name);
  		if (r) {
  			DRM_ERROR("Failed to create scheduler on ring %s.\n",
  				  ring->name);

_______________________________________________
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): 8820b8dd-5a65-f020-6f66-e3fb05cec7b9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

author
#4 lore raw

Thanks! Will correct it on patch submit.

Regards,
Evan

Quoted 61 lines

-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: Tuesday, March 27, 2018 4:20 PM
To: Quan, Evan <[email protected]>; [email protected]
Cc: Koenig, Christian <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: drop compute ring timeout setting for non-sriov only (v2)

Am 27.03.2018 um 10:15 schrieb Evan Quan:

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c int amdgpu_fence_driver_init_ring(struct

Quoted 17 lines

Sriov still wants these error messags on timeout. So, for sriov use case, the timeout setting on compute rings is kept.

-v2: clean the code

Change-Id Id0af6959a8023c8d683ff680de7c583f84cfeab3
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 12 +++++++++---
  1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +0 -0
index 455a81e..0000569 100644
@@ -411,6 +411,7 @@ int amdgpu_fence_driver_init_ring(struct

amdgpu_ring *ring,

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, · line 414

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +1 -0
  				  unsigned num_hw_submission)
  {
  	int r;
+	long timeout;

Minor nit pick, common coding style would be:

long timeout;
int r;

Anyway the patch is Reviewed-by: Christian König
<[email protected]>

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c int amdgpu_fence_driver_init_ring(struct · line 416

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +0 -0
  	/* Check that num_hw_submission is a power of two */
  	if ((num_hw_submission & (num_hw_submission - 1)) != 0) @@ -

433,11

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +7 -0
+434,16 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
 
  	/* No need to setup the GPU scheduler for KIQ ring */
  	if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {
+		/* for non-sriov case, no timeout enforce on compute ring */
+		if ((ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE)
+				&& !amdgpu_sriov_vf(ring->adev))
+			timeout = MAX_SCHEDULE_TIMEOUT;
+		else
+			timeout =

msecs_to_jiffies(amdgpu_lockup_timeout);

Quoted 3 lines

+
r = drm_sched_init(&ring->sched, &amdgpu_sched_ops,
num_hw_submission,

amdgpu_job_hang_limit,

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +0 -1
-				   (ring->funcs->type ==

AMDGPU_RING_TYPE_COMPUTE) ?

Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c

Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +0 -1
-				   MAX_SCHEDULE_TIMEOUT :

msecs_to_jiffies(amdgpu_lockup_timeout),

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +1 -1
-				   ring->name);
+				   timeout, ring->name);
  		if (r) {
  			DRM_ERROR("Failed to create scheduler on

ring %s.\n",

Quoted 1 line

ring->name);

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