From 982fcfa737be54fd0ab16792faf97a2741e34907 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Mon, 30 Oct 2017 14:15:51 -0700 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1588690 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') 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, } } - if (!c->g->timeouts_enabled || !c->timeout.enabled) + if (!nvgpu_is_timeouts_enabled(c->g) || !c->timeout.enabled) acquire_timeout = 0; else acquire_timeout = c->timeout.limit_ms; @@ -1266,7 +1266,7 @@ bool gk20a_channel_update_and_check_timeout(struct channel_gk20a *ch, ch->timeout_gpfifo_get = gpfifo_get; - return ch->g->timeouts_enabled && + return nvgpu_is_timeouts_enabled(ch->g) && ch->timeout_accumulated_ms > ch->timeout_ms_max; } @@ -1303,7 +1303,7 @@ static void __gk20a_channel_timeout_start(struct channel_gk20a *ch) */ static void gk20a_channel_timeout_start(struct channel_gk20a *ch) { - if (!ch->g->timeouts_enabled) + if (!nvgpu_is_timeouts_enabled(ch->g)) return; if (!ch->timeout.enabled) -- cgit v1.2.2