diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/acr_gm20b.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c index ac88b650..3df2f9c5 100644 --- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c | |||
@@ -836,7 +836,7 @@ int gm20b_bootstrap_hs_flcn(struct gk20a *g) | |||
836 | struct vm_gk20a *vm = &mm->pmu.vm; | 836 | struct vm_gk20a *vm = &mm->pmu.vm; |
837 | struct device *d = dev_from_gk20a(g); | 837 | struct device *d = dev_from_gk20a(g); |
838 | int i, err = 0; | 838 | int i, err = 0; |
839 | struct sg_table *sgt_pmu_ucode; | 839 | struct sg_table *sgt_pmu_ucode = NULL; |
840 | dma_addr_t iova; | 840 | dma_addr_t iova; |
841 | u64 *pacr_ucode_cpuva = NULL, pacr_ucode_pmu_va, *acr_dmem; | 841 | u64 *pacr_ucode_cpuva = NULL, pacr_ucode_pmu_va, *acr_dmem; |
842 | u32 img_size_in_bytes; | 842 | u32 img_size_in_bytes; |
@@ -952,6 +952,7 @@ int gm20b_bootstrap_hs_flcn(struct gk20a *g) | |||
952 | ((acr_ucode_header_t210_load[2]) >> 8); | 952 | ((acr_ucode_header_t210_load[2]) >> 8); |
953 | bl_dmem_desc->data_size = acr_ucode_header_t210_load[3]; | 953 | bl_dmem_desc->data_size = acr_ucode_header_t210_load[3]; |
954 | gk20a_free_sgtable(&sgt_pmu_ucode); | 954 | gk20a_free_sgtable(&sgt_pmu_ucode); |
955 | sgt_pmu_ucode = NULL; | ||
955 | } | 956 | } |
956 | status = pmu_exec_gen_bl(g, bl_dmem_desc, 1); | 957 | status = pmu_exec_gen_bl(g, bl_dmem_desc, 1); |
957 | if (status != 0) { | 958 | if (status != 0) { |
@@ -964,7 +965,8 @@ err_free_ucode_map: | |||
964 | img_size_in_bytes, gk20a_mem_flag_none); | 965 | img_size_in_bytes, gk20a_mem_flag_none); |
965 | acr->acr_ucode.pmu_va = 0; | 966 | acr->acr_ucode.pmu_va = 0; |
966 | err_free_ucode_sgt: | 967 | err_free_ucode_sgt: |
967 | gk20a_free_sgtable(&sgt_pmu_ucode); | 968 | if (sgt_pmu_ucode) |
969 | gk20a_free_sgtable(&sgt_pmu_ucode); | ||
968 | err_free_acr_buf: | 970 | err_free_acr_buf: |
969 | dma_free_coherent(d, img_size_in_bytes, | 971 | dma_free_coherent(d, img_size_in_bytes, |
970 | pacr_ucode_cpuva, iova); | 972 | pacr_ucode_cpuva, iova); |
@@ -1137,7 +1139,7 @@ int pmu_exec_gen_bl(struct gk20a *g, void *desc, u8 b_wait_for_halt) | |||
1137 | struct vm_gk20a *vm = &mm->pmu.vm; | 1139 | struct vm_gk20a *vm = &mm->pmu.vm; |
1138 | struct device *d = dev_from_gk20a(g); | 1140 | struct device *d = dev_from_gk20a(g); |
1139 | int i, err = 0; | 1141 | int i, err = 0; |
1140 | struct sg_table *sgt_pmu_ucode; | 1142 | struct sg_table *sgt_pmu_ucode = NULL; |
1141 | dma_addr_t iova; | 1143 | dma_addr_t iova; |
1142 | u32 bl_sz; | 1144 | u32 bl_sz; |
1143 | void *bl_cpuva; | 1145 | void *bl_cpuva; |
@@ -1208,6 +1210,7 @@ int pmu_exec_gen_bl(struct gk20a *g, void *desc, u8 b_wait_for_halt) | |||
1208 | gk20a_mem_wr32(bl_cpuva, i, pmu_bl_gm10x[i]); | 1210 | gk20a_mem_wr32(bl_cpuva, i, pmu_bl_gm10x[i]); |
1209 | gm20b_dbg_pmu("Copied bl ucode to bl_cpuva\n"); | 1211 | gm20b_dbg_pmu("Copied bl ucode to bl_cpuva\n"); |
1210 | gk20a_free_sgtable(&sgt_pmu_ucode); | 1212 | gk20a_free_sgtable(&sgt_pmu_ucode); |
1213 | sgt_pmu_ucode = NULL; | ||
1211 | } | 1214 | } |
1212 | /* | 1215 | /* |
1213 | * Disable interrupts to avoid kernel hitting breakpoint due | 1216 | * Disable interrupts to avoid kernel hitting breakpoint due |
@@ -1245,7 +1248,8 @@ err_unmap_bl: | |||
1245 | gk20a_gmmu_unmap(vm, acr->hsbl_ucode.pmu_va, | 1248 | gk20a_gmmu_unmap(vm, acr->hsbl_ucode.pmu_va, |
1246 | acr->hsbl_ucode.size, gk20a_mem_flag_none); | 1249 | acr->hsbl_ucode.size, gk20a_mem_flag_none); |
1247 | err_free_ucode_sgt: | 1250 | err_free_ucode_sgt: |
1248 | gk20a_free_sgtable(&sgt_pmu_ucode); | 1251 | if (sgt_pmu_ucode) |
1252 | gk20a_free_sgtable(&sgt_pmu_ucode); | ||
1249 | err_free_cpu_va: | 1253 | err_free_cpu_va: |
1250 | dma_free_attrs(d, acr->hsbl_ucode.size, | 1254 | dma_free_attrs(d, acr->hsbl_ucode.size, |
1251 | acr->hsbl_ucode.cpuva, acr->hsbl_ucode.iova, &attrs); | 1255 | acr->hsbl_ucode.cpuva, acr->hsbl_ucode.iova, &attrs); |