diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index f9b9c6e6..5cd7223f 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -61,8 +61,6 @@ static void channel_gk20a_joblist_delete(struct channel_gk20a *c, | |||
61 | static struct channel_gk20a_job *channel_gk20a_joblist_peek( | 61 | static struct channel_gk20a_job *channel_gk20a_joblist_peek( |
62 | struct channel_gk20a *c); | 62 | struct channel_gk20a *c); |
63 | 63 | ||
64 | static u32 gk20a_get_channel_watchdog_timeout(struct channel_gk20a *ch); | ||
65 | |||
66 | /* allocate GPU channel */ | 64 | /* allocate GPU channel */ |
67 | static struct channel_gk20a *allocate_channel(struct fifo_gk20a *f) | 65 | static struct channel_gk20a *allocate_channel(struct fifo_gk20a *f) |
68 | { | 66 | { |
@@ -696,14 +694,19 @@ struct channel_gk20a *gk20a_open_new_channel(struct gk20a *g, | |||
696 | /* By default, channel is regular (non-TSG) channel */ | 694 | /* By default, channel is regular (non-TSG) channel */ |
697 | ch->tsgid = NVGPU_INVALID_TSG_ID; | 695 | ch->tsgid = NVGPU_INVALID_TSG_ID; |
698 | 696 | ||
699 | /* reset timeout counter and update timestamp */ | 697 | /* clear ctxsw timeout counter and update timestamp */ |
700 | ch->timeout_accumulated_ms = 0; | 698 | ch->timeout_accumulated_ms = 0; |
701 | ch->timeout_gpfifo_get = 0; | 699 | ch->timeout_gpfifo_get = 0; |
702 | /* set gr host default timeout */ | 700 | /* set gr host default timeout */ |
703 | ch->timeout_ms_max = gk20a_get_gr_idle_timeout(g); | 701 | ch->timeout_ms_max = gk20a_get_gr_idle_timeout(g); |
704 | ch->timeout_debug_dump = true; | 702 | ch->timeout_debug_dump = true; |
705 | ch->has_timedout = false; | 703 | ch->has_timedout = false; |
706 | ch->wdt_enabled = true; | 704 | |
705 | /* init kernel watchdog timeout */ | ||
706 | ch->timeout.enabled = true; | ||
707 | ch->timeout.limit_ms = g->ch_wdt_timeout_ms; | ||
708 | ch->timeout.debug_dump = true; | ||
709 | |||
707 | ch->obj_class = 0; | 710 | ch->obj_class = 0; |
708 | ch->subctx_id = 0; | 711 | ch->subctx_id = 0; |
709 | ch->runqueue_sel = 0; | 712 | ch->runqueue_sel = 0; |
@@ -1166,10 +1169,10 @@ int gk20a_channel_alloc_gpfifo(struct channel_gk20a *c, | |||
1166 | } | 1169 | } |
1167 | } | 1170 | } |
1168 | 1171 | ||
1169 | if (!c->g->timeouts_enabled || !c->wdt_enabled) | 1172 | if (!c->g->timeouts_enabled || !c->timeout.enabled) |
1170 | acquire_timeout = 0; | 1173 | acquire_timeout = 0; |
1171 | else | 1174 | else |
1172 | acquire_timeout = gk20a_get_channel_watchdog_timeout(c); | 1175 | acquire_timeout = c->timeout.limit_ms; |
1173 | 1176 | ||
1174 | err = g->ops.fifo.setup_ramfc(c, c->gpfifo.mem.gpu_va, | 1177 | err = g->ops.fifo.setup_ramfc(c, c->gpfifo.mem.gpu_va, |
1175 | c->gpfifo.entry_num, | 1178 | c->gpfifo.entry_num, |
@@ -1265,11 +1268,6 @@ bool gk20a_channel_update_and_check_timeout(struct channel_gk20a *ch, | |||
1265 | ch->timeout_accumulated_ms > ch->timeout_ms_max; | 1268 | ch->timeout_accumulated_ms > ch->timeout_ms_max; |
1266 | } | 1269 | } |
1267 | 1270 | ||
1268 | static u32 gk20a_get_channel_watchdog_timeout(struct channel_gk20a *ch) | ||
1269 | { | ||
1270 | return ch->g->ch_wdt_timeout_ms; | ||
1271 | } | ||
1272 | |||
1273 | u32 nvgpu_get_gp_free_count(struct channel_gk20a *c) | 1271 | u32 nvgpu_get_gp_free_count(struct channel_gk20a *c) |
1274 | { | 1272 | { |
1275 | update_gp_get(c->g, c); | 1273 | update_gp_get(c->g, c); |
@@ -1282,7 +1280,7 @@ static void __gk20a_channel_timeout_start(struct channel_gk20a *ch) | |||
1282 | ch->timeout.pb_get = ch->g->ops.fifo.userd_pb_get(ch->g, ch); | 1280 | ch->timeout.pb_get = ch->g->ops.fifo.userd_pb_get(ch->g, ch); |
1283 | ch->timeout.running = true; | 1281 | ch->timeout.running = true; |
1284 | nvgpu_timeout_init(ch->g, &ch->timeout.timer, | 1282 | nvgpu_timeout_init(ch->g, &ch->timeout.timer, |
1285 | gk20a_get_channel_watchdog_timeout(ch), | 1283 | ch->timeout.limit_ms, |
1286 | NVGPU_TIMER_CPU_TIMER); | 1284 | NVGPU_TIMER_CPU_TIMER); |
1287 | } | 1285 | } |
1288 | 1286 | ||
@@ -1303,10 +1301,10 @@ static void __gk20a_channel_timeout_start(struct channel_gk20a *ch) | |||
1303 | */ | 1301 | */ |
1304 | static void gk20a_channel_timeout_start(struct channel_gk20a *ch) | 1302 | static void gk20a_channel_timeout_start(struct channel_gk20a *ch) |
1305 | { | 1303 | { |
1306 | if (!ch->g->timeouts_enabled || !gk20a_get_channel_watchdog_timeout(ch)) | 1304 | if (!ch->g->timeouts_enabled) |
1307 | return; | 1305 | return; |
1308 | 1306 | ||
1309 | if (!ch->wdt_enabled) | 1307 | if (!ch->timeout.enabled) |
1310 | return; | 1308 | return; |
1311 | 1309 | ||
1312 | nvgpu_raw_spinlock_acquire(&ch->timeout.lock); | 1310 | nvgpu_raw_spinlock_acquire(&ch->timeout.lock); |
@@ -1425,11 +1423,13 @@ static void gk20a_channel_timeout_handler(struct channel_gk20a *ch) | |||
1425 | nvgpu_err(g, "Job on channel %d timed out", | 1423 | nvgpu_err(g, "Job on channel %d timed out", |
1426 | ch->chid); | 1424 | ch->chid); |
1427 | 1425 | ||
1428 | gk20a_debug_dump(g); | 1426 | /* force reset calls gk20a_debug_dump but not this */ |
1429 | gk20a_gr_debug_dump(g); | 1427 | if (ch->timeout.debug_dump) |
1428 | gk20a_gr_debug_dump(g); | ||
1430 | 1429 | ||
1431 | g->ops.fifo.force_reset_ch(ch, | 1430 | g->ops.fifo.force_reset_ch(ch, |
1432 | NVGPU_ERR_NOTIFIER_FIFO_ERROR_IDLE_TIMEOUT, true); | 1431 | NVGPU_ERR_NOTIFIER_FIFO_ERROR_IDLE_TIMEOUT, |
1432 | ch->timeout.debug_dump); | ||
1433 | } | 1433 | } |
1434 | 1434 | ||
1435 | /** | 1435 | /** |