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

Commit afa15597 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: npu: Trace active network count"

parents 3da3561f 0358bf07
Loading
Loading
Loading
Loading
+21 −3
Original line number Diff line number Diff line
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -421,8 +421,8 @@ static int wait_for_status_ready(struct npu_device *npu_dev,
		msleep(NPU_FW_TIMEOUT_POLL_INTERVAL_MS);
		wait_cnt += NPU_FW_TIMEOUT_POLL_INTERVAL_MS;
		if (wait_cnt >= max_wait_ms) {
			pr_err("timeout wait for status %x in %s\n",
				status_bits, __func__);
			pr_err("timeout wait for status %x[%x] in reg %x\n",
				status_bits, ctrl_sts, status_reg);
			return -EPERM;
		}
	}
@@ -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) {