summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2015-10-12 08:39:43 -0400
committerIshan Mittal <imittal@nvidia.com>2015-10-20 02:52:50 -0400
commit0269339256dee0a8fcd2d6aa1180780039f22fab (patch)
tree190fe62ff3ef4716a6d69259c0c5ca2394301022 /drivers
parentda8ff40e55c498f2ca24d446d45cda9d4d83bbcf (diff)
gpu: nvgpu: restart timer instead of cancel
In gk20a_fifo_handle_sched_error(), we currently cancel the timeout on all the channels But this could cause us to miss one of stuck channel hence, instead of cancelling, restart the timeout of channel on which it is already active Bug 200133289 Change-Id: I40e7e0e5394911fc110ab6fde39592b885dfaf7d Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/816133 Reviewed-by: Ishan Mittal <imittal@nvidia.com> Tested-by: Ishan Mittal <imittal@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c17
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.c4
3 files changed, 18 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 6f0d7375..34b62ac4 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -1574,7 +1574,7 @@ static void gk20a_channel_timeout_stop(struct channel_gk20a *ch)
1574 mutex_unlock(&ch->timeout.lock); 1574 mutex_unlock(&ch->timeout.lock);
1575} 1575}
1576 1576
1577void gk20a_channel_timeout_stop_all_channels(struct gk20a *g) 1577void gk20a_channel_timeout_restart_all_channels(struct gk20a *g)
1578{ 1578{
1579 u32 chid; 1579 u32 chid;
1580 struct fifo_gk20a *f = &g->fifo; 1580 struct fifo_gk20a *f = &g->fifo;
@@ -1583,7 +1583,20 @@ void gk20a_channel_timeout_stop_all_channels(struct gk20a *g)
1583 struct channel_gk20a *ch = &f->channel[chid]; 1583 struct channel_gk20a *ch = &f->channel[chid];
1584 1584
1585 if (gk20a_channel_get(ch)) { 1585 if (gk20a_channel_get(ch)) {
1586 gk20a_channel_timeout_stop(ch); 1586 mutex_lock(&ch->timeout.lock);
1587 if (!ch->timeout.initialized) {
1588 mutex_unlock(&ch->timeout.lock);
1589 gk20a_channel_put(ch);
1590 continue;
1591 }
1592 mutex_unlock(&ch->timeout.lock);
1593
1594 cancel_delayed_work_sync(&ch->timeout.wq);
1595 if (!ch->has_timedout)
1596 schedule_delayed_work(&ch->timeout.wq,
1597 msecs_to_jiffies(
1598 gk20a_get_channel_watchdog_timeout(ch)));
1599
1587 gk20a_channel_put(ch); 1600 gk20a_channel_put(ch);
1588 } 1601 }
1589 } 1602 }
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h
index 280c50b1..3e18e053 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h
@@ -256,5 +256,5 @@ void channel_gk20a_free_inst(struct gk20a *g, struct channel_gk20a *ch);
256int channel_gk20a_setup_ramfc(struct channel_gk20a *c, 256int channel_gk20a_setup_ramfc(struct channel_gk20a *c,
257 u64 gpfifo_base, u32 gpfifo_entries, u32 flags); 257 u64 gpfifo_base, u32 gpfifo_entries, u32 flags);
258void channel_gk20a_enable(struct channel_gk20a *ch); 258void channel_gk20a_enable(struct channel_gk20a *ch);
259void gk20a_channel_timeout_stop_all_channels(struct gk20a *g); 259void gk20a_channel_timeout_restart_all_channels(struct gk20a *g);
260#endif /* CHANNEL_GK20A_H */ 260#endif /* CHANNEL_GK20A_H */
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
index ad7162fc..a035cd87 100644
--- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
@@ -1450,7 +1450,7 @@ static bool gk20a_fifo_handle_sched_error(struct gk20a *g)
1450 struct channel_gk20a *ch = &f->channel[id]; 1450 struct channel_gk20a *ch = &f->channel[id];
1451 1451
1452 if (is_tsg) { 1452 if (is_tsg) {
1453 gk20a_channel_timeout_stop_all_channels(g); 1453 gk20a_channel_timeout_restart_all_channels(g);
1454 gk20a_fifo_recover(g, BIT(engine_id), id, true, 1454 gk20a_fifo_recover(g, BIT(engine_id), id, true,
1455 true, true); 1455 true, true);
1456 ret = true; 1456 ret = true;
@@ -1472,7 +1472,7 @@ static bool gk20a_fifo_handle_sched_error(struct gk20a *g)
1472 * Cancel all channels' timeout since SCHED error might 1472 * Cancel all channels' timeout since SCHED error might
1473 * trigger multiple watchdogs at a time 1473 * trigger multiple watchdogs at a time
1474 */ 1474 */
1475 gk20a_channel_timeout_stop_all_channels(g); 1475 gk20a_channel_timeout_restart_all_channels(g);
1476 gk20a_fifo_recover(g, BIT(engine_id), id, false, 1476 gk20a_fifo_recover(g, BIT(engine_id), id, false,
1477 true, ch->timeout_debug_dump); 1477 true, ch->timeout_debug_dump);
1478 ret = true; 1478 ret = true;