Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b264a0a7 authored by Amir Levy's avatar Amir Levy Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa3: Fix wrong references to SW shared memory size



IPA_SHARED_MEM_SIZE register contain the size of the SW partition in IPA
memory as well as its offset from the start.
At IPA driver we use wrong size of the region for size validity and
memory mapping with the partition size excluding the offset.

Change-Id: Ie06a786a449a6fdf4fc3df512d675967eb9b1775
Signed-off-by: default avatarGhanim Fodi <gfodi@codeaurora.org>
Signed-off-by: default avatarAmir Levy <alevy@codeaurora.org>
parent f27dfa1e
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -1762,8 +1762,7 @@ int _ipa_init_sram_v3_0(void)
		IPA_SRAM_DIRECT_ACCESS_N_OFST_v3_0(
			ipa3_ctx->smem_restricted_bytes / 4);

	ipa_sram_mmio = ioremap(phys_addr,
		ipa3_ctx->smem_sz - ipa3_ctx->smem_restricted_bytes);
	ipa_sram_mmio = ioremap(phys_addr, ipa3_ctx->smem_sz);
	if (!ipa_sram_mmio) {
		IPAERR("fail to ioremap IPA SRAM\n");
		return -ENOMEM;
@@ -3157,11 +3156,9 @@ static int ipa3_init(const struct ipa3_plat_drv_res *resource_p,
		ipa3_ctx->ip6_flt_tbl_hash_lcl,
		ipa3_ctx->ip6_flt_tbl_nhash_lcl);

	if (ipa3_ctx->smem_reqd_sz >
		ipa3_ctx->smem_sz - ipa3_ctx->smem_restricted_bytes) {
	if (ipa3_ctx->smem_reqd_sz > ipa3_ctx->smem_sz) {
		IPAERR("SW expect more core memory, needed %d, avail %d\n",
			ipa3_ctx->smem_reqd_sz, ipa3_ctx->smem_sz -
			ipa3_ctx->smem_restricted_bytes);
			ipa3_ctx->smem_reqd_sz, ipa3_ctx->smem_sz);
		result = -ENOMEM;
		goto fail_init_hw;
	}