summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2014-09-25 07:25:27 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:26 -0400
commit45db2436c40335a91c92f95509c6741ad13f6142 (patch)
tree4e281cf6f1137769033d50316b4237727b4374f1 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parent73720d2429b9d5aa43064e3141b747fef66db45d (diff)
gpu: nvgpu: require bound as before gpfifo submit
Channel gpfifo cannot be submitted if the channel has no vm, so add a check for it and bail out if no as is bound. Clean up other similar checks too. Change-Id: Ibb0fe08e44e34bbaaa00ebd02dce6cc4d93ca5d9 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/538887 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 0b3b0202..fdeb8265 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -626,7 +626,7 @@ void gk20a_free_channel(struct channel_gk20a *ch, bool finish)
626 if (!ch->bound) 626 if (!ch->bound)
627 return; 627 return;
628 628
629 if (!gk20a_channel_as_bound(ch) && !ch->vm) 629 if (!gk20a_channel_as_bound(ch))
630 goto unbind; 630 goto unbind;
631 631
632 gk20a_dbg_info("freeing bound channel context, timeout=%ld", 632 gk20a_dbg_info("freeing bound channel context, timeout=%ld",
@@ -1122,12 +1122,11 @@ int gk20a_alloc_channel_gpfifo(struct channel_gk20a *c,
1122 if (args->flags & NVHOST_ALLOC_GPFIFO_FLAGS_VPR_ENABLED) 1122 if (args->flags & NVHOST_ALLOC_GPFIFO_FLAGS_VPR_ENABLED)
1123 c->vpr = true; 1123 c->vpr = true;
1124 1124
1125 /* an address space needs to have been bound at this point. */ 1125 /* an address space needs to have been bound at this point. */
1126 if (!gk20a_channel_as_bound(c)) { 1126 if (!gk20a_channel_as_bound(c)) {
1127 gk20a_err(d, 1127 gk20a_err(d,
1128 "not bound to an address space at time of gpfifo" 1128 "not bound to an address space at time of gpfifo"
1129 " allocation. Attempting to create and bind to" 1129 " allocation.");
1130 " one...");
1131 return -EINVAL; 1130 return -EINVAL;
1132 } 1131 }
1133 ch_vm = c->vm; 1132 ch_vm = c->vm;
@@ -1525,6 +1524,14 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
1525 !fence) 1524 !fence)
1526 return -EINVAL; 1525 return -EINVAL;
1527 1526
1527 /* an address space needs to have been bound at this point. */
1528 if (!gk20a_channel_as_bound(c)) {
1529 gk20a_err(d,
1530 "not bound to an address space at time of gpfifo"
1531 " submission.");
1532 return -EINVAL;
1533 }
1534
1528#ifdef CONFIG_DEBUG_FS 1535#ifdef CONFIG_DEBUG_FS
1529 /* update debug settings */ 1536 /* update debug settings */
1530 if (g->ops.ltc.sync_debugfs) 1537 if (g->ops.ltc.sync_debugfs)