From 25e727d997bf21835e3cc396a407b95f1ec0acb2 Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Thu, 17 May 2018 14:08:22 -0700 Subject: gpu: nvgpu: release runlist_lock before issuing recovery Release runlist_lock before issuing runlist update timeout recovery. Bug 2115080 Change-Id: I22cd0dd8ab6828412fcc98f587e4a5cdce907651 Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1722308 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 964ccb03..4e0e2bd1 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -3357,23 +3357,12 @@ static int gk20a_fifo_update_runlist_locked(struct gk20a *g, u32 runlist_id, ret = g->ops.fifo.runlist_wait_pending(g, runlist_id); if (ret == -ETIMEDOUT) { - nvgpu_err(g, - "runlist update timeout"); - - gk20a_fifo_runlist_reset_engines(g, runlist_id); - - /* engine reset needs the lock. drop it */ - /* wait until the runlist is active again */ - ret = g->ops.fifo.runlist_wait_pending(g, runlist_id); - /* get the lock back. at this point everything should - * should be fine */ + nvgpu_err(g, "runlist %d update timeout", runlist_id); + /* trigger runlist update timeout recovery */ + return ret; - if (ret) - nvgpu_err(g, - "runlist update failed: %d", ret); } else if (ret == -EINTR) - nvgpu_err(g, - "runlist update interrupted"); + nvgpu_err(g, "runlist update interrupted"); } runlist->cur_buffer = new_buf; @@ -3513,7 +3502,7 @@ int gk20a_fifo_update_runlist(struct gk20a *g, u32 runlist_id, u32 chid, struct fifo_gk20a *f = &g->fifo; u32 token = PMU_INVALID_MUTEX_OWNER_ID; u32 mutex_ret; - u32 ret = 0; + int ret = 0; nvgpu_log_fn(g, " "); @@ -3530,6 +3519,10 @@ int gk20a_fifo_update_runlist(struct gk20a *g, u32 runlist_id, u32 chid, nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); nvgpu_mutex_release(&runlist->runlist_lock); + + if (ret == -ETIMEDOUT) + gk20a_fifo_runlist_reset_engines(g, runlist_id); + return ret; } -- cgit v1.2.2