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

Commit ce2515b1 authored by Guodong Hu's avatar Guodong Hu Committed by Gerrit - the friendly Code Review server
Browse files

dsp: q6asm: fix consecutive cal_memory unmap failure



buffer_node for cal_memory are maintained in asm
commont_client IN-port lists.
Current codes work fine for the pattern:
map, unmap, map, unmap, map, unmap...
But it fails at the second unmap in the cases:
map, map, map, unmap, unmap, unmap, since the
buffer address in the common_client has not been
updated and we are actually trying to unmap
the same buffer multi-times.

Change-Id: I51f442dc8063a55932f44b8b7f3c689029565f7b
Signed-off-by: default avatarGuodong Hu <guodhu@codeaurora.org>
parent 3971a6b3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -751,7 +751,7 @@ static int q6asm_map_cal_memory(int32_t cal_type,
		goto done;
	}

	/* Use second asm buf to map memory */
	/* Use first asm buf to map memory */
	if (common_client.port[IN].buf == NULL) {
		pr_err("%s: common buf is NULL\n",
			__func__);
@@ -842,6 +842,8 @@ static int q6asm_unmap_cal_memory(int32_t cal_type,
		}
	}

	common_client.port[IN].buf->phys = cal_block->cal_data.paddr;

	result2 = q6asm_memory_unmap_regions(&common_client, IN);
	if (result2 < 0) {
		pr_err("%s: unmap failed, err %d\n",