From c8103a39ad78230266045bdb50c95b733c2042a2 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 24 May 2016 11:09:45 -0700 Subject: gpu: nvgpu: Do not reallocate pes_tpc_mask array We allocated a new pes_tpc_mask for each PES on each GPC. This causes us to forget masks for all GPCs but the last one. Change-Id: I825788ad75333d4aecd93c78d1b277c0d9d65f15 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1152703 --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 076ddd12..e8d363e1 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -3264,15 +3264,17 @@ static int gr_gk20a_init_gr_config(struct gk20a *g, struct gr_gk20a *gr) g->ops.gr.get_gpc_tpc_mask(g, gpc_index); for (pes_index = 0; pes_index < gr->pe_count_per_gpc; pes_index++) { - gr->pes_tpc_count[pes_index] = - kzalloc(gr->gpc_count * sizeof(u32), - GFP_KERNEL); - gr->pes_tpc_mask[pes_index] = - kzalloc(gr->gpc_count * sizeof(u32), - GFP_KERNEL); - if (!gr->pes_tpc_count[pes_index] || - !gr->pes_tpc_mask[pes_index]) - goto clean_up; + if (!gr->pes_tpc_count[pes_index]) { + gr->pes_tpc_count[pes_index] = + kzalloc(gr->gpc_count * sizeof(u32), + GFP_KERNEL); + gr->pes_tpc_mask[pes_index] = + kzalloc(gr->gpc_count * sizeof(u32), + GFP_KERNEL); + if (!gr->pes_tpc_count[pes_index] || + !gr->pes_tpc_mask[pes_index]) + goto clean_up; + } tmp = gk20a_readl(g, gr_gpc0_gpm_pd_pes_tpc_id_mask_r(pes_index) + -- cgit v1.2.2