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

Commit 15ea4343 authored by android-t1's avatar android-t1
Browse files

Merge remote-tracking branch 'origin/Bitra.LA.3.2.1-target' into fp4t-target-0414

Change-Id: Ie354739d0090a41e57b0479acab3fa79c5214443
parents 321fc9d0 53148679
Loading
Loading
Loading
Loading
+23 −15
Original line number Diff line number Diff line
@@ -483,7 +483,7 @@ struct fastrpc_file {
	/* 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;
	enum fastrpc_process_create_state dsp_process_state;
	struct completion shutdown;
};

@@ -2538,7 +2538,7 @@ static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl, int locked);
static int fastrpc_init_process(struct fastrpc_file *fl,
				struct fastrpc_ioctl_init_attrs *uproc)
{
	int err = 0, rh_hyp_done = 0;
	int err = 0, rh_hyp_done = 0, locked = 0;
	struct fastrpc_apps *me = &gfa;
	struct fastrpc_ioctl_invoke_crc ioctl;
	struct fastrpc_ioctl_init *init = &uproc->init;
@@ -2552,6 +2552,7 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
	int unsigned_request = proc_attrs && init_flags;
	int cid = fl->cid;
	struct fastrpc_channel_ctx *chan = &me->channel[cid];
	struct fastrpc_buf *init_mem;

	if (chan->unsigned_support &&
		fl->dev_minor == MINOR_NUM_DEV) {
@@ -2617,13 +2618,13 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
		} inbuf;

		spin_lock(&fl->hlock);
		if (fl->in_process_create) {
		if (fl->dsp_process_state) {
			err = -EALREADY;
			pr_err("Already in create init process\n");
			spin_unlock(&fl->hlock);
			return err;
		}
		fl->in_process_create = true;
		fl->dsp_process_state = PROCESS_CREATE_IS_INPROGRESS;
		spin_unlock(&fl->hlock);
		inbuf.pgid = fl->tgid;
		inbuf.namelen = strlen(current->comm) + 1;
@@ -2832,20 +2833,27 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
		fastrpc_mmap_free(mem, 0);
		mutex_unlock(&fl->map_mutex);
	}
	if (err) {
		if (!IS_ERR_OR_NULL(fl->init_mem)) {
			fastrpc_buf_free(fl->init_mem, 0);
			fl->init_mem = NULL;
		}
	}
	if (file) {
		mutex_lock(&fl->map_mutex);
		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;
	locked = 1;
	if (err) {
		fl->dsp_process_state = PROCESS_CREATE_DEFAULT;
		if (!IS_ERR_OR_NULL(fl->init_mem)) {
			init_mem = fl->init_mem;
			fl->init_mem = NULL;
			locked = 0;
			spin_unlock(&fl->hlock);
			fastrpc_buf_free(init_mem, 0);
		}
	} else {
		fl->dsp_process_state = PROCESS_CREATE_SUCCESS;
	}
	if (locked) {
		locked = 0;
		spin_unlock(&fl->hlock);
	}
	return err;
@@ -3811,7 +3819,7 @@ static int fastrpc_file_free(struct fastrpc_file *fl)
	}
	spin_lock(&fl->hlock);
	fl->file_close = 1;
	fl->in_process_create = false;
	fl->dsp_process_state = PROCESS_CREATE_DEFAULT;
	spin_unlock(&fl->hlock);
	if (!IS_ERR_OR_NULL(fl->init_mem))
		fastrpc_buf_free(fl->init_mem, 0);
@@ -4213,7 +4221,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;
	fl->dsp_process_state = PROCESS_CREATE_DEFAULT;
	memset(&fl->perf, 0, sizeof(fl->perf));
	fl->qos_request = 0;
	fl->dsp_proc_init = 0;
+9 −0
Original line number Diff line number Diff line
@@ -319,6 +319,15 @@ struct smq_invoke_rsp {
	int retval;	             /* invoke return value */
};

enum fastrpc_process_create_state {
	/* Process is not created */
	PROCESS_CREATE_DEFAULT			= 0,
	/* Process creation is in progress */
	PROCESS_CREATE_IS_INPROGRESS	= 1,
	/* Process creation is successful */
	PROCESS_CREATE_SUCCESS			= 2,
};

