mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
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>
This commit is contained in:
committed by
Dan Willemsen
parent
73720d2429
commit
45db2436c4
@@ -626,7 +626,7 @@ void gk20a_free_channel(struct channel_gk20a *ch, bool finish)
|
||||
if (!ch->bound)
|
||||
return;
|
||||
|
||||
if (!gk20a_channel_as_bound(ch) && !ch->vm)
|
||||
if (!gk20a_channel_as_bound(ch))
|
||||
goto unbind;
|
||||
|
||||
gk20a_dbg_info("freeing bound channel context, timeout=%ld",
|
||||
@@ -1122,12 +1122,11 @@ int gk20a_alloc_channel_gpfifo(struct channel_gk20a *c,
|
||||
if (args->flags & NVHOST_ALLOC_GPFIFO_FLAGS_VPR_ENABLED)
|
||||
c->vpr = true;
|
||||
|
||||
/* an address space needs to have been bound at this point. */
|
||||
/* an address space needs to have been bound at this point. */
|
||||
if (!gk20a_channel_as_bound(c)) {
|
||||
gk20a_err(d,
|
||||
"not bound to an address space at time of gpfifo"
|
||||
" allocation. Attempting to create and bind to"
|
||||
" one...");
|
||||
" allocation.");
|
||||
return -EINVAL;
|
||||
}
|
||||
ch_vm = c->vm;
|
||||
@@ -1525,6 +1524,14 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
|
||||
!fence)
|
||||
return -EINVAL;
|
||||
|
||||
/* an address space needs to have been bound at this point. */
|
||||
if (!gk20a_channel_as_bound(c)) {
|
||||
gk20a_err(d,
|
||||
"not bound to an address space at time of gpfifo"
|
||||
" submission.");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
/* update debug settings */
|
||||
if (g->ops.ltc.sync_debugfs)
|
||||
|
||||
Reference in New Issue
Block a user