From af4f38fb6e5e168445139f8766971ecc4501acfb Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Thu, 5 Nov 2020 11:45:20 +0530 Subject: [PATCH] gpu: nvgpu: use correct gr_config pointer to return tpc masks In gk20a_ctrl_get_tpc_masks() receive gr_config pointer from caller instead of extracting with nvgpu_gr_get_config_ptr(). GR engine current instance value is not set here so this was always returning 0th instance gr_config pointer. Jira NVGPU-5648 Change-Id: I7f4df0c464cd357d05ac7d5c3b9e4abe0ac9a8af Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2441667 Reviewed-by: automaticguardword Reviewed-by: Lakshmanan M Reviewed-by: mobile promotions Tested-by: Lakshmanan M Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index 00c78ed2f..ffaee3097 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -672,11 +672,10 @@ clean_up: return err; } -static int gk20a_ctrl_get_tpc_masks(struct gk20a *g, +static int gk20a_ctrl_get_tpc_masks(struct gk20a *g, struct nvgpu_gr_config *gr_config, struct nvgpu_gpu_get_tpc_masks_args *args) { int err = 0; - struct nvgpu_gr_config *gr_config = nvgpu_gr_get_config_ptr(g); const u32 gpc_tpc_mask_size = sizeof(u32) * nvgpu_gr_config_get_max_gpc_count(gr_config); @@ -2048,7 +2047,7 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg (struct nvgpu_gpu_open_tsg_args *)buf); break; case NVGPU_GPU_IOCTL_GET_TPC_MASKS: - err = gk20a_ctrl_get_tpc_masks(g, + err = gk20a_ctrl_get_tpc_masks(g, gr_config, (struct nvgpu_gpu_get_tpc_masks_args *)buf); break; case NVGPU_GPU_IOCTL_GET_FBP_L2_MASKS: