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

Commit 7d2cf272 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge changes I85dfbe98,I8ddf46a6,I7bb29d74,Ifde08970 into msm-4.14

* changes:
  irqchip: gic-v3: Use of_cpu_node_to_id helper
  coresight: of: Use of_cpu_node_to_id helper
  of: Add helper for mapping device node to logical CPU number
  perf: Export perf_event_update_userpage
parents bcf070ec f3ad2b41
Loading
Loading
Loading
Loading
+6 −15
Original line number Diff line number Diff line
@@ -104,26 +104,17 @@ static int of_coresight_alloc_memory(struct device *dev,
int of_coresight_get_cpu(const struct device_node *node)
{
	int cpu;
	bool found;
	struct device_node *dn, *np;
	struct device_node *dn;

	dn = of_parse_phandle(node, "cpu", 0);

	/* Affinity defaults to invalid */
	/* Affinity defaults to CPU0 */
	if (!dn)
		return -ENODEV;

	for_each_possible_cpu(cpu) {
		np = of_cpu_device_node_get(cpu);
		found = (dn == np);
		of_node_put(np);
		if (found)
			break;
	}
		return 0;
	cpu = of_cpu_node_to_id(dn);
	of_node_put(dn);

	/* Affinity to invalid if no cpu nodes are found */
	return found ? cpu : -ENODEV;
	/* Affinity to CPU0 if no cpu nodes are found */
	return (cpu < 0) ? 0 : cpu;
}
EXPORT_SYMBOL_GPL(of_coresight_get_cpu);

+2 −27
Original line number Diff line number Diff line
@@ -1047,31 +1047,6 @@ static int __init gic_validate_dist_version(void __iomem *dist_base)
	return 0;
}

static int get_cpu_number(struct device_node *dn)
{
	const __be32 *cell;
	u64 hwid;
	int cpu;

	cell = of_get_property(dn, "reg", NULL);
	if (!cell)
		return -1;

	hwid = of_read_number(cell, of_n_addr_cells(dn));

	/*
	 * Non affinity bits must be set to 0 in the DT
	 */
	if (hwid & ~MPIDR_HWID_BITMASK)
		return -1;

	for_each_possible_cpu(cpu)
		if (cpu_logical_map(cpu) == hwid)
			return cpu;

	return -1;
}

/* Create all possible partitions at boot time */
static void __init gic_populate_ppi_partitions(struct device_node *gic_node)
{
@@ -1122,8 +1097,8 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node)
			if (WARN_ON(!cpu_node))
				continue;

			cpu = get_cpu_number(cpu_node);
			if (WARN_ON(cpu == -1))
			cpu = of_cpu_node_to_id(cpu_node);
			if (WARN_ON(cpu < 0))
				continue;

			pr_cont("%pOF[%d] ", cpu_node, cpu);
+26 −0
Original line number Diff line number Diff line
@@ -417,6 +417,32 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread)
}
EXPORT_SYMBOL(of_get_cpu_node);

/**
 * of_cpu_node_to_id: Get the logical CPU number for a given device_node
 *
 * @cpu_node: Pointer to the device_node for CPU.
 *
 * Returns the logical CPU number of the given CPU device_node.
 * Returns -ENODEV if the CPU is not found.
 */
int of_cpu_node_to_id(struct device_node *cpu_node)
{
	int cpu;
	bool found = false;
	struct device_node *np;

	for_each_possible_cpu(cpu) {
		np = of_cpu_device_node_get(cpu);
		found = (cpu_node == np);
		of_node_put(np);
		if (found)
			return cpu;
	}

	return -ENODEV;
}
EXPORT_SYMBOL(of_cpu_node_to_id);

/**
 * __of_device_is_compatible() - Check if the node matches given constraints
 * @device: pointer to node
+7 −0
Original line number Diff line number Diff line
@@ -538,6 +538,8 @@ const char *of_prop_next_string(struct property *prop, const char *cur);

bool of_console_check(struct device_node *dn, char *name, int index);

extern int of_cpu_node_to_id(struct device_node *np);

#else /* CONFIG_OF */

static inline void of_core_init(void)
@@ -872,6 +874,11 @@ static inline void of_property_clear_flag(struct property *p, unsigned long flag
{
}

static inline int of_cpu_node_to_id(struct device_node *np)
{
	return -ENODEV;
}

#define of_match_ptr(_ptr)	NULL
#define of_match_node(_matches, _node)	NULL
#endif /* CONFIG_OF */
+1 −0
Original line number Diff line number Diff line
@@ -5181,6 +5181,7 @@ void perf_event_update_userpage(struct perf_event *event)
unlock:
	rcu_read_unlock();
}
EXPORT_SYMBOL_GPL(perf_event_update_userpage);

static int perf_mmap_fault(struct vm_fault *vmf)
{