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

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

Merge 24aebadd on remote branch

Change-Id: I4648ef27662b718f4d2770ce54fff683df9e9131
parents 3dbc65d8 24aebadd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -499,6 +499,7 @@ CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_ACC=y
CONFIG_USB_CONFIGFS_F_AUDIO_SRC=y
CONFIG_USB_CONFIGFS_F_UAC1=y
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_HID=y
+1 −0
Original line number Diff line number Diff line
@@ -519,6 +519,7 @@ CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_F_ACC=y
CONFIG_USB_CONFIGFS_F_AUDIO_SRC=y
CONFIG_USB_CONFIGFS_F_UAC1=y
CONFIG_USB_CONFIGFS_F_UAC2=y
CONFIG_USB_CONFIGFS_F_MIDI=y
CONFIG_USB_CONFIGFS_F_HID=y
+18 −0
Original line number Diff line number Diff line
@@ -482,6 +482,8 @@ struct fastrpc_file {
	uint32_t ws_timeout;
	/* To indicate attempt has been made to allocate memory for debug_buf */
	int debug_buf_alloced_attempted;
	/* Flag to indicate dynamic process creation status*/
	bool in_process_create;
};

static struct fastrpc_apps gfa;
@@ -2577,6 +2579,15 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
			int siglen;
		} inbuf;

		spin_lock(&fl->hlock);
		if (fl->in_process_create) {
			err = -EALREADY;
			pr_err("Already in create init process\n");
			spin_unlock(&fl->hlock);
			return err;
		}
		fl->in_process_create = true;
		spin_unlock(&fl->hlock);
		inbuf.pgid = fl->tgid;
		inbuf.namelen = strlen(current->comm) + 1;
		inbuf.filelen = init->filelen;
@@ -2788,6 +2799,11 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
		fastrpc_mmap_free(file, 0);
		mutex_unlock(&fl->map_mutex);
	}
	if (init->flags == FASTRPC_INIT_CREATE) {
		spin_lock(&fl->hlock);
		fl->in_process_create = false;
		spin_unlock(&fl->hlock);
	}
	return err;
}

@@ -3700,6 +3716,7 @@ static int fastrpc_file_free(struct fastrpc_file *fl)
	}
	spin_lock(&fl->hlock);
	fl->file_close = 1;
	fl->in_process_create = false;
	spin_unlock(&fl->hlock);
	if (!IS_ERR_OR_NULL(fl->init_mem))
		fastrpc_buf_free(fl->init_mem, 0);
@@ -4101,6 +4118,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
	fl->cid = -1;
	fl->dev_minor = dev_minor;
	fl->init_mem = NULL;
	fl->in_process_create = false;
	memset(&fl->perf, 0, sizeof(fl->perf));
	fl->qos_request = 0;
	fl->dsp_proc_init = 0;
+14 −8
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) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/slab.h>
@@ -1625,7 +1626,6 @@ static int diag_send_dci_pkt(struct diag_cmd_reg_t *entry,
		return -EIO;
	}

	mutex_lock(&driver->dci_mutex);
	/* prepare DCI packet */
	header.start = CONTROL_CHAR;
	header.version = 1;
@@ -1644,7 +1644,6 @@ static int diag_send_dci_pkt(struct diag_cmd_reg_t *entry,
		diag_update_pkt_buffer(driver->apps_dci_buf, write_len,
				       DCI_PKT_TYPE);
		diag_update_sleeping_process(entry->pid, DCI_PKT_TYPE);
		mutex_unlock(&driver->dci_mutex);
		return DIAG_DCI_NO_ERROR;
	}

@@ -1664,7 +1663,6 @@ static int diag_send_dci_pkt(struct diag_cmd_reg_t *entry,
		       entry->proc);
		status = DIAG_DCI_SEND_DATA_FAIL;
	}
	mutex_unlock(&driver->dci_mutex);
	return status;
}

@@ -1989,12 +1987,13 @@ static int diag_process_dci_pkt_rsp(unsigned char *buf, int len)
{
	int ret = DIAG_DCI_TABLE_ERR;
	int common_cmd = 0, header_len = 0;
	int req_tag = 0;
	struct diag_pkt_header_t *header = NULL;
	unsigned char *temp = buf;
	unsigned char *req_buf = NULL;
	uint8_t retry_count = 0, max_retries = 3;
	uint32_t read_len = 0, req_len = len;
	struct dci_pkt_req_entry_t *req_entry = NULL;
	struct dci_pkt_req_entry_t *req_entry = NULL, *test_entry = NULL;
	struct diag_dci_client_tbl *dci_entry = NULL;
	struct dci_pkt_req_t req_hdr;
	struct diag_cmd_reg_t *reg_item;
@@ -2099,6 +2098,7 @@ static int diag_process_dci_pkt_rsp(unsigned char *buf, int len)
		mutex_unlock(&driver->dci_mutex);
		return DIAG_DCI_NO_REG;
	}
	req_tag = req_entry->tag;
	mutex_unlock(&driver->dci_mutex);

	/*
@@ -2106,14 +2106,14 @@ static int diag_process_dci_pkt_rsp(unsigned char *buf, int len)
	 * remote processor
	 */
	if (dci_entry->client_info.token > 0) {
		ret = diag_send_dci_pkt_remote(req_buf, req_len, req_entry->tag,
		ret = diag_send_dci_pkt_remote(req_buf, req_len, req_tag,
					       dci_entry->client_info.token);
		return ret;
	}

	/* Check if it is a dedicated Apps command */
	ret = diag_dci_process_apps_pkt(header, req_buf, req_len,
					req_entry->tag, header_len);
					req_tag, header_len);
	if ((ret == DIAG_DCI_NO_ERROR && !common_cmd) || ret < 0)
		return ret;

@@ -2136,8 +2136,14 @@ static int diag_process_dci_pkt_rsp(unsigned char *buf, int len)
	if (temp_entry) {
		reg_item = container_of(temp_entry, struct diag_cmd_reg_t,
								entry);
		mutex_lock(&driver->dci_mutex);
		test_entry = diag_dci_get_request_entry(req_tag);
		if (test_entry)
			ret = diag_send_dci_pkt(reg_item, req_buf, req_len,
					req_entry->tag);
					test_entry->tag);
		else
			ret = -EIO;
		mutex_unlock(&driver->dci_mutex);
	} else {
		DIAG_LOG(DIAG_DEBUG_DCI, "Command not found: %02x %02x %02x\n",
				reg_entry.cmd_code, reg_entry.subsys_id,
+9 −0
Original line number Diff line number Diff line
@@ -2610,6 +2610,15 @@ static int memdesc_sg_virt(struct kgsl_memdesc *memdesc, unsigned long useraddr)

	ret = sg_alloc_table_from_pages(memdesc->sgt, pages, npages,
					0, memdesc->size, GFP_KERNEL);

	if (ret)
		goto out;

	ret = kgsl_cache_range_op(memdesc, 0, memdesc->size,
			KGSL_CACHE_OP_FLUSH);

	if (ret)
		sg_free_table(memdesc->sgt);
out:
	if (ret) {
		for (i = 0; i < npages; i++)
Loading