diff --git a/drivers/gpu/nvgpu/common/pmu/acr_gm20b.c b/drivers/gpu/nvgpu/common/pmu/acr_gm20b.c index efa2abd94..e44f2307a 100644 --- a/drivers/gpu/nvgpu/common/pmu/acr_gm20b.c +++ b/drivers/gpu/nvgpu/common/pmu/acr_gm20b.c @@ -676,7 +676,7 @@ static void lsfm_init_wpr_contents(struct gk20a *g, struct ls_flcn_mgr *plsfm, */ while (pnode != NULL) { /* Flush WPR header to memory*/ - nvgpu_mem_wr_n(g, ucode, i * sizeof(pnode->wpr_header), + nvgpu_mem_wr_n(g, ucode, i * (u32)sizeof(pnode->wpr_header), &pnode->wpr_header, (u32)sizeof(pnode->wpr_header)); @@ -744,7 +744,8 @@ static void lsfm_init_wpr_contents(struct gk20a *g, struct ls_flcn_mgr *plsfm, /* Tag the terminator WPR header with an invalid falcon ID. */ last_wpr_hdr.falcon_id = LSF_FALCON_ID_INVALID; nvgpu_mem_wr_n(g, ucode, - plsfm->managed_flcn_cnt * sizeof(struct lsf_wpr_header), + (u32)plsfm->managed_flcn_cnt * + (u32)sizeof(struct lsf_wpr_header), &last_wpr_hdr, (u32)sizeof(struct lsf_wpr_header)); } @@ -987,7 +988,7 @@ static int lsf_gen_wpr_requirements(struct gk20a *g, struct ls_flcn_mgr *plsfm) /* Align (size bloat) and save off generic descriptor size*/ pnode->lsb_header.bl_data_size = ALIGN( - sizeof(pnode->bl_gen_desc), + (u32)sizeof(pnode->bl_gen_desc), LSF_BL_DATA_SIZE_ALIGNMENT); /*Align, save off, and include the additional BL data*/ diff --git a/drivers/gpu/nvgpu/common/pmu/acr_gp106.c b/drivers/gpu/nvgpu/common/pmu/acr_gp106.c index ad7b6465d..9b21a02c1 100644 --- a/drivers/gpu/nvgpu/common/pmu/acr_gp106.c +++ b/drivers/gpu/nvgpu/common/pmu/acr_gp106.c @@ -1218,7 +1218,7 @@ int lsf_gen_wpr_requirements(struct gk20a *g, /* Align (size bloat) and save off generic descriptor size*/ pnode->lsb_header.bl_data_size = ALIGN( - sizeof(pnode->bl_gen_desc), + (u32)sizeof(pnode->bl_gen_desc), LSF_BL_DATA_SIZE_ALIGNMENT); /*Align, save off, and include the additional BL data*/ diff --git a/drivers/gpu/nvgpu/include/nvgpu/acr/acr_lsfm.h b/drivers/gpu/nvgpu/include/nvgpu/acr/acr_lsfm.h index fd82e5706..049e10ae2 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/acr/acr_lsfm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/acr/acr_lsfm.h @@ -215,7 +215,7 @@ struct lsf_lsb_header_v1 { * Maximum WPR Header size */ #define LSF_WPR_HEADERS_TOTAL_SIZE_MAX \ - (ALIGN_UP((sizeof(struct lsf_wpr_header_v1) * LSF_FALCON_ID_END), \ + (ALIGN_UP(((u32)sizeof(struct lsf_wpr_header_v1) * LSF_FALCON_ID_END), \ LSF_WPR_HEADER_ALIGNMENT)) #define LSF_LSB_HEADER_TOTAL_SIZE_MAX (\ ALIGN_UP(sizeof(struct lsf_lsb_header_v1), LSF_LSB_HEADER_ALIGNMENT))