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

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

Merge a4341e9d on remote branch

Change-Id: Idee755b787be25ce021f3fd8dd9285f1cdbea82f
parents 363d6732 a4341e9d
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ struct insn_emulation {
static LIST_HEAD(insn_emulation);
static int nr_insn_emulated __initdata;
static DEFINE_RAW_SPINLOCK(insn_emulation_lock);
static DEFINE_MUTEX(insn_emulation_mutex);

static void register_emulation_hooks(struct insn_emulation_ops *ops)
{
@@ -210,10 +211,10 @@ static int emulation_proc_handler(struct ctl_table *table, int write,
				  loff_t *ppos)
{
	int ret = 0;
	struct insn_emulation *insn = (struct insn_emulation *) table->data;
	struct insn_emulation *insn = container_of(table->data, struct insn_emulation, current_mode);
	enum insn_emulation_mode prev_mode = insn->current_mode;

	table->data = &insn->current_mode;
	mutex_lock(&insn_emulation_mutex);
	ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);

	if (ret || !write || prev_mode == insn->current_mode)
@@ -226,7 +227,7 @@ static int emulation_proc_handler(struct ctl_table *table, int write,
		update_insn_emulation_mode(insn, INSN_UNDEF);
	}
ret:
	table->data = insn;
	mutex_unlock(&insn_emulation_mutex);
	return ret;
}

@@ -250,7 +251,7 @@ static void __init register_insn_emulation_sysctl(void)
		sysctl->maxlen = sizeof(int);

		sysctl->procname = insn->ops->name;
		sysctl->data = insn;
		sysctl->data = &insn->current_mode;
		sysctl->extra1 = &insn->min;
		sysctl->extra2 = &insn->max;
		sysctl->proc_handler = emulation_proc_handler;
+14 −4
Original line number Diff line number Diff line
@@ -31,6 +31,16 @@
#include <asm/cputype.h>
#include <asm/topology.h>

/*
 * This function returns the logic cpu number of the node.
 * There are basically three kinds of return values:
 * (1) logic cpu number which is > 0.
 * (2) -ENODEV when the device tree(DT) node is valid and found in the DT but
 * there is no possible logical CPU in the kernel to match. This happens
 * when CONFIG_NR_CPUS is configure to be smaller than the number of
 * CPU nodes in DT. We need to just ignore this case.
 * (3) -1 if the node does not exist in the device tree
 */
static int __init get_cpu_for_node(struct device_node *node)
{
	struct device_node *cpu_node;
@@ -44,8 +54,8 @@ static int __init get_cpu_for_node(struct device_node *node)
	if (cpu >= 0)
		topology_parse_cpu_capacity(cpu_node, cpu);
	else
		pr_crit("Unable to find CPU node for %pOF\n", cpu_node);

		pr_info("CPU node for %pOF exist but the possible cpu range is :%*pbl\n",
			cpu_node, cpumask_pr_args(cpu_possible_mask));
	of_node_put(cpu_node);
	return cpu;
}
@@ -69,7 +79,7 @@ static int __init parse_core(struct device_node *core, int package_id,
				cpu_topology[cpu].package_id = package_id;
				cpu_topology[cpu].core_id = core_id;
				cpu_topology[cpu].thread_id = i;
			} else {
			} else if (cpu != -ENODEV) {
				pr_err("%pOF: Can't get CPU for thread\n",
				       t);
				of_node_put(t);
@@ -90,7 +100,7 @@ static int __init parse_core(struct device_node *core, int package_id,

		cpu_topology[cpu].package_id = package_id;
		cpu_topology[cpu].core_id = core_id;
	} else if (leaf) {
	} else if (leaf && cpu != -ENODEV) {
		pr_err("%pOF: Can't get CPU for leaf core\n", core);
		return -EINVAL;
	}
+12 −0
Original line number Diff line number Diff line
@@ -1948,6 +1948,18 @@ static int binder_inc_ref_for_node(struct binder_proc *proc,
	}
	ret = binder_inc_ref_olocked(ref, strong, target_list);
	*rdata = ref->data;
	if (ret && ref == new_ref) {
		/*
		 * Cleanup the failed reference here as the target
		 * could now be dead and have already released its
		 * references by now. Calling on the new reference
		 * with strong=0 and a tmp_refs will not decrement
		 * the node. The new_ref gets kfree'd below.
		 */
		binder_cleanup_ref_olocked(new_ref);
		ref = NULL;
	}

	binder_proc_unlock(proc);
	if (new_ref && ref != new_ref)
		/*
+5 −2
Original line number Diff line number Diff line
@@ -1466,8 +1466,11 @@ static int context_alloc(struct fastrpc_file *fl, uint32_t kernel,

	spin_lock(&fl->hlock);
	hlist_add_head(&ctx->hn, &clst->pending);
	cid = (fl->cid >= ADSP_DOMAIN_ID && fl->cid < NUM_CHANNELS)
			? fl->cid : 0;
	if (!(fl->cid >= ADSP_DOMAIN_ID && fl->cid < NUM_CHANNELS)) {
		err = -ECHRNG;
		goto bail;
	}
	cid = fl->cid;
	chan = &me->channel[cid];
	spin_unlock(&fl->hlock);

+71 −0
Original line number Diff line number Diff line
@@ -2093,6 +2093,71 @@ struct uvc_device_info {
	u32	meta_format;
};

/* ------------------------------------------------------------------------
 * set urb queue size and urb packet size
 *
 */
static ssize_t store_urb_config(struct device *dev,
		struct device_attribute *attr, const char *buff, size_t count)
{
	struct uvc_streaming *stream;
	struct usb_interface *intf = to_usb_interface(dev);
	struct uvc_device *udev = usb_get_intfdata(intf);
	long max_urb, max_urb_packets;
	int ret;
	char *arr, *tmp;

	arr = kstrdup(buff, GFP_KERNEL);

	if (!arr)
		return -ENOMEM;

	tmp = strsep(&arr, ":");

	if (!tmp)
		return -EINVAL;

	ret = kstrtol(tmp, 10, &max_urb);
		if (ret < 0)
			return ret;

	tmp = strsep(&arr, ":");
	if (!tmp)
		return -EINVAL;

	ret = kstrtol(tmp, 10, &max_urb_packets);
		if (ret < 0)
			return ret;

	if (max_urb <= 0 || max_urb > 128 ||
		max_urb_packets <= 0 || max_urb_packets > 128)
		return -EINVAL;

	list_for_each_entry(stream, &udev->streams, list) {
		if (stream->refcnt)
			continue;
		stream->max_urb = max_urb;
		stream->max_urb_packets = max_urb_packets;
	}

	return count;
}

static ssize_t show_urb_config(struct device *dev,
		struct device_attribute *attr, char *buff)
{
	return 0;
}

static struct device_attribute urb_config_attr = {
	.attr = {
		.name = "urb_config",
		.mode = 00660,
	},
	.show = show_urb_config,
	.store = store_urb_config,
};

static int uvc_probe(struct usb_interface *intf,
		     const struct usb_device_id *id)
{
@@ -2225,6 +2290,12 @@ static int uvc_probe(struct usb_interface *intf,

	uvc_trace(UVC_TRACE_PROBE, "UVC device initialized.\n");
	usb_enable_autosuspend(udev);

	/* sysfs file for dynamically setting urb configs */
	ret = sysfs_create_file(&dev->intf->dev.kobj, &urb_config_attr.attr);
	if (ret != 0)
		pr_info("Unable to initialize urb configuration: %d\n", ret);

	return 0;

error:
Loading