summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2017-05-19 08:25:44 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-24 15:14:19 -0400
commitf0444184278c356735420f0f88da744bf7adcdf7 (patch)
tree40d38508ae7593f45866c938079dfa0c0b5ae7bc /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parentb70bad4b9f40e94f731fd9d509e1f3f6617f0b05 (diff)
gpu: nvgpu: Track also pushbuf get for watchdog
Make the watchdog notice also fine-grained changes within a single pushbuffer - by tracking just the gpfifo get, the watchdog could wake when the channel hasn't really been stuck but processing a relatively large or slow pushbuf. Jira NVGPU-72 Change-Id: I15374eea5d9abc9d3725a79d0b960503237e478c Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1485919 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 4ee1ab43..ab6b8ec1 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -1482,6 +1482,7 @@ static void trace_write_pushbuffer_range(struct channel_gk20a *c,
1482static void __gk20a_channel_timeout_start(struct channel_gk20a *ch) 1482static void __gk20a_channel_timeout_start(struct channel_gk20a *ch)
1483{ 1483{
1484 ch->timeout.gp_get = ch->g->ops.fifo.userd_gp_get(ch->g, ch); 1484 ch->timeout.gp_get = ch->g->ops.fifo.userd_gp_get(ch->g, ch);
1485 ch->timeout.pb_get = ch->g->ops.fifo.userd_pb_get(ch->g, ch);
1485 ch->timeout.running = true; 1486 ch->timeout.running = true;
1486 nvgpu_timeout_init(ch->g, &ch->timeout.timer, 1487 nvgpu_timeout_init(ch->g, &ch->timeout.timer,
1487 gk20a_get_channel_watchdog_timeout(ch), 1488 gk20a_get_channel_watchdog_timeout(ch),
@@ -1602,16 +1603,23 @@ static void gk20a_channel_timeout_handler(struct channel_gk20a *ch)
1602{ 1603{
1603 struct gk20a *g = ch->g; 1604 struct gk20a *g = ch->g;
1604 u32 gp_get; 1605 u32 gp_get;
1606 u32 new_gp_get;
1607 u64 pb_get;
1608 u64 new_pb_get;
1605 1609
1606 gk20a_dbg_fn(""); 1610 gk20a_dbg_fn("");
1607 1611
1608 /* Get status and clear the timer */ 1612 /* Get status and clear the timer */
1609 nvgpu_raw_spinlock_acquire(&ch->timeout.lock); 1613 nvgpu_raw_spinlock_acquire(&ch->timeout.lock);
1610 gp_get = ch->timeout.gp_get; 1614 gp_get = ch->timeout.gp_get;
1615 pb_get = ch->timeout.pb_get;
1611 ch->timeout.running = false; 1616 ch->timeout.running = false;
1612 nvgpu_raw_spinlock_release(&ch->timeout.lock); 1617 nvgpu_raw_spinlock_release(&ch->timeout.lock);
1613 1618
1614 if (g->ops.fifo.userd_gp_get(ch->g, ch) != gp_get) { 1619 new_gp_get = g->ops.fifo.userd_gp_get(ch->g, ch);
1620 new_pb_get = g->ops.fifo.userd_pb_get(ch->g, ch);
1621
1622 if (new_gp_get != gp_get || new_pb_get != pb_get) {
1615 /* Channel has advanced, reschedule */ 1623 /* Channel has advanced, reschedule */
1616 gk20a_channel_timeout_start(ch); 1624 gk20a_channel_timeout_start(ch);
1617 return; 1625 return;