From 83096b7ffcfe7e79df1f28749a509eb645462d75 Mon Sep 17 00:00:00 2001 From: David Nieto Date: Wed, 27 Dec 2017 13:13:34 -0800 Subject: gpu: nvgpu: fix L2 ROP mask L2 mask was assuming FS units contain valid information, but they do not. The new code checks if the L2 is FS before reading the L2/ROP mask Bug 2040328 Change-Id: Id07cc630e65cfc71ab8084a3700d884b6cd3430f Signed-off-by: David Nieto Reviewed-on: https://git-master.nvidia.com/r/1627327 Reviewed-by: Thomas Fleury Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gm20b/gr_gm20b.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index 3341721c..36fad8b3 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c @@ -1087,15 +1087,17 @@ u32 *gr_gm20b_rop_l2_en_mask(struct gk20a *g) { struct gr_gk20a *gr = &g->gr; u32 i, tmp, max_fbps_count, max_ltc_per_fbp; + unsigned long fbp_en_mask; u32 rop_l2_all_en; tmp = gk20a_readl(g, top_num_fbps_r()); max_fbps_count = top_num_fbps_value_v(tmp); max_ltc_per_fbp = gr_gm20b_get_max_ltc_per_fbp(g); rop_l2_all_en = (1 << max_ltc_per_fbp) - 1; + fbp_en_mask = gr_gm20b_get_fbp_en_mask(g); /* mask of Rop_L2 for each FBP */ - for (i = 0; i < max_fbps_count; i++) { + for_each_set_bit(i, &fbp_en_mask, max_fbps_count) { tmp = gk20a_readl(g, fuse_status_opt_rop_l2_fbp_r(i)); gr->fbp_rop_l2_en_mask[i] = rop_l2_all_en ^ tmp; } -- cgit v1.2.2