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

Commit 022eebdc authored by Jilai Wang's avatar Jilai Wang
Browse files

msm: npu: Reduce maximum stats buffer size



Reduce maximum stats buffer size to 16 KB to avoid order 4
allocation failure.

Change-Id: Ibce1a8a175a444c6effc78ba07db3c8d92f12691
Signed-off-by: default avatarJilai Wang <jilaiw@codeaurora.org>
parent f6347714
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
#define NPU_MAX_REGULATOR_NUM	2
#define NPU_MAX_DT_NAME_LEN	    21
#define NPU_MAX_PWRLEVELS		8
#define NPU_MAX_STATS_BUF_SIZE 16384

/* -------------------------------------------------------------------------
 * Data Structures
+2 −2
Original line number Diff line number Diff line
@@ -1116,9 +1116,9 @@ static int npu_exec_network_v2(struct npu_client *client,
		return -EINVAL;
	}

	if (req.stats_buf_size > MSM_NPU_MAX_STATS_BUF_SIZE) {
	if (req.stats_buf_size > NPU_MAX_STATS_BUF_SIZE) {
		pr_err("Invalid stats buffer size %d max %d\n",
			req.stats_buf_size, MSM_NPU_MAX_STATS_BUF_SIZE);
			req.stats_buf_size, NPU_MAX_STATS_BUF_SIZE);
		return -EINVAL;
	}

+1 −1
Original line number Diff line number Diff line
@@ -478,7 +478,7 @@ static struct npu_network *alloc_network(struct npu_host_ctx *ctx,
		network->fw_error = false;
		network->cmd_pending = false;
		network->client = client;
		network->stats_buf = kzalloc(MSM_NPU_MAX_STATS_BUF_SIZE,
		network->stats_buf = kzalloc(NPU_MAX_STATS_BUF_SIZE,
			GFP_KERNEL);
		if (!network->stats_buf) {
			free_network(ctx, network->id);
+0 −1
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@
#define MSM_NPU_MAX_OUTPUT_LAYER_NUM 4
#define MSM_NPU_MAX_PATCH_LAYER_NUM (MSM_NPU_MAX_INPUT_LAYER_NUM +\
	MSM_NPU_MAX_OUTPUT_LAYER_NUM)
#define MSM_NPU_MAX_STATS_BUF_SIZE 65536

/* -------------------------------------------------------------------------
 * Data Structures