AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: for sriov timeout is still enforced on compute rings
@ 2018-03-27  6:46 Evan Quan
       [not found] ` <1522133191-31247-1-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Evan Quan @ 2018-03-27  6:46 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Alexander.Deucher-5C7GfCeVMHo, Evan Quan, Monk.Liu-5C7GfCeVMHo

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

Change-Id: Id0af6959a8023c8d683ff680de7c583f84cfeab3
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index 455a81e..2cc5a75 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -435,7 +435,8 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
 	if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {
 		r = drm_sched_init(&ring->sched, &amdgpu_sched_ops,
 				   num_hw_submission, amdgpu_job_hang_limit,
-				   (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) ?
+				   /* for non-sriov case, no timeout enforce on compute ring */
+				   ((ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) && !amdgpu_sriov_vf(ring->adev)) ?
 				   MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(amdgpu_lockup_timeout),
 				   ring->name);
 		if (r) {
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: for sriov timeout is still enforced on compute rings
       [not found] ` <1522133191-31247-1-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org>
@ 2018-03-27  7:51   ` Christian König
       [not found]     ` <32b69fa9-c0be-db27-03a9-97eb3585083e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2018-03-27  7:51 UTC (permalink / raw)
  To: Evan Quan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Alexander.Deucher-5C7GfCeVMHo, Monk.Liu-5C7GfCeVMHo


[-- Attachment #1.1: Type: text/plain, Size: 1584 bytes --]

Am 27.03.2018 um 08:46 schrieb Evan Quan:
> Sriov still wants these error messags on timeout. So, for sriov
> use case, the timeout setting on compute rings is kept.
>
> Change-Id: Id0af6959a8023c8d683ff680de7c583f84cfeab3
> Signed-off-by: Evan Quan <evan.quan-5C7GfCeVMHo@public.gmane.org>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> index 455a81e..2cc5a75 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> @@ -435,7 +435,8 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
>   	if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {
>   		r = drm_sched_init(&ring->sched, &amdgpu_sched_ops,
>   				   num_hw_submission, amdgpu_job_hang_limit,
> -				   (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) ?
> +				   /* for non-sriov case, no timeout enforce on compute ring */
> +				   ((ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) && !amdgpu_sriov_vf(ring->adev)) ?

This starts to look a bit messy, can you add a local variable and 
separate the exceptions, e.g. something like:

long timeout = msecs_to_jiffies(amdgpu_lockup_timeout);

if (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) && 
!amdgpu_sriov_vf(ring->adev))
     timeout = MAX_SCHEDULE_TIMEOUT;

....

Apart from that the patch looks good to me,
Christian.

>   				   MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(amdgpu_lockup_timeout),
>   				   ring->name);
>   		if (r) {


[-- Attachment #1.2: Type: text/html, Size: 2369 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amdgpu: for sriov timeout is still enforced on compute rings
       [not found]     ` <32b69fa9-c0be-db27-03a9-97eb3585083e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-03-27  8:18       ` Quan, Evan
  0 siblings, 0 replies; 3+ messages in thread
From: Quan, Evan @ 2018-03-27  8:18 UTC (permalink / raw)
  To: Koenig, Christian,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
  Cc: Deucher, Alexander, Liu, Monk


[-- Attachment #1.1: Type: text/plain, Size: 2234 bytes --]

Yes, of course. I have sent out a new patch with the code cleaned.

Regards,
Evan
From: Christian König [mailto:ckoenig.leichtzumerken@gmail.com]
Sent: Tuesday, March 27, 2018 3:52 PM
To: Quan, Evan <Evan.Quan@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Liu, Monk <Monk.Liu@amd.com>
Subject: Re: [PATCH] drm/amdgpu: for sriov timeout is still enforced on compute rings

Am 27.03.2018 um 08:46 schrieb Evan Quan:

Sriov still wants these error messags on timeout. So, for sriov

use case, the timeout setting on compute rings is kept.



Change-Id: Id0af6959a8023c8d683ff680de7c583f84cfeab3

Signed-off-by: Evan Quan <evan.quan@amd.com><mailto:evan.quan@amd.com>

---

 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 ++-

 1 file changed, 2 insertions(+), 1 deletion(-)



diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c

index 455a81e..2cc5a75 100644

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

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

@@ -435,7 +435,8 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,

        if (ring->funcs->type != AMDGPU_RING_TYPE_KIQ) {

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

                                  num_hw_submission, amdgpu_job_hang_limit,

-                                 (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) ?

+                                 /* for non-sriov case, no timeout enforce on compute ring */

+                                 ((ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) && !amdgpu_sriov_vf(ring->adev)) ?

This starts to look a bit messy, can you add a local variable and separate the exceptions, e.g. something like:

long timeout = msecs_to_jiffies(amdgpu_lockup_timeout);

if (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE) && !amdgpu_sriov_vf(ring->adev))
    timeout = MAX_SCHEDULE_TIMEOUT;

....

Apart from that the patch looks good to me,
Christian.



                                  MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(amdgpu_lockup_timeout),

                                  ring->name);

                if (r) {


[-- Attachment #1.2: Type: text/html, Size: 7498 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-27  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-27  6:46 [PATCH] drm/amdgpu: for sriov timeout is still enforced on compute rings Evan Quan
     [not found] ` <1522133191-31247-1-git-send-email-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-03-27  7:51   ` Christian König
     [not found]     ` <32b69fa9-c0be-db27-03a9-97eb3585083e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-03-27  8:18       ` Quan, Evan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox