From 37869170e4f3c42fa31faa1bcda1e6c0a188179c Mon Sep 17 00:00:00 2001 From: Sam Payne Date: Wed, 8 Jul 2015 15:26:37 -0700 Subject: gpu: nvgpu: check that GPU is powered before flush if GPU is not powered before L2 is flushed, then L2 cache flush is a noop. Same behavior as gk20a_mm_L2_Invalidate() bug 1661228 Change-Id: I0f590628928a73b7277d1b16a5a79a86e0213648 Signed-off-by: Sam Payne Reviewed-on: http://git-master/r/768068 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Deepak Nibade Reviewed-by: Sachin Nikam (cherry picked from commit cb4d29d34d0736aa753afa323bfb216481cc8640) Reviewed-on: http://git-master/r/771113 GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 112e218a..1e0fd6af 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -3225,6 +3225,12 @@ int gk20a_mm_fb_flush(struct gk20a *g) gk20a_dbg_fn(""); + gk20a_busy_noresume(g->dev); + if (!g->power_on) { + pm_runtime_put_noidle(&g->dev->dev); + return 0; + } + mutex_lock(&mm->l2_op_lock); /* Make sure all previous writes are committed to the L2. There's no @@ -3262,6 +3268,8 @@ int gk20a_mm_fb_flush(struct gk20a *g) mutex_unlock(&mm->l2_op_lock); + pm_runtime_put_noidle(&g->dev->dev); + return ret; } -- cgit v1.2.2