diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2017-07-03 06:49:27 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-07 13:35:30 -0400 |
commit | d0a77f558ef8d101059c6238abd46a9a97191564 (patch) | |
tree | 76488cf718482c20ff81685f48737eaf63a9b3e7 /drivers/gpu/nvgpu/common/linux | |
parent | 858a204362a385f076b057b6196fd89f7edb839b (diff) |
gpu: nvgpu: use u32 for timeout API duration
A negative value in the timeout duration does not have any special uses,
so change the duration type to u32 (from just int). Delete some
unnecessary typecasts to int.
Also change MAX_SCHEDULE_TIMEOUT to ULONG_MAX in default gr idle timeout
because the value is in milliseconds instead of scheduling units and to
drop unnecessary Linux dependency.
Change-Id: I5cf6febd4f1cb00c46fe159603436a9ac3b003ac
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master/r/1512565
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/timers.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/timers.c b/drivers/gpu/nvgpu/common/linux/timers.c index 2953902e..5786b240 100644 --- a/drivers/gpu/nvgpu/common/linux/timers.c +++ b/drivers/gpu/nvgpu/common/linux/timers.c | |||
@@ -54,12 +54,9 @@ static int nvgpu_timeout_is_pre_silicon(struct nvgpu_timeout *timeout) | |||
54 | * | 54 | * |
55 | * If neither %NVGPU_TIMER_CPU_TIMER or %NVGPU_TIMER_RETRY_TIMER is passed then | 55 | * If neither %NVGPU_TIMER_CPU_TIMER or %NVGPU_TIMER_RETRY_TIMER is passed then |
56 | * a CPU timer is used by default. | 56 | * a CPU timer is used by default. |
57 | * | ||
58 | * A negative duration is interpreted as the maximum possible, which for our | ||
59 | * purposes means infinite wait. | ||
60 | */ | 57 | */ |
61 | int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout, | 58 | int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout, |
62 | int duration, unsigned long flags) | 59 | u32 duration, unsigned long flags) |
63 | { | 60 | { |
64 | if (flags & ~NVGPU_TIMER_FLAG_MASK) | 61 | if (flags & ~NVGPU_TIMER_FLAG_MASK) |
65 | return -EINVAL; | 62 | return -EINVAL; |
@@ -69,9 +66,6 @@ int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout, | |||
69 | timeout->g = g; | 66 | timeout->g = g; |
70 | timeout->flags = flags; | 67 | timeout->flags = flags; |
71 | 68 | ||
72 | if (duration < 0) | ||
73 | duration = INT_MAX; | ||
74 | |||
75 | if (flags & NVGPU_TIMER_RETRY_TIMER) | 69 | if (flags & NVGPU_TIMER_RETRY_TIMER) |
76 | timeout->retries.max = duration; | 70 | timeout->retries.max = duration; |
77 | else | 71 | else |