From f0444184278c356735420f0f88da744bf7adcdf7 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Fri, 19 May 2017 15:25:44 +0300 Subject: 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 Reviewed-on: http://git-master/r/1485919 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') 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, static void __gk20a_channel_timeout_start(struct channel_gk20a *ch) { ch->timeout.gp_get = ch->g->ops.fifo.userd_gp_get(ch->g, ch); + ch->timeout.pb_get = ch->g->ops.fifo.userd_pb_get(ch->g, ch); ch->timeout.running = true; nvgpu_timeout_init(ch->g, &ch->timeout.timer, gk20a_get_channel_watchdog_timeout(ch), @@ -1602,16 +1603,23 @@ static void gk20a_channel_timeout_handler(struct channel_gk20a *ch) { struct gk20a *g = ch->g; u32 gp_get; + u32 new_gp_get; + u64 pb_get; + u64 new_pb_get; gk20a_dbg_fn(""); /* Get status and clear the timer */ nvgpu_raw_spinlock_acquire(&ch->timeout.lock); gp_get = ch->timeout.gp_get; + pb_get = ch->timeout.pb_get; ch->timeout.running = false; nvgpu_raw_spinlock_release(&ch->timeout.lock); - if (g->ops.fifo.userd_gp_get(ch->g, ch) != gp_get) { + new_gp_get = g->ops.fifo.userd_gp_get(ch->g, ch); + new_pb_get = g->ops.fifo.userd_pb_get(ch->g, ch); + + if (new_gp_get != gp_get || new_pb_get != pb_get) { /* Channel has advanced, reschedule */ gk20a_channel_timeout_start(ch); return; -- cgit v1.2.2