summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2014-03-31 05:36:55 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:08:55 -0400
commit0d908e51c806f83daa7a0d6e3bc3dcc6ef28ecd5 (patch)
treeffb1a373fef5d4646399871fcf5b7d7d6c561295 /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parent4a8f0db37976036abfe4d70ff60cd0991a177a7d (diff)
gpu: nvgpu: Check bar1 bind
Add two fb flushes after bar1 bind. This should hang the thread instead of whole system in case there is a BAR1 hang. Change-Id: I2385a243711219297b889daa30c9fc81106e5825 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/390183
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index b22df5e8..208e5291 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -377,13 +377,12 @@ static int gk20a_init_mm_setup_hw(struct gk20a *g)
377 inst_pa = (u32)(inst_pa >> bar1_instance_block_shift_gk20a()); 377 inst_pa = (u32)(inst_pa >> bar1_instance_block_shift_gk20a());
378 gk20a_dbg_info("bar1 inst block ptr: 0x%08x", (u32)inst_pa); 378 gk20a_dbg_info("bar1 inst block ptr: 0x%08x", (u32)inst_pa);
379 379
380 /* this is very early in init... can we defer this? */ 380 gk20a_writel(g, bus_bar1_block_r(),
381 { 381 bus_bar1_block_target_vid_mem_f() |
382 gk20a_writel(g, bus_bar1_block_r(), 382 bus_bar1_block_mode_virtual_f() |
383 bus_bar1_block_target_vid_mem_f() | 383 bus_bar1_block_ptr_f(inst_pa));
384 bus_bar1_block_mode_virtual_f() | 384 if (gk20a_mm_fb_flush(g) || gk20a_mm_fb_flush(g))
385 bus_bar1_block_ptr_f(inst_pa)); 385 return -EBUSY;
386 }
387 386
388 gk20a_dbg_fn("done"); 387 gk20a_dbg_fn("done");
389 return 0; 388 return 0;
@@ -2702,11 +2701,12 @@ clean_up:
2702 return err; 2701 return err;
2703} 2702}
2704 2703
2705void gk20a_mm_fb_flush(struct gk20a *g) 2704int gk20a_mm_fb_flush(struct gk20a *g)
2706{ 2705{
2707 struct mm_gk20a *mm = &g->mm; 2706 struct mm_gk20a *mm = &g->mm;
2708 u32 data; 2707 u32 data;
2709 s32 retry = 100; 2708 s32 retry = 100;
2709 int ret = 0;
2710 2710
2711 gk20a_dbg_fn(""); 2711 gk20a_dbg_fn("");
2712 2712
@@ -2734,11 +2734,15 @@ void gk20a_mm_fb_flush(struct gk20a *g)
2734 break; 2734 break;
2735 } while (retry >= 0 || !tegra_platform_is_silicon()); 2735 } while (retry >= 0 || !tegra_platform_is_silicon());
2736 2736
2737 if (retry < 0) 2737 if (retry < 0) {
2738 gk20a_warn(dev_from_gk20a(g), 2738 gk20a_warn(dev_from_gk20a(g),
2739 "fb_flush too many retries"); 2739 "fb_flush too many retries");
2740 ret = -EBUSY;
2741 }
2740 2742
2741 mutex_unlock(&mm->l2_op_lock); 2743 mutex_unlock(&mm->l2_op_lock);
2744
2745 return ret;
2742} 2746}
2743 2747
2744static void gk20a_mm_l2_invalidate_locked(struct gk20a *g) 2748static void gk20a_mm_l2_invalidate_locked(struct gk20a *g)