summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.c8
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.c14
2 files changed, 17 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
index 8e78b95e..9eb2204d 100644
--- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
@@ -1918,9 +1918,11 @@ int gk20a_fifo_tsg_unbind_channel_verify_status(struct channel_gk20a *ch)
1918 if (g->ops.fifo.tsg_verify_status_faulted) 1918 if (g->ops.fifo.tsg_verify_status_faulted)
1919 g->ops.fifo.tsg_verify_status_faulted(ch); 1919 g->ops.fifo.tsg_verify_status_faulted(ch);
1920 1920
1921 if (gk20a_fifo_channel_status_is_next(g, ch->chid)) 1921 if (gk20a_fifo_channel_status_is_next(g, ch->chid)) {
1922 nvgpu_err(g, "Channel %d to be removed from TSG has NEXT set!", 1922 nvgpu_err(g, "Channel %d to be removed from TSG %d has NEXT set!",
1923 ch->chid); 1923 ch->chid, ch->tsgid);
1924 return -EINVAL;
1925 }
1924 1926
1925 return 0; 1927 return 0;
1926} 1928}
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;