From 6099b07090422bce03f2108f11dc3f8e677a966f Mon Sep 17 00:00:00 2001 From: Vince Hsu Date: Fri, 2 Nov 2018 15:18:28 +0800 Subject: gpu: nvgpu: fix deadlock when ACR boot fails The tpc_pg_lock is not released properly when ACR fails to boot, so the subsequent runtime PM resume operation will block. And it in turn also causes shutdown block due to pending runtime PM operations. Bug 200462464 Change-Id: Ia28ac11e8a7bbd826cf5f90ba8f90b29d2a55baa Signed-off-by: Vince Hsu Reviewed-on: https://git-master.nvidia.com/r/1941670 (cherry picked from commit 0bda191d7b9c01a22b91feb523134b845ee7523b) Reviewed-on: https://git-master.nvidia.com/r/1942949 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Siddardha Naraharisetti Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 9ee5f282..7ae1febc 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -313,6 +313,7 @@ int gk20a_finalize_poweron(struct gk20a *g) err = g->acr.bootstrap_hs_acr(g, &g->acr, &g->acr.acr); if (err != 0) { nvgpu_err(g, "ACR bootstrap failed"); + nvgpu_mutex_release(&g->tpc_pg_lock); goto done; } } @@ -321,7 +322,8 @@ int gk20a_finalize_poweron(struct gk20a *g) err = nvgpu_init_sec2_support(g); if (err != 0) { nvgpu_err(g, "failed to init sec2"); - goto done; + nvgpu_mutex_release(&g->tpc_pg_lock); + goto done; } } -- cgit v1.2.2