summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 15170820..7b5013ea 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -1038,6 +1038,8 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force)
1038 ch->update_fn_data = NULL; 1038 ch->update_fn_data = NULL;
1039 spin_unlock(&ch->update_fn_lock); 1039 spin_unlock(&ch->update_fn_lock);
1040 cancel_work_sync(&ch->update_fn_work); 1040 cancel_work_sync(&ch->update_fn_work);
1041 cancel_delayed_work_sync(&ch->clean_up.wq);
1042 cancel_delayed_work_sync(&ch->timeout.wq);
1041 1043
1042 /* make sure we don't have deferred interrupts pending that 1044 /* make sure we don't have deferred interrupts pending that
1043 * could still touch the channel */ 1045 * could still touch the channel */
@@ -1177,8 +1179,7 @@ int gk20a_channel_release(struct inode *inode, struct file *filp)
1177 1179
1178 err = gk20a_busy(g->dev); 1180 err = gk20a_busy(g->dev);
1179 if (err) { 1181 if (err) {
1180 gk20a_err(dev_from_gk20a(g), "failed to release channel %d", 1182 gk20a_err(dev_from_gk20a(g), "failed to release a channel!");
1181 ch->hw_chid);
1182 return err; 1183 return err;
1183 } 1184 }
1184 1185
@@ -2108,6 +2109,11 @@ static void gk20a_channel_timeout_handler(struct work_struct *work)
2108 2109
2109 g = ch->g; 2110 g = ch->g;
2110 2111
2112 if (gk20a_busy(dev_from_gk20a(g))) {
2113 gk20a_channel_put(ch);
2114 return;
2115 }
2116
2111 /* Need global lock since multiple channels can timeout at a time */ 2117 /* Need global lock since multiple channels can timeout at a time */
2112 mutex_lock(&g->ch_wdt_lock); 2118 mutex_lock(&g->ch_wdt_lock);
2113 2119
@@ -2139,6 +2145,7 @@ static void gk20a_channel_timeout_handler(struct work_struct *work)
2139fail_unlock: 2145fail_unlock:
2140 mutex_unlock(&g->ch_wdt_lock); 2146 mutex_unlock(&g->ch_wdt_lock);
2141 gk20a_channel_put(ch); 2147 gk20a_channel_put(ch);
2148 gk20a_idle(dev_from_gk20a(g));
2142} 2149}
2143 2150
2144int gk20a_free_priv_cmdbuf(struct channel_gk20a *c, struct priv_cmd_entry *e) 2151int gk20a_free_priv_cmdbuf(struct channel_gk20a *c, struct priv_cmd_entry *e)