diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 15 |
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) |