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

Commit e03dd833 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 33431eba on remote branch

Change-Id: I16772fcd417be8ef256c080153fd8f245e4f88b4
parents 8d5ef88e 33431eba
Loading
Loading
Loading
Loading
+10 −17
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/msm-bus.h>
@@ -502,28 +503,15 @@ struct mem_entry {
	unsigned int type;
} __packed;

static int _save_mem_entries(int id, void *ptr, void *data)
{
	struct kgsl_mem_entry *entry = ptr;
	struct mem_entry *m = (struct mem_entry *) data;
	unsigned int index = id - 1;

	m[index].gpuaddr = entry->memdesc.gpuaddr;
	m[index].size = entry->memdesc.size;
	m[index].type = kgsl_memdesc_get_memtype(&entry->memdesc);

	return 0;
}

static size_t snapshot_capture_mem_list(struct kgsl_device *device,
		u8 *buf, size_t remain, void *priv)
{
	struct kgsl_snapshot_mem_list_v2 *header =
		(struct kgsl_snapshot_mem_list_v2 *)buf;
	int num_mem = 0;
	int ret = 0;
	unsigned int *data = (unsigned int *)(buf + sizeof(*header));
	int id, index = 0, ret = 0, num_mem = 0;
	struct kgsl_process_private *process = priv;
	struct mem_entry *m = (struct mem_entry *)(buf + sizeof(*header));
	struct kgsl_mem_entry *entry;

	/* we need a process to search! */
	if (process == NULL)
@@ -550,7 +538,12 @@ static size_t snapshot_capture_mem_list(struct kgsl_device *device,
	 * Walk through the memory list and store the
	 * tuples(gpuaddr, size, memtype) in snapshot
	 */
	idr_for_each(&process->mem_idr, _save_mem_entries, data);
	idr_for_each_entry(&process->mem_idr, entry, id) {
		m[index].gpuaddr = entry->memdesc.gpuaddr;
		m[index].size = entry->memdesc.size;
		m[index].type = kgsl_memdesc_get_memtype(&entry->memdesc);
		index++;
	}

	ret = sizeof(*header) + (num_mem * sizeof(struct mem_entry));
out:
+15 −0
Original line number Diff line number Diff line
@@ -2574,6 +2574,13 @@ int32_t npu_host_unload_network(struct npu_client *client,
		return -EINVAL;
	}

	if (network->is_unloading) {
		NPU_ERR("network is unloading\n");
		network_put(network);
		mutex_unlock(&host_ctx->lock);
		return -EINVAL;
	}

	if (!network->is_active) {
		NPU_ERR("network is not active\n");
		network_put(network);
@@ -2591,6 +2598,8 @@ int32_t npu_host_unload_network(struct npu_client *client,
		goto free_network;
	}

	network->is_unloading = true;

	NPU_DBG("Unload network %lld\n", network->id);
	/* prepare IPC packet for UNLOAD */
	unload_packet.header.cmd_type = NPU_IPC_CMD_UNLOAD;
@@ -2724,6 +2733,12 @@ int32_t npu_host_exec_network_v2(struct npu_client *client,
	if (atomic_inc_return(&host_ctx->network_execute_cnt) == 1)
		npu_notify_cdsprm_cxlimit_activity(npu_dev, true);

	if (network->is_unloading) {
		NPU_ERR("network is unloading\n");
		ret = -EINVAL;
		goto exec_v2_done;
	}

	if (!network->is_active) {
		NPU_ERR("network is not active\n");
		ret = -EINVAL;
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ struct npu_network {
	atomic_t ref_cnt;
	bool is_valid;
	bool is_active;
	bool is_unloading;
	bool fw_error;
	struct npu_client *client;
	struct list_head cmd_list;
+2 −2
Original line number Diff line number Diff line
@@ -6238,7 +6238,7 @@ void ipa3_counter_remove_hdl(int hdl)
	offset = counter->hw_counter.start_id - 1;
	if (offset >= 0 && (offset + counter->hw_counter.num_counters)
		< IPA_FLT_RT_HW_COUNTER) {
		memset(&ipa3_ctx->flt_rt_counters.used_hw + offset,
		memset(&ipa3_ctx->flt_rt_counters.used_hw[offset],
			   0, counter->hw_counter.num_counters * sizeof(bool));
	} else {
		IPAERR_RL("unexpected hdl %d\n", hdl);
@@ -6247,7 +6247,7 @@ void ipa3_counter_remove_hdl(int hdl)
	offset = counter->sw_counter.start_id - 1 - IPA_FLT_RT_HW_COUNTER;
	if (offset >= 0 && (offset + counter->sw_counter.num_counters)
		< IPA_FLT_RT_SW_COUNTER) {
		memset(&ipa3_ctx->flt_rt_counters.used_sw + offset,
		memset(&ipa3_ctx->flt_rt_counters.used_sw[offset],
		   0, counter->sw_counter.num_counters * sizeof(bool));
	} else {
		IPAERR_RL("unexpected hdl %d\n", hdl);
+1 −0
Original line number Diff line number Diff line
@@ -872,6 +872,7 @@ static int selinux_set_mnt_opts(struct super_block *sb,
	    !strcmp(sb->s_type->name, "sysfs") ||
	    !strcmp(sb->s_type->name, "pstore") ||
	    !strcmp(sb->s_type->name, "binder") ||
	    !strcmp(sb->s_type->name, "bpf") ||
	    !strcmp(sb->s_type->name, "cgroup") ||
	    !strcmp(sb->s_type->name, "cgroup2"))
		sbsec->flags |= SE_SBGENFS;