mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
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>
This commit is contained in:
committed by
mobile promotions
parent
858a204362
commit
d0a77f558e
@@ -54,12 +54,9 @@ static int nvgpu_timeout_is_pre_silicon(struct nvgpu_timeout *timeout)
|
||||
*
|
||||
* If neither %NVGPU_TIMER_CPU_TIMER or %NVGPU_TIMER_RETRY_TIMER is passed then
|
||||
* a CPU timer is used by default.
|
||||
*
|
||||
* A negative duration is interpreted as the maximum possible, which for our
|
||||
* purposes means infinite wait.
|
||||
*/
|
||||
int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout,
|
||||
int duration, unsigned long flags)
|
||||
u32 duration, unsigned long flags)
|
||||
{
|
||||
if (flags & ~NVGPU_TIMER_FLAG_MASK)
|
||||
return -EINVAL;
|
||||
@@ -69,9 +66,6 @@ int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout,
|
||||
timeout->g = g;
|
||||
timeout->flags = flags;
|
||||
|
||||
if (duration < 0)
|
||||
duration = INT_MAX;
|
||||
|
||||
if (flags & NVGPU_TIMER_RETRY_TIMER)
|
||||
timeout->retries.max = duration;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user