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

Commit 51f7fa7f authored by Vikram Panduranga's avatar Vikram Panduranga Committed by Gerrit - the friendly Code Review server
Browse files

dsp: voice_mhi: fix memory size before mapping



Mailbox memory was mapped with incorrect memory size.
Adding a fix to use the actual size while mapping.

Change-Id: If9a478ca044f68bed8e0899dfb023545585272f2
Signed-off-by: default avatarVikram Panduranga <vpandura@codeaurora.org>
parent 7dbdc9aa
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -344,6 +344,7 @@ static int voice_mhi_set_mailbox_memory_config(void)
static void voice_mhi_map_pcie_and_send(struct work_struct *work)
{
	dma_addr_t iova, phys_addr;
	uint32_t mem_size;
	struct device *md;

	mutex_lock(&voice_mhi_lcl.mutex);
@@ -355,8 +356,9 @@ static void voice_mhi_map_pcie_and_send(struct work_struct *work)
	}

	phys_addr = voice_mhi_lcl.dev_info.phys_addr.base;
	mem_size = voice_mhi_lcl.dev_info.iova_pcie.size;
	if (md) {
		iova = dma_map_resource(md->parent, phys_addr, PAGE_SIZE,
		iova = dma_map_resource(md->parent, phys_addr, mem_size,
					DMA_BIDIRECTIONAL, 0);
		if (dma_mapping_error(md->parent, iova)) {
			pr_err("%s: dma_mapping_error\n", __func__);
@@ -523,6 +525,7 @@ static int voice_mhi_probe(struct platform_device *pdev)
		voice_mhi_lcl.dev_info.phys_addr.base = phys_addr;
		voice_mhi_lcl.dev_info.iova_adsp.base = iova;
		voice_mhi_lcl.dev_info.iova_adsp.size = mem_size;
		voice_mhi_lcl.dev_info.iova_pcie.size = mem_size;
		VOICE_MHI_STATE_SET(voice_mhi_lcl.voice_mhi_state,
				VOICE_MHI_ADSP_UP);