From 6c9daf7626567fffc9d1ccd475865e81ae90a973 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Wed, 1 Aug 2018 11:38:17 -0700 Subject: gpu: nvgpu: fix gpc_tpc_mask to use max_gpc_count gpc_tpc_mask uses gpc/tpc IDs directly read from fuse, so it needs to use max_gpc_count for any possible cases rather not gpc_count. Bug 2302005 Change-Id: I903ee3e0c10c4b329dd0d76c40d3516dc36ed303 Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1790464 Reviewed-by: svc-misra-checker Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Deepak Nibade Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/os') diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index f7de17ad..e87d5822 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -515,7 +515,7 @@ static int gk20a_ctrl_get_tpc_masks(struct gk20a *g, { struct gr_gk20a *gr = &g->gr; int err = 0; - const u32 gpc_tpc_mask_size = sizeof(u32) * gr->gpc_count; + const u32 gpc_tpc_mask_size = sizeof(u32) * gr->max_gpc_count; if (args->mask_buf_size > 0) { size_t write_size = gpc_tpc_mask_size; -- cgit v1.2.2