From 47cd4860f02ace82204ec5b7dcb8bd703c41ab0e Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Fri, 12 May 2017 16:28:47 +0530 Subject: [PATCH] gpu: nvgpu: skip taking g->busy_lock in gk20a_idle We use g->busy_lock in gk20a_do_idle() to prevent submitting more jobs to h/w and to wait for currently running jobs to finish But requesting this lock in gk20a_idle() prevents decrementing runtime counter and hence gk20a_do_idle() can timeout with below prints [ 148.904739] gk20a 17000000.gp10b: Timeout detected @ gk20a_do_idle+0x30/0x38 [ 148.912185] gk20a 17000000.gp10b: __gk20a_do_idle: failed to idle - refcount 4 != 1 Hence skip requesting this lock in gk20a_idle() Bug 200294536 Change-Id: I060075fdee1b68e1b5fa11baa44a3f5ce4917d94 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1480777 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 8d4bc6691..0e6c66e83 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1908,12 +1908,11 @@ void gk20a_idle(struct gk20a *g) struct device *dev; atomic_dec(&g->usage_count); - down_read(&g->busy_lock); dev = g->dev; if (!(dev && gk20a_can_busy(g))) - goto fail; + return; if (pm_runtime_enabled(dev)) { #ifdef CONFIG_PM @@ -1927,8 +1926,6 @@ void gk20a_idle(struct gk20a *g) } else { gk20a_scale_notify_idle(dev); } -fail: - up_read(&g->busy_lock); } void gk20a_disable(struct gk20a *g, u32 units)