gpu: nvgpu: correct the gr.config unit test for invalid pes

Remove changing the gpc_count to 2. This could result in memory
access error for struct whose allocation happens during init call.
For igpu, no need to check for higher gpc_count.

Jira NVGPU-4531

Change-Id: I48ad60b083d91fd2f8a673fb8fabbe48e171912e
Signed-off-by: vinodg <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2280706
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
vinodg
2020-01-17 13:49:05 -08:00
committed by Alex Waterman
parent 9aecc444c8
commit df7631efc8

View File

@@ -433,14 +433,11 @@ static int gr_test_invalid_pes_with_sm_id(struct gk20a *g,
/* Set pes tpc mask same */
u32 pes_tpc_mask = gr_conf->pes_tpc_mask[1][0];
u32 gpc_count = nvgpu_gr_config_get_gpc_count(gr_conf);
gr_conf->pes_tpc_mask[1][0] = gr_conf->pes_tpc_mask[0][0];
gr_conf->gpc_count = 2;
err = g->ops.gr.config.init_sm_id_table(g, gr_conf);
gr_conf->pes_tpc_mask[1][0] = pes_tpc_mask;
gr_conf->gpc_count = gpc_count;
return err;
}