enum fastrpc_response_flags {
	NORMAL_RESPONSE = 0,
	EARLY_RESPONSE = 1,
+9 −1
Original line number Diff line number Diff line
@@ -2036,7 +2036,9 @@ static inline long qcedev_ioctl(struct file *file,
				goto exit_free_qcedev_areq;
			}

			if (map_buf.num_fds > QCEDEV_MAX_BUFFERS) {
			if (map_buf.num_fds > ARRAY_SIZE(map_buf.fd)) {
				pr_err("%s: err: num_fds = %d exceeds max value\n",
				__func__, map_buf.num_fds);
				err = -EINVAL;
				goto exit_free_qcedev_areq;
			}
@@ -2076,6 +2078,12 @@ static inline long qcedev_ioctl(struct file *file,
				err = -EFAULT;
				goto exit_free_qcedev_areq;
			}
			if (unmap_buf.num_fds > ARRAY_SIZE(unmap_buf.fd)) {
				pr_err("%s: err: num_fds = %d exceeds max value\n",
				__func__, unmap_buf.num_fds);
				err = -EINVAL;
				goto exit_free_qcedev_areq;
			}

			for (i = 0; i < unmap_buf.num_fds; i++) {
				err = qcedev_check_and_unmap_buffer(handle,
+1 −0
Original line number Diff line number Diff line
@@ -2931,6 +2931,7 @@ static int __power_collapse(struct iris_hfi_device *device, bool force)
	dprintk(CVP_WARN, "Skip PC(%#x, %#x, %#x)\n",
		wfi_status, idle_status, pc_ready);
	__flush_debug_queue(device, device->raw_packet);
	__dsp_resume(device, 0);
	return -EAGAIN;
}

+6 −15
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
struct dentry *my_direc;
const char delim[] = ",";
int columns = NAME_COLUMN |
	BOUND_COLUMN | STATE_COLUMN | ERROR_CODES;
BOUND_COLUMN | ERROR_CODES;

void populate_bound_rows(
	struct synx_table_row *row,
@@ -29,14 +29,13 @@ void populate_bound_rows(
	char *end)
{
	int j;
	int state = SYNX_STATE_INVALID;


	for (j = 0; j < row->num_bound_synxs;
		j++) {
		cur += scnprintf(cur, end - cur,
			"\n\tID: %d State: %s",
			row->bound_synxs[j].external_data->synx_obj,
			state);
			"\n\tID: %d ",
			row->bound_synxs[j].external_data->synx_obj);
	}
}
static ssize_t synx_table_read(struct file *file,
@@ -51,7 +50,6 @@ static ssize_t synx_table_read(struct file *file,
	char *dbuf, *cur, *end;

	int i = 0;
	int state = SYNX_STATE_INVALID;
	ssize_t len = 0;
	s32 index;

@@ -64,17 +62,15 @@ static ssize_t synx_table_read(struct file *file,
		cur += scnprintf(cur, end - cur, "|   Name   |");
	if (columns & BOUND_COLUMN)
		cur += scnprintf(cur, end - cur, "|   Bound   |");
	if (columns & STATE_COLUMN)
		cur += scnprintf(cur, end - cur, "|  Status  |");
	cur += scnprintf(cur, end - cur, "\n");
	for (i = 0; i < SYNX_MAX_OBJS; i++) {
	for (i = 1; i < SYNX_MAX_OBJS; i++) {
		row = &dev->synx_table[i];

		index = row->index;
		mutex_lock(&dev->row_locks[index]);
		if (!row->index) {
			mutex_unlock(&dev->row_locks[index]);
			pr_warn("synx obj at %d invalid\n", index);
			pr_debug("synx obj at %d invalid\n", index);
			continue;
		}

@@ -84,11 +80,6 @@ static ssize_t synx_table_read(struct file *file,
		if (columns & BOUND_COLUMN)
			cur += scnprintf(cur, end - cur,
				"|%11d|", row->num_bound_synxs);
		if (columns & STATE_COLUMN) {
			state = synx_status(row);
			cur += scnprintf(cur, end - cur,
				"|%10d|", state);
		}
		if ((columns & BOUND_COLUMN) &&
			(row->num_bound_synxs > 0)) {
			cur += scnprintf(
Loading