summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/acr_gp106.c
diff options
context:
space:
mode:
authorDeepak Goyal <dgoyal@nvidia.com>2017-11-09 00:49:35 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-09 13:15:17 -0500
commit39527d58855fb7cb7dffef01c4f7290ae3a119ce (patch)
treee4d203c30602a1e40ca5859559bcb49760724906 /drivers/gpu/nvgpu/gp106/acr_gp106.c
parentd58c3bd152a3f86195a537f7115b3b32b4042a15 (diff)
gpu: nvgpu: Correct laying of terminating WPR HDR
Termination WPR header is inserted in the non-wpr blob so that HS knows when to stop processing WPR headers. nvgpu_mem_wr32 is copying the terminating WPR header @ wrong offset in non-wpr blob. This caused overwriting of the LS signatures present in the non wpr region, thus leading to LS authentication failure for GPCCS falcon. Fix added for t210/t186 as well. Bug 200362639 Change-Id: I60088b2dd2304fb5de0402b28822b305b34394c2 Signed-off-by: Deepak Goyal <dgoyal@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1594862 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mahantesh Kumbar <mkumbar@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/acr_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/acr_gp106.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c
index d7b09220..0dfa8e0e 100644
--- a/drivers/gpu/nvgpu/gp106/acr_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c
@@ -682,10 +682,12 @@ void lsfm_init_wpr_contents(struct gk20a *g,
682 struct ls_flcn_mgr_v1 *plsfm, struct nvgpu_mem *ucode) 682 struct ls_flcn_mgr_v1 *plsfm, struct nvgpu_mem *ucode)
683{ 683{
684 struct lsfm_managed_ucode_img_v2 *pnode = plsfm->ucode_img_list; 684 struct lsfm_managed_ucode_img_v2 *pnode = plsfm->ucode_img_list;
685 struct lsf_wpr_header_v1 last_wpr_hdr;
685 u32 i; 686 u32 i;
686 687
687 /* The WPR array is at the base of the WPR */ 688 /* The WPR array is at the base of the WPR */
688 pnode = plsfm->ucode_img_list; 689 pnode = plsfm->ucode_img_list;
690 memset(&last_wpr_hdr, 0, sizeof(struct lsf_wpr_header_v1));
689 i = 0; 691 i = 0;
690 692
691 /* 693 /*
@@ -759,10 +761,11 @@ void lsfm_init_wpr_contents(struct gk20a *g,
759 } 761 }
760 762
761 /* Tag the terminator WPR header with an invalid falcon ID. */ 763 /* Tag the terminator WPR header with an invalid falcon ID. */
762 nvgpu_mem_wr32(g, ucode, 764 last_wpr_hdr.falcon_id = LSF_FALCON_ID_INVALID;
763 plsfm->managed_flcn_cnt * sizeof(struct lsf_wpr_header_v1) + 765 nvgpu_mem_wr_n(g, ucode,
764 offsetof(struct lsf_wpr_header_v1, falcon_id), 766 plsfm->managed_flcn_cnt * sizeof(struct lsf_wpr_header_v1),
765 LSF_FALCON_ID_INVALID); 767 &last_wpr_hdr,
768 sizeof(struct lsf_wpr_header_v1));
766} 769}
767 770
768/*! 771/*!