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

Commit 6bf9cee9 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: npu: Add debug information for mapped memory"

parents d42cb3e4 2030e82c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -292,11 +292,13 @@ int npu_mem_map(struct npu_client *client, int buf_hdl, uint32_t size,
		ion_buf->table->nents, DMA_BIDIRECTIONAL);
	ion_buf->iova = ion_buf->table->sgl->dma_address;
	ion_buf->size = ion_buf->table->sgl->dma_length;
	*addr = ion_buf->iova;
	pr_debug("mapped mem addr:0x%llx size:0x%x\n", ion_buf->iova,
		ion_buf->size);
map_end:
	if (ret)
		npu_mem_unmap(client, buf_hdl, 0);

	*addr = ion_buf->iova;
	return ret;
}

@@ -356,6 +358,9 @@ void npu_mem_unmap(struct npu_client *client, int buf_hdl, uint64_t addr)
	if (ion_buf->dma_buf)
		dma_buf_put(ion_buf->dma_buf);
	npu_dev->smmu_ctx.attach_cnt--;

	pr_debug("unmapped mem addr:0x%llx size:0x%x\n", ion_buf->iova,
		ion_buf->size);
	npu_free_npu_ion_buffer(client, buf_hdl);
}

+1 −0
Original line number Diff line number Diff line
@@ -1221,6 +1221,7 @@ int32_t npu_host_load_network_v2(struct npu_client *client,

	/* verify mapped physical address */
	if (!npu_mem_verify_addr(client, network->phy_add)) {
		pr_err("Invalid network address %llx\n", network->phy_add);
		ret = -EINVAL;
		goto error_free_network;
	}