summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/fifo/channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/fifo/channel.c')
-rw-r--r--drivers/gpu/nvgpu/common/fifo/channel.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c
index 4b76dcdd..d30b8ded 100644
--- a/drivers/gpu/nvgpu/common/fifo/channel.c
+++ b/drivers/gpu/nvgpu/common/fifo/channel.c
@@ -326,7 +326,12 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force)
326 */ 326 */
327 if (!nvgpu_is_enabled(g, NVGPU_DRIVER_IS_DYING)) { 327 if (!nvgpu_is_enabled(g, NVGPU_DRIVER_IS_DYING)) {
328 /* abort channel and remove from runlist */ 328 /* abort channel and remove from runlist */
329 if (gk20a_is_channel_marked_as_tsg(ch)) { 329 if (tsg_gk20a_from_ch(ch) != NULL) {
330 /* Between tsg is not null and unbind_channel call,
331 * ioctl cannot be called anymore because user doesn't
332 * have an open channel fd anymore to use for the unbind
333 * ioctl.
334 */
330 err = gk20a_tsg_unbind_channel(ch); 335 err = gk20a_tsg_unbind_channel(ch);
331 if (err) { 336 if (err) {
332 nvgpu_err(g, 337 nvgpu_err(g,
@@ -2264,7 +2269,7 @@ int gk20a_init_channel_support(struct gk20a *g, u32 chid)
2264 if (err) { 2269 if (err) {
2265 goto fail_6; 2270 goto fail_6;
2266 } 2271 }
2267 2272 nvgpu_init_list_node(&c->ch_entry);
2268 nvgpu_list_add(&c->free_chs, &g->fifo.free_chs); 2273 nvgpu_list_add(&c->free_chs, &g->fifo.free_chs);
2269 2274
2270 return 0; 2275 return 0;
@@ -2403,10 +2408,9 @@ void gk20a_channel_semaphore_wakeup(struct gk20a *g, bool post_events)
2403 nvgpu_cond_broadcast_interruptible( 2408 nvgpu_cond_broadcast_interruptible(
2404 &c->semaphore_wq); 2409 &c->semaphore_wq);
2405 if (post_events) { 2410 if (post_events) {
2406 if (gk20a_is_channel_marked_as_tsg(c)) { 2411 struct tsg_gk20a *tsg =
2407 struct tsg_gk20a *tsg = 2412 tsg_gk20a_from_ch(c);
2408 &g->fifo.tsg[c->tsgid]; 2413 if (tsg != NULL) {
2409
2410 g->ops.fifo.post_event_id(tsg, 2414 g->ops.fifo.post_event_id(tsg,
2411 NVGPU_EVENT_ID_BLOCKING_SYNC); 2415 NVGPU_EVENT_ID_BLOCKING_SYNC);
2412 } 2416 }