summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r--drivers/gpu/nvgpu/common/linux/channel.c4
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_channel.c19
2 files changed, 17 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/channel.c b/drivers/gpu/nvgpu/common/linux/channel.c
index 8bfa4cfc..ea294738 100644
--- a/drivers/gpu/nvgpu/common/linux/channel.c
+++ b/drivers/gpu/nvgpu/common/linux/channel.c
@@ -753,7 +753,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
753 */ 753 */
754 need_job_tracking = (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_WAIT) || 754 need_job_tracking = (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_WAIT) ||
755 (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_GET) || 755 (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_GET) ||
756 c->wdt_enabled || 756 c->timeout.enabled ||
757 (g->can_railgate && !c->deterministic) || 757 (g->can_railgate && !c->deterministic) ||
758 !skip_buffer_refcounting; 758 !skip_buffer_refcounting;
759 759
@@ -791,7 +791,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
791 */ 791 */
792 need_deferred_cleanup = !c->deterministic || 792 need_deferred_cleanup = !c->deterministic ||
793 need_sync_framework || 793 need_sync_framework ||
794 c->wdt_enabled || 794 c->timeout.enabled ||
795 (g->can_railgate && 795 (g->can_railgate &&
796 !c->deterministic) || 796 !c->deterministic) ||
797 !skip_buffer_refcounting; 797 !skip_buffer_refcounting;
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
index 0acaa61d..01355b78 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c
@@ -319,10 +319,21 @@ static int gk20a_channel_cycle_stats_snapshot(struct channel_gk20a *ch,
319static int gk20a_channel_set_wdt_status(struct channel_gk20a *ch, 319static int gk20a_channel_set_wdt_status(struct channel_gk20a *ch,
320 struct nvgpu_channel_wdt_args *args) 320 struct nvgpu_channel_wdt_args *args)
321{ 321{
322 if (args->wdt_status == NVGPU_IOCTL_CHANNEL_DISABLE_WDT) 322 u32 status = args->wdt_status & (NVGPU_IOCTL_CHANNEL_DISABLE_WDT |
323 ch->wdt_enabled = false; 323 NVGPU_IOCTL_CHANNEL_ENABLE_WDT);
324 else if (args->wdt_status == NVGPU_IOCTL_CHANNEL_ENABLE_WDT) 324
325 ch->wdt_enabled = true; 325 if (status == NVGPU_IOCTL_CHANNEL_DISABLE_WDT)
326 ch->timeout.enabled = false;
327 else if (status == NVGPU_IOCTL_CHANNEL_ENABLE_WDT)
328 ch->timeout.enabled = true;
329 else
330 return -EINVAL;
331
332 if (args->wdt_status & NVGPU_IOCTL_CHANNEL_WDT_FLAG_SET_TIMEOUT)
333 ch->timeout.limit_ms = args->timeout_ms;
334
335 ch->timeout.debug_dump = (args->wdt_status &
336 NVGPU_IOCTL_CHANNEL_WDT_FLAG_DISABLE_DUMP) == 0;
326 337
327 return 0; 338 return 0;
328} 339}