From 39527d58855fb7cb7dffef01c4f7290ae3a119ce Mon Sep 17 00:00:00 2001 From: Deepak Goyal Date: Thu, 9 Nov 2017 11:19:35 +0530 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1594862 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mahantesh Kumbar Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gm20b/acr_gm20b.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gm20b/acr_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c index 0655b739..a39cdf2c 100644 --- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c @@ -652,10 +652,12 @@ static void lsfm_init_wpr_contents(struct gk20a *g, struct ls_flcn_mgr *plsfm, struct nvgpu_mem *ucode) { struct lsfm_managed_ucode_img *pnode = plsfm->ucode_img_list; + struct lsf_wpr_header last_wpr_hdr; u32 i; /* The WPR array is at the base of the WPR */ pnode = plsfm->ucode_img_list; + memset(&last_wpr_hdr, 0, sizeof(struct lsf_wpr_header)); i = 0; /* @@ -729,10 +731,11 @@ static void lsfm_init_wpr_contents(struct gk20a *g, struct ls_flcn_mgr *plsfm, } /* Tag the terminator WPR header with an invalid falcon ID. */ - nvgpu_mem_wr32(g, ucode, - plsfm->managed_flcn_cnt * sizeof(struct lsf_wpr_header) + - offsetof(struct lsf_wpr_header, falcon_id), - LSF_FALCON_ID_INVALID); + last_wpr_hdr.falcon_id = LSF_FALCON_ID_INVALID; + nvgpu_mem_wr_n(g, ucode, + plsfm->managed_flcn_cnt * sizeof(struct lsf_wpr_header), + &last_wpr_hdr, + sizeof(struct lsf_wpr_header)); } /*! -- cgit v1.2.2