Преглед на файлове

msm: ipa3: fix to cleanup the dma allocation.

When commit header table from memory to HW, adding fix to clean
dma allocation if it fails in multiple mapping attempts and also to
clean the allocated mapping of hdr table after commit to HW.

Change-Id: Icbf1b855e34625ffe8f8356a59cddf85a91b0160
Signed-off-by: Jagadeesh Ponduru <[email protected]>
Jagadeesh Ponduru преди 3 години
родител
ревизия
1403c31a33
променени са 1 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 9 0
      drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c

+ 9 - 0
drivers/platform/msm/ipa/ipa_v3/ipa_hdr.c

@@ -360,6 +360,11 @@ int __ipa_commit_hdr_v3_0(void)
 		ipa3_ctx->hdr_sys_mem = hdr_mem[HDR_TBL_SYS];
 	}
 
+	else {
+		dma_free_coherent(ipa3_ctx->pdev, hdr_mem[HDR_TBL_SYS].size,
+		hdr_mem[HDR_TBL_SYS].base,hdr_mem[HDR_TBL_SYS].phys_base);
+        }
+
 	if (ipa3_ctx->hdr_proc_ctx_tbl_lcl) {
 		dma_free_coherent(ipa3_ctx->pdev, ctx_mem.size, ctx_mem.base,
 			ctx_mem.phys_base);
@@ -372,6 +377,10 @@ int __ipa_commit_hdr_v3_0(void)
 					ipa3_ctx->hdr_proc_ctx_mem.phys_base);
 			ipa3_ctx->hdr_proc_ctx_mem = ctx_mem;
 		}
+		else {
+			dma_free_coherent(ipa3_ctx->pdev, ctx_mem.size,
+			ctx_mem.base,ctx_mem.phys_base);
+		}
 	}
 	goto end;