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

Commit 2d5f55ca authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dsp: Add cmd locks to fix synchronization issues"

parents 0ff43491 6b5e14d7
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -502,6 +502,7 @@ static int q6core_send_get_avcs_fwk_ver_cmd(void)
	struct apr_hdr avcs_ver_cmd;
	int ret;

	mutex_lock(&q6core_lcl.cmd_lock);
	avcs_ver_cmd.hdr_field =
		APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, APR_HDR_LEN(APR_HDR_SIZE),
			      APR_PKT_VER);
@@ -548,6 +549,7 @@ static int q6core_send_get_avcs_fwk_ver_cmd(void)
	ret = 0;

done:
	mutex_unlock(&q6core_lcl.cmd_lock);
	return ret;
}

@@ -1428,14 +1430,16 @@ int q6core_map_mdf_shared_memory(uint32_t map_handle, uint64_t *buf_add,
	int i = 0;
	int cmd_size = 0;

	mutex_lock(&q6core_lcl.cmd_lock);
	cmd_size = sizeof(struct avs_cmd_map_mdf_shared_memory)
			+ sizeof(struct avs_shared_map_region_payload)
			* bufcnt;

	mmap_region_cmd = kzalloc(cmd_size, GFP_KERNEL);
	if (mmap_region_cmd == NULL)
	if (mmap_region_cmd == NULL) {
		mutex_unlock(&q6core_lcl.cmd_lock);
		return -ENOMEM;

	}
	mmap_regions = (struct avs_cmd_map_mdf_shared_memory *)mmap_region_cmd;
	mmap_regions->hdr.hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD,
						APR_HDR_LEN(APR_HDR_SIZE),
@@ -1502,6 +1506,7 @@ int q6core_map_mdf_shared_memory(uint32_t map_handle, uint64_t *buf_add,

done:
	kfree(mmap_region_cmd);
        mutex_unlock(&q6core_lcl.cmd_lock);
	return ret;
}