summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Daifuku <pdaifuku@nvidia.com>2019-10-08 17:36:37 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2019-10-14 22:09:43 -0400
commit56f8e5b878348d1ac7f0b133d395808e0caed769 (patch)
tree36952860d0e79b74dbab7be6869f1e22bf5260ea
parent12202fbdcfd73129b5bc582473fa6a8a93306de7 (diff)
gpu: nvgpu: channel_setup_bind: must be bound to TSG
In nvgpu_channel_setup_bind, return an error if the channel isn't bound to a TSG, as future operations rely on being bound. Bug 200543218 Change-Id: If33b01b8176c7488445c23080ad9d11f341bff43 Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2215160 Reviewed-by: Thomas Fleury <tfleury@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Luis Dib <ldib@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/common/fifo/channel.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c
index 6ebeb596..0f4fe850 100644
--- a/drivers/gpu/nvgpu/common/fifo/channel.c
+++ b/drivers/gpu/nvgpu/common/fifo/channel.c
@@ -1136,6 +1136,7 @@ int nvgpu_channel_setup_bind(struct channel_gk20a *c,
1136{ 1136{
1137 struct gk20a *g = c->g; 1137 struct gk20a *g = c->g;
1138 struct vm_gk20a *ch_vm; 1138 struct vm_gk20a *ch_vm;
1139 struct tsg_gk20a *tsg;
1139 u32 gpfifo_size, gpfifo_entry_size; 1140 u32 gpfifo_size, gpfifo_entry_size;
1140 u64 gpfifo_gpu_va; 1141 u64 gpfifo_gpu_va;
1141 int err = 0; 1142 int err = 0;
@@ -1176,6 +1177,16 @@ int nvgpu_channel_setup_bind(struct channel_gk20a *c,
1176 err = -EINVAL; 1177 err = -EINVAL;
1177 goto clean_up_idle; 1178 goto clean_up_idle;
1178 } 1179 }
1180
1181 /* The channel needs to be bound to a tsg at this point */
1182 tsg = tsg_gk20a_from_ch(c);
1183 if (tsg == NULL) {
1184 nvgpu_err(g,
1185 "not bound to tsg at time of setup_bind");
1186 err = -EINVAL;
1187 goto clean_up_idle;
1188 }
1189
1179 ch_vm = c->vm; 1190 ch_vm = c->vm;
1180 1191
1181 if (nvgpu_mem_is_valid(&c->gpfifo.mem) || 1192 if (nvgpu_mem_is_valid(&c->gpfifo.mem) ||