diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 17 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 4 |
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 | ||
1577 | void gk20a_channel_timeout_stop_all_channels(struct gk20a *g) | 1577 | void 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); | |||
256 | int channel_gk20a_setup_ramfc(struct channel_gk20a *c, | 256 | int 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); |
258 | void channel_gk20a_enable(struct channel_gk20a *ch); | 258 | void channel_gk20a_enable(struct channel_gk20a *ch); |
259 | void gk20a_channel_timeout_stop_all_channels(struct gk20a *g); | 259 | void 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; |