summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorSeema Khowala <seemaj@nvidia.com>2017-10-30 17:15:51 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-18 22:54:33 -0400
commit982fcfa737be54fd0ab16792faf97a2741e34907 (patch)
tree6c45741a08156d43d2ea09a4136c104609989e42 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parentac687c95d383c3fb0165e6535893510409559a8e (diff)
gpu: nvgpu: Add timeouts_disabled_refcount for enabling timeout
-timeouts will be enabled only when timeouts_disabled_refcount will reach 0 -timeouts_enabled debugfs will change from u32 type to file type to avoid race enabling/disabling timeout from debugfs and ioctl -unify setting timeouts_enabled from debugfs and ioctl Bug 1982434 Change-Id: I54bab778f1ae533872146dfb8d80deafd2a685c7 Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1588690 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index a4637b8f..45ce0e77 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -1158,7 +1158,7 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c,
1158 } 1158 }
1159 } 1159 }
1160 1160
1161 if (!c->g->timeouts_enabled || !c->timeout.enabled) 1161 if (!nvgpu_is_timeouts_enabled(c->g) || !c->timeout.enabled)
1162 acquire_timeout = 0; 1162 acquire_timeout = 0;
1163 else 1163 else
1164 acquire_timeout = c->timeout.limit_ms; 1164 acquire_timeout = c->timeout.limit_ms;
@@ -1266,7 +1266,7 @@ bool gk20a_channel_update_and_check_timeout(struct channel_gk20a *ch,
1266 1266
1267 ch->timeout_gpfifo_get = gpfifo_get; 1267 ch->timeout_gpfifo_get = gpfifo_get;
1268 1268
1269 return ch->g->timeouts_enabled && 1269 return nvgpu_is_timeouts_enabled(ch->g) &&
1270 ch->timeout_accumulated_ms > ch->timeout_ms_max; 1270 ch->timeout_accumulated_ms > ch->timeout_ms_max;
1271} 1271}
1272 1272
@@ -1303,7 +1303,7 @@ static void __gk20a_channel_timeout_start(struct channel_gk20a *ch)
1303 */ 1303 */
1304static void gk20a_channel_timeout_start(struct channel_gk20a *ch) 1304static void gk20a_channel_timeout_start(struct channel_gk20a *ch)
1305{ 1305{
1306 if (!ch->g->timeouts_enabled) 1306 if (!nvgpu_is_timeouts_enabled(ch->g))
1307 return; 1307 return;
1308 1308
1309 if (!ch->timeout.enabled) 1309 if (!ch->timeout.enabled)