drm/amdgpu: fix scheduler timeout calc

Submitted by Cui, Flora on June 24, 2019, 8:50 a.m.

Details

Message ID 1561366217-13261-1-git-send-email-flora.cui@amd.com
State New
Headers show
Series "drm/amdgpu: fix scheduler timeout calc" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Cui, Flora June 24, 2019, 8:50 a.m.
scheduler timeout is in jiffies

Change-Id: I26708c163db943ff8d930dd81bcab4b4b9d84eb2
Signed-off-by: Flora Cui <flora.cui@amd.com>

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.7.4

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index cbcaa7c..2edaa6c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -481,6 +481,9 @@  int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
 			break;
 		}
 
+		if (timeout != MAX_SCHEDULE_TIMEOUT)
+			timeout = msecs_to_jiffies(timeout);
+
 		r = drm_sched_init(&ring->sched, &amdgpu_sched_ops,
 				   num_hw_submission, amdgpu_job_hang_limit,
 				   timeout, ring->name);

Comments

Am 24.06.19 um 10:50 schrieb Cui, Flora:
> scheduler timeout is in jiffies
>
> Change-Id: I26708c163db943ff8d930dd81bcab4b4b9d84eb2
> Signed-off-by: Flora Cui <flora.cui@amd.com>

I actually suggested to do this consistently in 
amdgpu_device_get_job_timeout_settings after parsing the value.

BTW: The test for negative values there is still not correct either.

Can you fix up both? Cause otherwise we are not able to completely 
disable the timeout for testing.

Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> index cbcaa7c..2edaa6c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> @@ -481,6 +481,9 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
>   			break;
>   		}
>   
> +		if (timeout != MAX_SCHEDULE_TIMEOUT)
> +			timeout = msecs_to_jiffies(timeout);
> +
>   		r = drm_sched_init(&ring->sched, &amdgpu_sched_ops,()
>   				   num_hw_submission, amdgpu_job_hang_limit,
>   				   timeout, ring->name);
OK. will update in v2.

在 6/24/2019 5:36 PM, Christian König 写道:
> Am 24.06.19 um 10:50 schrieb Cui, Flora:

>> scheduler timeout is in jiffies

>>

>> Change-Id: I26708c163db943ff8d930dd81bcab4b4b9d84eb2

>> Signed-off-by: Flora Cui <flora.cui@amd.com>

>

> I actually suggested to do this consistently in 

> amdgpu_device_get_job_timeout_settings after parsing the value.

>

> BTW: The test for negative values there is still not correct either.

>

> Can you fix up both? Cause otherwise we are not able to completely 

> disable the timeout for testing.

>

> Christian.

>

>> ---

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

>>   1 file changed, 3 insertions(+)

>>

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

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

>> index cbcaa7c..2edaa6c 100644

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

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

>> @@ -481,6 +481,9 @@ int amdgpu_fence_driver_init_ring(struct 

>> amdgpu_ring *ring,

>>               break;

>>           }

>>   +        if (timeout != MAX_SCHEDULE_TIMEOUT)

>> +            timeout = msecs_to_jiffies(timeout);

>> +

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

>>                      num_hw_submission, amdgpu_job_hang_limit,

>>                      timeout, ring->name);

>