summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/tsg_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
index e285f96c..6c1c2955 100644
--- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
@@ -150,8 +150,18 @@ int gk20a_tsg_unbind_channel(struct channel_gk20a *ch)
150 int err; 150 int err;
151 151
152 err = gk20a_fifo_tsg_unbind_channel(ch); 152 err = gk20a_fifo_tsg_unbind_channel(ch);
153 if (err) 153 if (err) {
154 return err; 154 nvgpu_err(g, "Channel %d unbind failed, tearing down TSG %d",
155 ch->chid, tsg->tsgid);
156
157 gk20a_fifo_abort_tsg(ch->g, ch->tsgid, true);
158 /* If channel unbind fails, channel is still part of runlist */
159 channel_gk20a_update_runlist(ch, false);
160
161 down_write(&tsg->ch_list_lock);
162 nvgpu_list_del(&ch->ch_entry);
163 up_write(&tsg->ch_list_lock);
164 }
155 165
156 nvgpu_ref_put(&tsg->refcount, gk20a_tsg_release); 166 nvgpu_ref_put(&tsg->refcount, gk20a_tsg_release);
157 ch->tsgid = NVGPU_INVALID_TSG_ID; 167 ch->tsgid = NVGPU_INVALID_TSG_ID;