diff --git a/drivers/gpu/nvgpu/include/nvgpu/timers.h b/drivers/gpu/nvgpu/include/nvgpu/timers.h index fcde49169..7ce26116e 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/timers.h +++ b/drivers/gpu/nvgpu/include/nvgpu/timers.h @@ -59,7 +59,7 @@ struct nvgpu_timeout { union { s64 time; struct { - u32 max; + u32 max_attempts; u32 attempted; } retries; }; diff --git a/drivers/gpu/nvgpu/os/linux/timers.c b/drivers/gpu/nvgpu/os/linux/timers.c index af52277f4..e1051dfc7 100644 --- a/drivers/gpu/nvgpu/os/linux/timers.c +++ b/drivers/gpu/nvgpu/os/linux/timers.c @@ -67,7 +67,7 @@ int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout, timeout->flags = flags; if (flags & NVGPU_TIMER_RETRY_TIMER) - timeout->retries.max = duration; + timeout->retries.max_attempts = duration; else timeout->time = ktime_to_ns(ktime_add_ns(ktime_get(), (s64)NSEC_PER_MSEC * duration)); @@ -109,7 +109,7 @@ static int nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout, if (nvgpu_timeout_is_pre_silicon(timeout)) return 0; - if (timeout->retries.attempted >= timeout->retries.max) { + if (timeout->retries.attempted >= timeout->retries.max_attempts) { if (!(timeout->flags & NVGPU_TIMER_SILENT_TIMEOUT)) { char buf[128]; @@ -173,7 +173,8 @@ int nvgpu_timeout_peek_expired(struct nvgpu_timeout *timeout) return 0; if (timeout->flags & NVGPU_TIMER_RETRY_TIMER) - return timeout->retries.attempted >= timeout->retries.max; + return timeout->retries.attempted >= + timeout->retries.max_attempts; else return ktime_after(ktime_get(), ns_to_ktime(timeout->time)); } diff --git a/drivers/gpu/nvgpu/os/posix/timers.c b/drivers/gpu/nvgpu/os/posix/timers.c index a30ff052d..2c159c1c6 100644 --- a/drivers/gpu/nvgpu/os/posix/timers.c +++ b/drivers/gpu/nvgpu/os/posix/timers.c @@ -85,7 +85,7 @@ int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout, timeout->flags = (unsigned int)flags; if ((flags & NVGPU_TIMER_RETRY_TIMER) != 0U) { - timeout->retries.max = duration; + timeout->retries.max_attempts = duration; } else { duration_ns = (s64)duration; duration_ns *= NSEC_PER_MSEC; @@ -122,7 +122,7 @@ static int nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout, { struct gk20a *g = timeout->g; - if (timeout->retries.attempted >= timeout->retries.max) { + if (timeout->retries.attempted >= timeout->retries.max_attempts) { if ((timeout->flags & NVGPU_TIMER_SILENT_TIMEOUT) == 0U) { char buf[128]; @@ -162,7 +162,7 @@ int nvgpu_timeout_peek_expired(struct nvgpu_timeout *timeout) { if ((timeout->flags & NVGPU_TIMER_RETRY_TIMER) != 0U) { return (int) (timeout->retries.attempted >= - timeout->retries.max); + timeout->retries.max_attempts); } else { return (int) (time_after(get_time_ns(), timeout->time)); }