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

Commit 0358bf07 authored by Jilai Wang's avatar Jilai Wang
Browse files

msm: npu: Trace active network count



This change is to add debug code to trace active network count
in driver and fw.

Change-Id: Ie65375df08ba57a28be2f4c1cb32951807d860a8
Signed-off-by: default avatarJilai Wang <jilaiw@codeaurora.org>
parent 27ad4651
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -543,6 +543,8 @@ static struct npu_network *alloc_network(struct npu_host_ctx *ctx,
	}

	ctx->network_num++;
	pr_debug("%s:Active network num %d\n", __func__, ctx->network_num);

	return network;
}

@@ -613,6 +615,8 @@ static void free_network(struct npu_host_ctx *ctx, struct npu_client *client,
			kfree(network->stats_buf);
			memset(network, 0, sizeof(struct npu_network));
			ctx->network_num--;
			pr_debug("%s:Active network num %d\n", __func__,
				ctx->network_num);
		} else {
			pr_warn("network %d:%d is in use\n", network->id,
				atomic_read(&network->ref_cnt));
@@ -769,6 +773,13 @@ static void app_msg_proc(struct npu_host_ctx *host_ctx, uint32_t *msg)
			load_rsp_pkt->header.status,
			load_rsp_pkt->header.trans_id);

		/*
		 * The upper 8 bits in flags is the current active
		 * network count in fw
		 */
		pr_debug("Current active network count in FW is %d\n",
			load_rsp_pkt->header.flags >> 24);

		/*
		 * the upper 16 bits in returned network_hdl is
		 * the network ID
@@ -806,6 +817,13 @@ static void app_msg_proc(struct npu_host_ctx *host_ctx, uint32_t *msg)
			unload_rsp_pkt->header.status,
			unload_rsp_pkt->header.trans_id);

		/*
		 * The upper 8 bits in flags is the current active
		 * network count in fw
		 */
		pr_debug("Current active network count in FW is %d\n",
			unload_rsp_pkt->header.flags >> 24);

		network = get_network_by_hdl(host_ctx, NULL,
			unload_rsp_pkt->network_hdl);
		if (!network) {