소스 검색

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;