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

Commit 87a732c8 authored by Jilai Wang's avatar Jilai Wang
Browse files

msm: npu: Only allow to execute patched network



Unpatched network can't be executed because the buffer address
in the original network is not valid iommu mapped address.

Change-Id: I8ec8c486e602abcd68b9259e9a282d110ba81738
Signed-off-by: default avatarJilai Wang <jilaiw@codeaurora.org>
parent df3d8915
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1483,6 +1483,11 @@ static int npu_exec_network(struct npu_client *client,
		return -EINVAL;
	}

	if (!req.patching_required) {
		pr_err("Only support patched network");
		return -EINVAL;
	}

	ret = npu_host_exec_network(client, &req);

	if (ret) {
@@ -1513,7 +1518,8 @@ static int npu_exec_network_v2(struct npu_client *client,
		return -EFAULT;
	}

	if (req.patch_buf_info_num > NPU_MAX_PATCH_NUM) {
	if ((req.patch_buf_info_num > NPU_MAX_PATCH_NUM) ||
		(req.patch_buf_info_num == 0)) {
		pr_err("Invalid patch buf info num %d[max:%d]\n",
			req.patch_buf_info_num, NPU_MAX_PATCH_NUM);
		return -EINVAL;