LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 06/19] driver/core: cpu: initialize of_node in cpu's device struture
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

CPUs are also registered as devices but the of_node in these cpu
devices are not initialized. Currently different drivers requiring
to access cpu device node are parsing the nodes themselves and
initialising the of_node in cpu device.

The of_node in all the cpu devices needs to be initialized properly
and at one place. The best place to update this is CPU subsystem
driver when registering the cpu devices.

The OF/DT core library now provides of_get_cpu_node to retrieve a cpu
device node for a given logical index by abstracting the architecture
specific details.

This patch uses of_get_cpu_node to assign of_node when registering the
cpu devices.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 drivers/base/cpu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 4c358bc..4cf0717 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -14,6 +14,7 @@
 #include <linux/slab.h>
 #include <linux/percpu.h>
 #include <linux/acpi.h>
+#include <linux/of.h>
=20
 #include "base.h"
=20
@@ -289,6 +290,7 @@ int register_cpu(struct cpu *cpu, int num)
 =09cpu->dev.release =3D cpu_device_release;
 =09cpu->dev.offline_disabled =3D !cpu->hotpluggable;
 =09cpu->dev.offline =3D !cpu_online(num);
+=09cpu->dev.of_node =3D of_get_cpu_node(num, NULL);
 #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
 =09cpu->dev.bus->uevent =3D arch_cpu_uevent;
 #endif
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 07/19] of/device: add helper to get cpu device node from logical cpu index
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Multiple drivers need to get the cpu device node from the cpu logical
index and then access the of_node.

This patch adds helper function to fetch the device node directly.

Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 include/linux/of_device.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 9d27475..82ce324 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -1,6 +1,7 @@
 #ifndef _LINUX_OF_DEVICE_H
 #define _LINUX_OF_DEVICE_H
=20
+#include <linux/cpu.h>
 #include <linux/platform_device.h>
 #include <linux/of_platform.h> /* temporary until merge */
=20
@@ -43,6 +44,15 @@ static inline void of_device_node_put(struct device *dev=
)
 =09of_node_put(dev->of_node);
 }
=20
+static inline struct device_node *of_cpu_device_node_get(int cpu)
+{
+=09struct device *cpu_dev;
+=09cpu_dev =3D get_cpu_device(cpu);
+=09if (!cpu_dev)
+=09=09return NULL;
+=09return of_node_get(cpu_dev->of_node);
+}
+
 #else /* CONFIG_OF */
=20
 static inline int of_driver_match_device(struct device *dev,
@@ -67,6 +77,11 @@ static inline const struct of_device_id *of_match_device=
(
 {
 =09return NULL;
 }
+
+static inline struct device_node *of_cpu_device_node_get(int cpu)
+{
+=09return NULL;
+}
 #endif /* CONFIG_OF */
=20
 #endif /* _LINUX_OF_DEVICE_H */
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 08/19] ARM: topology: remove hwid/MPIDR dependency from cpu_capacity
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Lorenzo Pieralisi, Russell King,
	Greg Kroah-Hartman, Sudeep KarkadaNagesha, Viresh Kumar,
	Rob Herring, Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Currently the topology code computes cpu capacity and stores it in
the list along with hwid(which is MPIDR) as it parses the CPU nodes
in the device tree. This is required as it needs to be mapped to the
logical CPU later.

Since the CPU device nodes can be retrieved in the logical ordering
using DT/OF helpers, its possible to store cpu_capacity also in logical
ordering and avoid storing hwid for each entry.

This patch removes hwid by making use of of_get_cpu_node.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 arch/arm/kernel/topology.c | 61 +++++++++++++++---------------------------=
----
 1 file changed, 19 insertions(+), 42 deletions(-)

diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index c5a5954..85a8737 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -74,12 +74,8 @@ struct cpu_efficiency table_efficiency[] =3D {
 =09{NULL, },
 };
=20
-struct cpu_capacity {
-=09unsigned long hwid;
-=09unsigned long capacity;
-};
-
-struct cpu_capacity *cpu_capacity;
+unsigned long *__cpu_capacity;
+#define cpu_capacity(cpu)=09__cpu_capacity[cpu]
=20
 unsigned long middle_capacity =3D 1;
=20
@@ -100,15 +96,19 @@ static void __init parse_dt_topology(void)
 =09unsigned long capacity =3D 0;
 =09int alloc_size, cpu =3D 0;
=20
-=09alloc_size =3D nr_cpu_ids * sizeof(struct cpu_capacity);
-=09cpu_capacity =3D kzalloc(alloc_size, GFP_NOWAIT);
+=09alloc_size =3D nr_cpu_ids * sizeof(*__cpu_capacity);
+=09__cpu_capacity =3D kzalloc(alloc_size, GFP_NOWAIT);
=20
-=09while ((cn =3D of_find_node_by_type(cn, "cpu"))) {
-=09=09const u32 *rate, *reg;
+=09for_each_possible_cpu(cpu) {
+=09=09const u32 *rate;
 =09=09int len;
=20
-=09=09if (cpu >=3D num_possible_cpus())
-=09=09=09break;
+=09=09/* too early to use cpu->of_node */
+=09=09cn =3D of_get_cpu_node(cpu, NULL);
+=09=09if (!cn) {
+=09=09=09pr_err("missing device node for CPU %d\n", cpu);
+=09=09=09continue;
+=09=09}
=20
 =09=09for (cpu_eff =3D table_efficiency; cpu_eff->compatible; cpu_eff++)
 =09=09=09if (of_device_is_compatible(cn, cpu_eff->compatible))
@@ -124,12 +124,6 @@ static void __init parse_dt_topology(void)
 =09=09=09continue;
 =09=09}
=20
-=09=09reg =3D of_get_property(cn, "reg", &len);
-=09=09if (!reg || len !=3D 4) {
-=09=09=09pr_err("%s missing reg property\n", cn->full_name);
-=09=09=09continue;
-=09=09}
-
 =09=09capacity =3D ((be32_to_cpup(rate)) >> 20) * cpu_eff->efficiency;
=20
 =09=09/* Save min capacity of the system */
@@ -140,13 +134,9 @@ static void __init parse_dt_topology(void)
 =09=09if (capacity > max_capacity)
 =09=09=09max_capacity =3D capacity;
=20
-=09=09cpu_capacity[cpu].capacity =3D capacity;
-=09=09cpu_capacity[cpu++].hwid =3D be32_to_cpup(reg);
+=09=09cpu_capacity(cpu) =3D capacity;
 =09}
=20
-=09if (cpu < num_possible_cpus())
-=09=09cpu_capacity[cpu].hwid =3D (unsigned long)(-1);
-
 =09/* If min and max capacities are equals, we bypass the update of the
 =09 * cpu_scale because all CPUs have the same capacity. Otherwise, we
 =09 * compute a middle_capacity factor that will ensure that the capacity
@@ -154,9 +144,7 @@ static void __init parse_dt_topology(void)
 =09 * SCHED_POWER_SCALE, which is the default value, but with the
 =09 * constraint explained near table_efficiency[].
 =09 */
-=09if (min_capacity =3D=3D max_capacity)
-=09=09cpu_capacity[0].hwid =3D (unsigned long)(-1);
-=09else if (4*max_capacity < (3*(max_capacity + min_capacity)))
+=09if (4*max_capacity < (3*(max_capacity + min_capacity)))
 =09=09middle_capacity =3D (min_capacity + max_capacity)
 =09=09=09=09>> (SCHED_POWER_SHIFT+1);
 =09else
@@ -170,23 +158,12 @@ static void __init parse_dt_topology(void)
  * boot. The update of all CPUs is in O(n^2) for heteregeneous system but =
the
  * function returns directly for SMP system.
  */
-void update_cpu_power(unsigned int cpu, unsigned long hwid)
+void update_cpu_power(unsigned int cpu)
 {
-=09unsigned int idx =3D 0;
-
-=09/* look for the cpu's hwid in the cpu capacity table */
-=09for (idx =3D 0; idx < num_possible_cpus(); idx++) {
-=09=09if (cpu_capacity[idx].hwid =3D=3D hwid)
-=09=09=09break;
-
-=09=09if (cpu_capacity[idx].hwid =3D=3D -1)
-=09=09=09return;
-=09}
-
-=09if (idx =3D=3D num_possible_cpus())
+=09if (!cpu_capacity(cpu))
 =09=09return;
=20
-=09set_power_scale(cpu, cpu_capacity[idx].capacity / middle_capacity);
+=09set_power_scale(cpu, cpu_capacity(cpu) / middle_capacity);
=20
 =09printk(KERN_INFO "CPU%u: update cpu_power %lu\n",
 =09=09cpu, arch_scale_freq_power(NULL, cpu));
@@ -194,7 +171,7 @@ void update_cpu_power(unsigned int cpu, unsigned long h=
wid)
=20
 #else
 static inline void parse_dt_topology(void) {}
-static inline void update_cpu_power(unsigned int cpuid, unsigned int mpidr=
) {}
+static inline void update_cpu_power(unsigned int cpuid) {}
 #endif
=20
  /*
@@ -281,7 +258,7 @@ void store_cpu_topology(unsigned int cpuid)
=20
 =09update_siblings_masks(cpuid);
=20
-=09update_cpu_power(cpuid, mpidr & MPIDR_HWID_BITMASK);
+=09update_cpu_power(cpuid);
=20
 =09printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n",
 =09=09cpuid, cpu_topology[cpuid].thread_id,
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 09/19] ARM: mvebu: remove device tree parsing for cpu nodes
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Andrew Lunn, Michal Simek, Jason Cooper,
	Greg Kroah-Hartman, Sudeep KarkadaNagesha, Viresh Kumar,
	Rob Herring, Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Currently set_secondary_cpus_clock assume the CPU logical ordering
and the MPDIR in DT are same, which is incorrect.

Since the CPU device nodes can be retrieved in the logical ordering
using the DT helper, we can remove the devices tree parsing.

This patch removes DT parsing by making use of of_get_cpu_node.

Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Jason Cooper <jason@lakedaemon.net>
Acked-by: Gregory Clement <gregory.clement@free-electrons.com>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 arch/arm/mach-mvebu/platsmp.c | 51 +++++++++++++++++++--------------------=
----
 1 file changed, 23 insertions(+), 28 deletions(-)

diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
index ce81d30..594b63d 100644
--- a/arch/arm/mach-mvebu/platsmp.c
+++ b/arch/arm/mach-mvebu/platsmp.c
@@ -29,45 +29,40 @@
 #include "pmsu.h"
 #include "coherency.h"
=20
+static struct clk *__init get_cpu_clk(int cpu)
+{
+=09struct clk *cpu_clk;
+=09struct device_node *np =3D of_get_cpu_node(cpu, NULL);
+
+=09if (WARN(!np, "missing cpu node\n"))
+=09=09return NULL;
+=09cpu_clk =3D of_clk_get(np, 0);
+=09if (WARN_ON(IS_ERR(cpu_clk)))
+=09=09return NULL;
+=09return cpu_clk;
+}
+
 void __init set_secondary_cpus_clock(void)
 {
-=09int thiscpu;
+=09int thiscpu, cpu;
 =09unsigned long rate;
-=09struct clk *cpu_clk =3D NULL;
-=09struct device_node *np =3D NULL;
+=09struct clk *cpu_clk;
=20
 =09thiscpu =3D smp_processor_id();
-=09for_each_node_by_type(np, "cpu") {
-=09=09int err;
-=09=09int cpu;
-
-=09=09err =3D of_property_read_u32(np, "reg", &cpu);
-=09=09if (WARN_ON(err))
-=09=09=09return;
-
-=09=09if (cpu =3D=3D thiscpu) {
-=09=09=09cpu_clk =3D of_clk_get(np, 0);
-=09=09=09break;
-=09=09}
-=09}
-=09if (WARN_ON(IS_ERR(cpu_clk)))
+=09cpu_clk =3D get_cpu_clk(thiscpu);
+=09if (!cpu_clk)
 =09=09return;
 =09clk_prepare_enable(cpu_clk);
 =09rate =3D clk_get_rate(cpu_clk);
=20
 =09/* set all the other CPU clk to the same rate than the boot CPU */
-=09for_each_node_by_type(np, "cpu") {
-=09=09int err;
-=09=09int cpu;
-
-=09=09err =3D of_property_read_u32(np, "reg", &cpu);
-=09=09if (WARN_ON(err))
+=09for_each_possible_cpu(cpu) {
+=09=09if (cpu =3D=3D thiscpu)
+=09=09=09continue;
+=09=09cpu_clk =3D get_cpu_clk(cpu);
+=09=09if (!cpu_clk)
 =09=09=09return;
-
-=09=09if (cpu !=3D thiscpu) {
-=09=09=09cpu_clk =3D of_clk_get(np, 0);
-=09=09=09clk_set_rate(cpu_clk, rate);
-=09=09}
+=09=09clk_set_rate(cpu_clk, rate);
 =09}
 }
=20
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 10/19] drivers/bus: arm-cci: avoid parsing DT for cpu device nodes
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Lorenzo Pieralisi, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Since the CPU device nodes can be retrieved using arch_of_get_cpu_node,
we can use it to avoid parsing the cpus node searching the cpu nodes and
mapping to logical index.

This patch removes parsing DT for cpu nodes by using of_get_cpu_node.

Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 drivers/bus/arm-cci.c | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index 7332889..2009266 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -122,17 +122,8 @@ EXPORT_SYMBOL_GPL(cci_ace_get_port);
=20
 static void __init cci_ace_init_ports(void)
 {
-=09int port, ac, cpu;
-=09u64 hwid;
-=09const u32 *cell;
-=09struct device_node *cpun, *cpus;
-
-=09cpus =3D of_find_node_by_path("/cpus");
-=09if (WARN(!cpus, "Missing cpus node, bailing out\n"))
-=09=09return;
-
-=09if (WARN_ON(of_property_read_u32(cpus, "#address-cells", &ac)))
-=09=09ac =3D of_n_addr_cells(cpus);
+=09int port, cpu;
+=09struct device_node *cpun;
=20
 =09/*
 =09 * Port index look-up speeds up the function disabling ports by CPU,
@@ -141,18 +132,13 @@ static void __init cci_ace_init_ports(void)
 =09 * The stashed index array is initialized for all possible CPUs
 =09 * at probe time.
 =09 */
-=09for_each_child_of_node(cpus, cpun) {
-=09=09if (of_node_cmp(cpun->type, "cpu"))
-=09=09=09continue;
-=09=09cell =3D of_get_property(cpun, "reg", NULL);
-=09=09if (WARN(!cell, "%s: missing reg property\n", cpun->full_name))
-=09=09=09continue;
-
-=09=09hwid =3D of_read_number(cell, ac);
-=09=09cpu =3D get_logical_index(hwid & MPIDR_HWID_BITMASK);
+=09for_each_possible_cpu(cpu) {
+=09=09/* too early to use cpu->of_node */
+=09=09cpun =3D of_get_cpu_node(cpu, NULL);
=20
-=09=09if (cpu < 0 || !cpu_possible(cpu))
+=09=09if (WARN(!cpun, "Missing cpu device node\n"))
 =09=09=09continue;
+
 =09=09port =3D __cci_ace_get_port(cpun, ACE_PORT);
 =09=09if (port < 0)
 =09=09=09continue;
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 11/19] cpufreq: imx6q-cpufreq: remove device tree parsing for cpu nodes
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Now that the cpu device registration initialises the of_node(if available)
appropriately for all the cpus, parsing here is redundant.

This patch removes all DT parsing and uses cpu->of_node instead.

Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 arch/arm/mach-imx/mach-imx6q.c  | 3 +--
 drivers/cpufreq/imx6q-cpufreq.c | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.=
c
index 7be13f8..a02f275 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -254,13 +254,12 @@ static void __init imx6q_opp_init(struct device *cpu_=
dev)
 {
 =09struct device_node *np;
=20
-=09np =3D of_find_node_by_path("/cpus/cpu@0");
+=09np =3D of_node_get(cpu_dev->of_node);
 =09if (!np) {
 =09=09pr_warn("failed to find cpu0 node\n");
 =09=09return;
 =09}
=20
-=09cpu_dev->of_node =3D np;
 =09if (of_init_opp_table(cpu_dev)) {
 =09=09pr_warn("failed to init OPP table\n");
 =09=09goto put_node;
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufre=
q.c
index e37cdae..b16632b 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -221,14 +221,12 @@ static int imx6q_cpufreq_probe(struct platform_device=
 *pdev)
=20
 =09cpu_dev =3D &pdev->dev;
=20
-=09np =3D of_find_node_by_path("/cpus/cpu@0");
+=09np =3D of_node_get(cpu_dev->of_node);
 =09if (!np) {
 =09=09dev_err(cpu_dev, "failed to find cpu0 node\n");
 =09=09return -ENOENT;
 =09}
=20
-=09cpu_dev->of_node =3D np;
-
 =09arm_clk =3D devm_clk_get(cpu_dev, "arm");
 =09pll1_sys_clk =3D devm_clk_get(cpu_dev, "pll1_sys");
 =09pll1_sw_clk =3D devm_clk_get(cpu_dev, "pll1_sw");
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 12/19] cpufreq: cpufreq-cpu0: remove device tree parsing for cpu nodes
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Now that the cpu device registration initialises the of_node(if available)
appropriately for all the cpus, parsing here is redundant.

This patch removes all DT parsing and uses cpu->of_node instead.

Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 drivers/cpufreq/cpufreq-cpu0.c | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.=
c
index ad1fde2..5b05c26 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -174,29 +174,17 @@ static struct cpufreq_driver cpu0_cpufreq_driver =3D =
{
=20
 static int cpu0_cpufreq_probe(struct platform_device *pdev)
 {
-=09struct device_node *np, *parent;
+=09struct device_node *np;
 =09int ret;
=20
-=09parent =3D of_find_node_by_path("/cpus");
-=09if (!parent) {
-=09=09pr_err("failed to find OF /cpus\n");
-=09=09return -ENOENT;
-=09}
-
-=09for_each_child_of_node(parent, np) {
-=09=09if (of_get_property(np, "operating-points", NULL))
-=09=09=09break;
-=09}
+=09cpu_dev =3D &pdev->dev;
=20
+=09np =3D of_node_get(cpu_dev->of_node);
 =09if (!np) {
 =09=09pr_err("failed to find cpu0 node\n");
-=09=09ret =3D -ENOENT;
-=09=09goto out_put_parent;
+=09=09return -ENOENT;
 =09}
=20
-=09cpu_dev =3D &pdev->dev;
-=09cpu_dev->of_node =3D np;
-
 =09cpu_reg =3D devm_regulator_get(cpu_dev, "cpu0");
 =09if (IS_ERR(cpu_reg)) {
 =09=09/*
@@ -269,15 +257,12 @@ static int cpu0_cpufreq_probe(struct platform_device =
*pdev)
 =09}
=20
 =09of_node_put(np);
-=09of_node_put(parent);
 =09return 0;
=20
 out_free_table:
 =09opp_free_cpufreq_table(cpu_dev, &freq_table);
 out_put_node:
 =09of_node_put(np);
-out_put_parent:
-=09of_node_put(parent);
 =09return ret;
 }
=20
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 13/19] cpufreq: highbank-cpufreq: remove device tree parsing for cpu nodes
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Mark Langsdorf, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Now that the cpu device registration initialises the of_node(if available)
appropriately for all the cpus, parsing here is redundant.

This patch removes all DT parsing and uses cpu->of_node instead.

Cc: Mark Langsdorf <mark.langsdorf@calxeda.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 drivers/cpufreq/highbank-cpufreq.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/cpufreq/highbank-cpufreq.c b/drivers/cpufreq/highbank-=
cpufreq.c
index b61b5a3..794123f 100644
--- a/drivers/cpufreq/highbank-cpufreq.c
+++ b/drivers/cpufreq/highbank-cpufreq.c
@@ -69,23 +69,17 @@ static int hb_cpufreq_driver_init(void)
 =09if (!of_machine_is_compatible("calxeda,highbank"))
 =09=09return -ENODEV;
=20
-=09for_each_child_of_node(of_find_node_by_path("/cpus"), np)
-=09=09if (of_get_property(np, "operating-points", NULL))
-=09=09=09break;
-
-=09if (!np) {
-=09=09pr_err("failed to find highbank cpufreq node\n");
-=09=09return -ENOENT;
-=09}
-
 =09cpu_dev =3D get_cpu_device(0);
 =09if (!cpu_dev) {
 =09=09pr_err("failed to get highbank cpufreq device\n");
-=09=09ret =3D -ENODEV;
-=09=09goto out_put_node;
+=09=09return -ENODEV;
 =09}
=20
-=09cpu_dev->of_node =3D np;
+=09np =3D of_node_get(cpu_dev->of_node);
+=09if (!np) {
+=09=09pr_err("failed to find highbank cpufreq node\n");
+=09=09return -ENOENT;
+=09}
=20
 =09cpu_clk =3D clk_get(cpu_dev, NULL);
 =09if (IS_ERR(cpu_clk)) {
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 15/19] cpufreq: kirkwood-cpufreq: remove device tree parsing for cpu nodes
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Jason Cooper, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Now that the cpu device registration initialises the of_node(if available)
appropriately for all the cpus, parsing here is redundant.

This patch removes all DT parsing and uses cpu->of_node instead.

Cc: Jason Cooper <jason@lakedaemon.net>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 drivers/cpufreq/kirkwood-cpufreq.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-=
cpufreq.c
index c233ea6..25ac2cb 100644
--- a/drivers/cpufreq/kirkwood-cpufreq.c
+++ b/drivers/cpufreq/kirkwood-cpufreq.c
@@ -14,7 +14,7 @@
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/cpufreq.h>
-#include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <asm/proc-fns.h>
@@ -175,9 +175,11 @@ static int kirkwood_cpufreq_probe(struct platform_devi=
ce *pdev)
 =09if (IS_ERR(priv.base))
 =09=09return PTR_ERR(priv.base);
=20
-=09np =3D of_find_node_by_path("/cpus/cpu@0");
-=09if (!np)
+=09np =3D of_cpu_device_node_get(0);
+=09if (!np) {
+=09=09dev_err(&pdev->dev, "failed to get cpu device node\n");
 =09=09return -ENODEV;
+=09}
=20
 =09priv.cpu_clk =3D of_clk_get_by_name(np, "cpu_clk");
 =09if (IS_ERR(priv.cpu_clk)) {
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 14/19] cpufreq: spear-cpufreq: remove device tree parsing for cpu nodes
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Deepak Sikri, Michal Simek, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Now that the cpu device registration initialises the of_node(if available)
appropriately for all the cpus, parsing here is redundant.

This patch removes all DT parsing and uses cpu->of_node instead.

Cc: Deepak Sikri <sikrid@qti.qualcomm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 drivers/cpufreq/spear-cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufre=
q.c
index c3efa7f..19e364fa 100644
--- a/drivers/cpufreq/spear-cpufreq.c
+++ b/drivers/cpufreq/spear-cpufreq.c
@@ -18,7 +18,7 @@
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/module.h>
-#include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/slab.h>
 #include <linux/types.h>
=20
@@ -223,7 +223,7 @@ static int spear_cpufreq_driver_init(void)
 =09const __be32 *val;
 =09int cnt, i, ret;
=20
-=09np =3D of_find_node_by_path("/cpus/cpu@0");
+=09np =3D of_cpu_device_node_get(0);
 =09if (!np) {
 =09=09pr_err("No cpu node found");
 =09=09return -ENODEV;
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 17/19] cpufreq: maple-cpufreq: remove device tree parsing for cpu nodes
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Dmitry Eremin-Solenikov, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Now that the cpu device registration initialises the of_node(if available)
appropriately for all the cpus, parsing here is redundant.

This patch removes all DT parsing and uses cpu->of_node instead.

Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 drivers/cpufreq/maple-cpufreq.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/drivers/cpufreq/maple-cpufreq.c b/drivers/cpufreq/maple-cpufre=
q.c
index cdd6291..f071dc4 100644
--- a/drivers/cpufreq/maple-cpufreq.c
+++ b/drivers/cpufreq/maple-cpufreq.c
@@ -24,7 +24,7 @@
 #include <linux/completion.h>
 #include <linux/mutex.h>
 #include <linux/time.h>
-#include <linux/of.h>
+#include <linux/of_device.h>
=20
 #define DBG(fmt...) pr_debug(fmt)
=20
@@ -201,7 +201,6 @@ static struct cpufreq_driver maple_cpufreq_driver =3D {
=20
 static int __init maple_cpufreq_init(void)
 {
-=09struct device_node *cpus;
 =09struct device_node *cpunode;
 =09unsigned int psize;
 =09unsigned long max_freq;
@@ -217,24 +216,11 @@ static int __init maple_cpufreq_init(void)
 =09    !of_machine_is_compatible("Momentum,Apache"))
 =09=09return 0;
=20
-=09cpus =3D of_find_node_by_path("/cpus");
-=09if (cpus =3D=3D NULL) {
-=09=09DBG("No /cpus node !\n");
-=09=09return -ENODEV;
-=09}
-
 =09/* Get first CPU node */
-=09for (cpunode =3D NULL;
-=09     (cpunode =3D of_get_next_child(cpus, cpunode)) !=3D NULL;) {
-=09=09const u32 *reg =3D of_get_property(cpunode, "reg", NULL);
-=09=09if (reg =3D=3D NULL || (*reg) !=3D 0)
-=09=09=09continue;
-=09=09if (!strcmp(cpunode->type, "cpu"))
-=09=09=09break;
-=09}
+=09cpunode =3D of_cpu_device_node_get(0);
 =09if (cpunode =3D=3D NULL) {
 =09=09printk(KERN_ERR "cpufreq: Can't find any CPU 0 node\n");
-=09=09goto bail_cpus;
+=09=09goto bail_noprops;
 =09}
=20
 =09/* Check 970FX for now */
@@ -290,14 +276,11 @@ static int __init maple_cpufreq_init(void)
 =09rc =3D cpufreq_register_driver(&maple_cpufreq_driver);
=20
 =09of_node_put(cpunode);
-=09of_node_put(cpus);
=20
 =09return rc;
=20
 bail_noprops:
 =09of_node_put(cpunode);
-bail_cpus:
-=09of_node_put(cpus);
=20
 =09return rc;
 }
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 18/19] cpufreq: pmac64-cpufreq: remove device tree parsing for cpu nodes
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Now that the cpu device registration initialises the of_node(if available)
appropriately for all the cpus, parsing here is redundant.

This patch removes all DT parsing and uses cpu->of_node instead.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 drivers/cpufreq/pmac64-cpufreq.c | 47 ++++++++++--------------------------=
----
 1 file changed, 11 insertions(+), 36 deletions(-)

diff --git a/drivers/cpufreq/pmac64-cpufreq.c b/drivers/cpufreq/pmac64-cpuf=
req.c
index 7ba4234..97b719f 100644
--- a/drivers/cpufreq/pmac64-cpufreq.c
+++ b/drivers/cpufreq/pmac64-cpufreq.c
@@ -22,6 +22,7 @@
 #include <linux/init.h>
 #include <linux/completion.h>
 #include <linux/mutex.h>
+#include <linux/of_device.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/irq.h>
@@ -383,9 +384,8 @@ static struct cpufreq_driver g5_cpufreq_driver =3D {
=20
 #ifdef CONFIG_PMAC_SMU
=20
-static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
+static int __init g5_neo2_cpufreq_init(struct device_node *cpunode)
 {
-=09struct device_node *cpunode;
 =09unsigned int psize, ssize;
 =09unsigned long max_freq;
 =09char *freq_method, *volt_method;
@@ -405,20 +405,6 @@ static int __init g5_neo2_cpufreq_init(struct device_n=
ode *cpus)
 =09else
 =09=09return -ENODEV;
=20
-=09/* Get first CPU node */
-=09for (cpunode =3D NULL;
-=09     (cpunode =3D of_get_next_child(cpus, cpunode)) !=3D NULL;) {
-=09=09const u32 *reg =3D of_get_property(cpunode, "reg", NULL);
-=09=09if (reg =3D=3D NULL || (*reg) !=3D 0)
-=09=09=09continue;
-=09=09if (!strcmp(cpunode->type, "cpu"))
-=09=09=09break;
-=09}
-=09if (cpunode =3D=3D NULL) {
-=09=09printk(KERN_ERR "cpufreq: Can't find any CPU 0 node\n");
-=09=09return -ENODEV;
-=09}
-
 =09/* Check 970FX for now */
 =09valp =3D of_get_property(cpunode, "cpu-version", NULL);
 =09if (!valp) {
@@ -537,9 +523,9 @@ static int __init g5_neo2_cpufreq_init(struct device_no=
de *cpus)
 #endif /* CONFIG_PMAC_SMU */
=20
=20
-static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
+static int __init g5_pm72_cpufreq_init(struct device_node *cpunode)
 {
-=09struct device_node *cpuid =3D NULL, *hwclock =3D NULL, *cpunode =3D NUL=
L;
+=09struct device_node *cpuid =3D NULL, *hwclock =3D NULL;
 =09const u8 *eeprom =3D NULL;
 =09const u32 *valp;
 =09u64 max_freq, min_freq, ih, il;
@@ -548,17 +534,6 @@ static int __init g5_pm72_cpufreq_init(struct device_n=
ode *cpus)
 =09DBG("cpufreq: Initializing for PowerMac7,2, PowerMac7,3 and"
 =09    " RackMac3,1...\n");
=20
-=09/* Get first CPU node */
-=09for (cpunode =3D NULL;
-=09     (cpunode =3D of_get_next_child(cpus, cpunode)) !=3D NULL;) {
-=09=09if (!strcmp(cpunode->type, "cpu"))
-=09=09=09break;
-=09}
-=09if (cpunode =3D=3D NULL) {
-=09=09printk(KERN_ERR "cpufreq: Can't find any CPU node\n");
-=09=09return -ENODEV;
-=09}
-
 =09/* Lookup the cpuid eeprom node */
         cpuid =3D of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@=
a0");
 =09if (cpuid !=3D NULL)
@@ -718,25 +693,25 @@ static int __init g5_pm72_cpufreq_init(struct device_=
node *cpus)
=20
 static int __init g5_cpufreq_init(void)
 {
-=09struct device_node *cpus;
+=09struct device_node *cpunode;
 =09int rc =3D 0;
=20
-=09cpus =3D of_find_node_by_path("/cpus");
-=09if (cpus =3D=3D NULL) {
-=09=09DBG("No /cpus node !\n");
+=09/* Get first CPU node */
+=09cpunode =3D of_cpu_device_node_get(0);
+=09if (cpunode =3D=3D NULL) {
+=09=09pr_err("cpufreq: Can't find any CPU node\n");
 =09=09return -ENODEV;
 =09}
=20
 =09if (of_machine_is_compatible("PowerMac7,2") ||
 =09    of_machine_is_compatible("PowerMac7,3") ||
 =09    of_machine_is_compatible("RackMac3,1"))
-=09=09rc =3D g5_pm72_cpufreq_init(cpus);
+=09=09rc =3D g5_pm72_cpufreq_init(cpunode);
 #ifdef CONFIG_PMAC_SMU
 =09else
-=09=09rc =3D g5_neo2_cpufreq_init(cpus);
+=09=09rc =3D g5_neo2_cpufreq_init(cpunode);
 #endif /* CONFIG_PMAC_SMU */
=20
-=09of_node_put(cpus);
 =09return rc;
 }
=20
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 19/19] cpufreq: pmac32-cpufreq: remove device tree parsing for cpu nodes
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Now that the cpu device registration initialises the of_node(if available)
appropriately for all the cpus, parsing here is redundant.

This patch removes DT parsing and uses cpu->of_node instead.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 drivers/cpufreq/pmac32-cpufreq.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpuf=
req.c
index 3104fad..56bfb6f 100644
--- a/drivers/cpufreq/pmac32-cpufreq.c
+++ b/drivers/cpufreq/pmac32-cpufreq.c
@@ -25,6 +25,7 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/hardirq.h>
+#include <linux/of_device.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/irq.h>
@@ -649,8 +650,8 @@ static int __init pmac_cpufreq_setup(void)
 =09if (strstr(cmd_line, "nocpufreq"))
 =09=09return 0;
=20
-=09/* Assume only one CPU */
-=09cpunode =3D of_find_node_by_type(NULL, "cpu");
+=09/* Get first CPU node */
+=09cpunode =3D of_cpu_device_node_get(0);
 =09if (!cpunode)
 =09=09goto out;
=20
--=20
1.8.1.2

^ permalink raw reply related

* [PATCH v4 16/19] cpufreq: arm_big_little: remove device tree parsing for cpu nodes
From: Sudeep KarkadaNagesha @ 2013-08-20  9:30 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-pm, devicetree,
	linuxppc-dev
  Cc: Jonas Bonn, Michal Simek, Greg Kroah-Hartman,
	Sudeep KarkadaNagesha, Viresh Kumar, Rob Herring,
	Rafael J. Wysocki, Grant Likely
In-Reply-To: <1376991021-12160-1-git-send-email-Sudeep.KarkadaNagesha@arm.com>

From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Now that the cpu device registration initialises the of_node(if available)
appropriately for all the cpus, parsing here is redundant.

This patch removes all DT parsing and uses cpu->of_node instead.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
 drivers/cpufreq/arm_big_little_dt.c | 40 +++++++++++++--------------------=
----
 1 file changed, 14 insertions(+), 26 deletions(-)

diff --git a/drivers/cpufreq/arm_big_little_dt.c b/drivers/cpufreq/arm_big_=
little_dt.c
index fd9e3ea..480c0bd 100644
--- a/drivers/cpufreq/arm_big_little_dt.c
+++ b/drivers/cpufreq/arm_big_little_dt.c
@@ -19,12 +19,11 @@
=20
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
=20
-#include <linux/cpu.h>
 #include <linux/cpufreq.h>
 #include <linux/device.h>
 #include <linux/export.h>
 #include <linux/module.h>
-#include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/opp.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
@@ -34,27 +33,13 @@
 /* get cpu node with valid operating-points */
 static struct device_node *get_cpu_node_with_valid_op(int cpu)
 {
-=09struct device_node *np =3D NULL, *parent;
-=09int count =3D 0;
+=09struct device_node *np =3D of_cpu_device_node_get(cpu);
=20
-=09parent =3D of_find_node_by_path("/cpus");
-=09if (!parent) {
-=09=09pr_err("failed to find OF /cpus\n");
-=09=09return NULL;
+=09if (!of_get_property(np, "operating-points", NULL)) {
+=09=09of_node_put(np);
+=09=09np =3D NULL;
 =09}
=20
-=09for_each_child_of_node(parent, np) {
-=09=09if (count++ !=3D cpu)
-=09=09=09continue;
-=09=09if (!of_get_property(np, "operating-points", NULL)) {
-=09=09=09of_node_put(np);
-=09=09=09np =3D NULL;
-=09=09}
-
-=09=09break;
-=09}
-
-=09of_node_put(parent);
 =09return np;
 }
=20
@@ -63,11 +48,12 @@ static int dt_init_opp_table(struct device *cpu_dev)
 =09struct device_node *np;
 =09int ret;
=20
-=09np =3D get_cpu_node_with_valid_op(cpu_dev->id);
-=09if (!np)
-=09=09return -ENODATA;
+=09np =3D of_node_get(cpu_dev->of_node);
+=09if (!np) {
+=09=09pr_err("failed to find cpu%d node\n", cpu_dev->id);
+=09=09return -ENOENT;
+=09}
=20
-=09cpu_dev->of_node =3D np;
 =09ret =3D of_init_opp_table(cpu_dev);
 =09of_node_put(np);
=20
@@ -79,9 +65,11 @@ static int dt_get_transition_latency(struct device *cpu_=
dev)
 =09struct device_node *np;
 =09u32 transition_latency =3D CPUFREQ_ETERNAL;
=20
-=09np =3D get_cpu_node_with_valid_op(cpu_dev->id);
-=09if (!np)
+=09np =3D of_node_get(cpu_dev->of_node);
+=09if (!np) {
+=09=09pr_info("Failed to find cpu node. Use CPUFREQ_ETERNAL transition lat=
ency\n");
 =09=09return CPUFREQ_ETERNAL;
+=09}
=20
 =09of_property_read_u32(np, "clock-latency", &transition_latency);
 =09of_node_put(np);
--=20
1.8.1.2

^ permalink raw reply related

* Re: [PATCH] powerpc: Never handle VSX alignment exceptions from kernel
From: Michael Neuling @ 2013-08-20 10:04 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: Paul Mackerras, linuxppc-dev, amodra
In-Reply-To: <20130820160516.596a85a4@kryten>

On Tue, Aug 20, 2013 at 4:05 PM, Anton Blanchard <anton@samba.org> wrote:
>
> The VSX alignment handler needs to write out the existing VSX
> state to memory before operating on it (flush_vsx_to_thread()).
> If we take a VSX alignment exception in the kernel bad things
> will happen. It looks like we could write the kernel state out
> to the user process, or we could handle the kernel exception
> using data from the user process (depending if MSR_VSX is set
> or not).
>
> Worse still, if the code to read or write the VSX state causes an
> alignment exception, we will recurse forever. I ended up with
> hundreds of megabytes of kernel stack to look through as a result.
>
> Floating point and SPE code have similar issues but already include
> a user check. Add the same check to emulate_vsx().
>

Can you say what will happen when you apply this patch.  ie It
produces one oops rather than megabytes of crap making it easier
to debug.

Also, can you give a clue as to how you can hit this since it should
never happen in the first place.  I assume it's some LE corner case...

Mikey


> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: b/arch/powerpc/kernel/align.c
> ===================================================================
> --- a/arch/powerpc/kernel/align.c
> +++ b/arch/powerpc/kernel/align.c
> @@ -651,6 +651,10 @@ static int emulate_vsx(unsigned char __u
>         int sw = 0;
>         int i, j;
>
> +       /* userland only */
> +       if (unlikely(!user_mode(regs)))
> +               return 0;
> +
>         flush_vsx_to_thread(current);
>
>         if (reg < 32)
>

^ permalink raw reply

* Re: [PATCH] powerpc: Never handle VSX alignment exceptions from kernel
From: Anton Blanchard @ 2013-08-20 10:30 UTC (permalink / raw)
  To: Michael Neuling; +Cc: Paul Mackerras, linuxppc-dev, amodra
In-Reply-To: <CAEjGV6x6fMPMunzfcm7O0RYHdxEyhnUoH1FcZno2AQRHtqkMVw@mail.gmail.com>


Hi,

> Can you say what will happen when you apply this patch.  ie It
> produces one oops rather than megabytes of crap making it easier
> to debug.

Good point, updated.

> Also, can you give a clue as to how you can hit this since it should
> never happen in the first place.  I assume it's some LE corner case...

While it was found on LE, after reading the POWER7 docs I think we can
hit it pretty easily on BE. All it takes is a 4 byte aligned VSX load
or store. Misaligning the FPR array in the thread struct would be
enough to do it and we'd end up scribbling over memory until we self
destruct.

Anton
--

The VSX alignment handler needs to write out the existing VSX
state to memory before operating on it (flush_vsx_to_thread()).
If we take a VSX alignment exception in the kernel bad things
will happen. It looks like we could write the kernel state out
to the user process, or we could handle the kernel exception
using data from the user process (depending if MSR_VSX is set
or not).

Worse still, if the code to read or write the VSX state causes an
alignment exception, we will recurse forever. I ended up with
hundreds of megabytes of kernel stack to look through as a result.

Floating point and SPE code have similar issues but already include
a user check. Add the same check to emulate_vsx().

With this patch any unaligned VSX loads and stores in the kernel
will show up as a clear oops rather than silent corruption of
kernel or userspace VSX state, or worse, corruption of a potentially
unlimited amount of kernel memory.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: b/arch/powerpc/kernel/align.c
===================================================================
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -651,6 +651,10 @@ static int emulate_vsx(unsigned char __u
 	int sw = 0;
 	int i, j;
 
+	/* userland only */
+	if (unlikely(!user_mode(regs)))
+		return 0;
+
 	flush_vsx_to_thread(current);
 
 	if (reg < 32)

^ permalink raw reply

* Re: [PATCH 3/6] powerpc: Add more trap names to xmon
From: Paul Mackerras @ 2013-08-20 10:52 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev
In-Reply-To: <1376544139-26783-3-git-send-email-michael@ellerman.id.au>

On Thu, Aug 15, 2013 at 03:22:16PM +1000, Michael Ellerman wrote:
> We haven't updated these for a while it seems, it's nice to have in the
> oops output.

I think you mean the xmon exception summary output, not the oops output...

Paul.

^ permalink raw reply

* Re: BUG_ON and gcc don't mix
From: Anton Blanchard @ 2013-08-20 10:55 UTC (permalink / raw)
  To: David Laight; +Cc: paulus, linuxppc-dev, wschmidt, Alan Modra
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B72FF@saturn3.aculab.com>


Hi David,

> I was thinking that you could add the label after the trap and
> then use '.long 1b-4'. But you'd have to put the asm outside the
> conditional - so that wouldn't work if the condition was more
> complicated and the trap had to be out of line.
> 
> If the trap is out of line, then it could be a long way from
> the surrounding code block - so a label 'nearby' in the C isn't
> any use.
> 
> With fix sized instructions the .text segment of the object files
> could be scanned for trap instructions.

I tried something similar a while ago and the 1b-4 trick worked for
95%+ of cases but we did end up with out of line traps. I hacked
something up to look for an example, tagging the start and the end of a
BUG_ON, and seeing if the trap was in fact out of line:

               asm volatile("1:\n");
               if (x)
                       __builtin_trap();
               asm volatile("2:\n");

And this one popped in arch/powerpc/platforms/powernv/pci-ioda.c:

        1:

        ld 9,0(29)
        rlwinm. 8,9,0,29,30 
        beq- 0,.L287

        2:

...

.L287:
        trap

You could follow branches and look for the trap, but I'm sure you could
construct things that would be very hard to automatically parse, eg
multiple back to back BUG_ON()'s. At that point I figured some gcc help
would be nice :)

Anton

^ permalink raw reply

* Re: [PATCH] powerpc: add the missing required isync for the coherent icache flush
From: Kevin Hao @ 2013-08-20 12:16 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Wang Dongsheng-B40534, linuxppc
In-Reply-To: <1376916335.25016.72.camel@pasglop>

[-- Attachment #1: Type: text/plain, Size: 3700 bytes --]

On Mon, Aug 19, 2013 at 10:45:35PM +1000, Benjamin Herrenschmidt wrote:
> On Mon, 2013-08-19 at 19:50 +0800, Kevin Hao wrote:
> > On Mon, Aug 19, 2013 at 01:37:17PM +1000, Benjamin Herrenschmidt wrote:
> > > On Mon, 2013-08-19 at 13:36 +1000, Benjamin Herrenschmidt wrote:
> > > 
> > > > The semantic of this function is to make data executable. Even if the
> > > > implementation has a snooping icache, it *still* needs to make sure
> > > > prefetched code is tossed out of the pipeline which is what isync
> > > > should provide.
> > > > 
> > > > The architecture actually specifies that.
> > > 
> > > In fact, on P5 and later, I think we are supposed to do a single dummy
> > > icbi followed by sync and isync.
> > 
> > Do you mean something like this? But why?
> 
> It has to do with making sure prefetched and/or speculated instructions
> are properly tossed.
> 
> My understanding is that icbi basically tells the ifetch buffers to drop
> it

Dummy question: What does the ifetch buffers mean? The instruction fetch
pipeline or instruction dispatch pipeline? Shouldn't all the prefetched
instructions in these buffers be discarded by isync?


>, sync orders the icbi and isync ensures its execution has been
> synchronized. At least I *think* that's the required sequence, I have to
> dbl check the arch, maybe tomorrow. I wouldn't be surprise if we also
> need a sync before the icbi to order the actual stores to memory that
> might have modified instructions with the icbi.

Doesn't the coherence between icache and dcache be maintained by the snooping?

Thanks,
Kevin

> 
> Cheers,
> Ben.
> 
> > diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
> > index d74fefb..8fcdec7 100644
> > --- a/arch/powerpc/kernel/misc_64.S
> > +++ b/arch/powerpc/kernel/misc_64.S
> > @@ -69,6 +69,8 @@ PPC64_CACHES:
> >  
> >  _KPROBE(flush_icache_range)
> >  BEGIN_FTR_SECTION
> > +	icbi	0,r3
> > +	sync
> >  	isync
> >  	blr
> >  END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
> > @@ -209,6 +211,8 @@ _GLOBAL(flush_inval_dcache_range)
> >   */
> >  _GLOBAL(__flush_dcache_icache)
> >  BEGIN_FTR_SECTION
> > +	icbi	0,r3
> > +	sync
> >  	isync
> >  	blr
> >  END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
> > 
> > Thanks,
> > Kevin
> > 
> > > 
> > > Cheers,
> > > Ben.
> > > 
> > > > Cheers,
> > > > Ben.
> > > > 
> > > > > >  	blr
> > > > > >  END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
> > > > > >  	rlwinm	r3,r3,0,0,31-PAGE_SHIFT		/* Get page base address
> > > > > > */
> > > > > > @@ -474,6 +475,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_44x)
> > > > > >   */
> > > > > >  _GLOBAL(__flush_dcache_icache_phys)
> > > > > >  BEGIN_FTR_SECTION
> > > > > > +	isync
> > > > > >  	blr					/* for 601, do nothing */
> > > > > >  END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
> > > > > >  	mfmsr	r10
> > > > > > diff --git a/arch/powerpc/kernel/misc_64.S
> > > > > > b/arch/powerpc/kernel/misc_64.S
> > > > > > index 992a78e..d74fefb 100644
> > > > > > --- a/arch/powerpc/kernel/misc_64.S
> > > > > > +++ b/arch/powerpc/kernel/misc_64.S
> > > > > > @@ -69,6 +69,7 @@ PPC64_CACHES:
> > > > > > 
> > > > > >  _KPROBE(flush_icache_range)
> > > > > >  BEGIN_FTR_SECTION
> > > > > > +	isync
> > > > > >  	blr
> > > > > >  END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
> > > > > >  /*
> > > > > > --
> > > > > > 1.8.3.1
> > > > > > 
> > > > > > _______________________________________________
> > > > > > Linuxppc-dev mailing list
> > > > > > Linuxppc-dev@lists.ozlabs.org
> > > > > > https://lists.ozlabs.org/listinfo/linuxppc-dev
> > > > > 
> > > > 
> > > 
> > > 
> 
> 

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [PATCH v4 03/19] powerpc: refactor of_get_cpu_node to support other architectures
From: Rafael J. Wysocki @ 2013-08-20 12:27 UTC (permalink / raw)
  To: Sudeep KarkadaNagesha
  Cc: Jonas Bonn, devicetree, Michal Simek, linux-pm,
	Sudeep KarkadaNagesha, Viresh Kumar, linux-kernel, Rob Herring,
	Greg Kroah-Hartman, Grant Likely, linuxppc-dev, linux-arm-kernel
In-Reply-To: <1376991021-12160-4-git-send-email-Sudeep.KarkadaNagesha@arm.com>

On Tuesday, August 20, 2013 10:30:05 AM Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> 
> Currently different drivers requiring to access cpu device node are
> parsing the device tree themselves. Since the ordering in the DT need
> not match the logical cpu ordering, the parsing logic needs to consider
> that. However, this has resulted in lots of code duplication and in some
> cases even incorrect logic.
> 
> It's better to consolidate them by adding support for getting cpu
> device node for a given logical cpu index in DT core library. However
> logical to physical index mapping can be architecture specific.
> 
> PowerPC has it's own implementation to get the cpu node for a given
> logical index.
> 
> This patch refactors the current implementation of of_get_cpu_node.
> This in preparation to move the implementation to DT core library.
> It separates out the logical to physical mapping so that a default
> matching of the physical id to the logical cpu index can be added
> when moved to common code. Architecture specific code can override it.
> 
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Grant Likely <grant.likely@linaro.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

This needs an ACK from Ben to go anywhere.

Thanks,
Rafael


> ---
>  arch/powerpc/kernel/prom.c | 76 ++++++++++++++++++++++++++++------------------
>  1 file changed, 47 insertions(+), 29 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index eb23ac9..f7b8c0b 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -865,45 +865,63 @@ static int __init prom_reconfig_setup(void)
>  __initcall(prom_reconfig_setup);
>  #endif
>  
> +bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
> +{
> +	return (int)phys_id == get_hard_smp_processor_id(cpu);
> +}
> +
> +static bool __of_find_n_match_cpu_property(struct device_node *cpun,
> +			const char *prop_name, int cpu, unsigned int *thread)
> +{
> +	const __be32 *cell;
> +	int ac, prop_len, tid;
> +	u64 hwid;
> +
> +	ac = of_n_addr_cells(cpun);
> +	cell = of_get_property(cpun, prop_name, &prop_len);
> +	if (!cell)
> +		return false;
> +	prop_len /= sizeof(*cell);
> +	for (tid = 0; tid < prop_len; tid++) {
> +		hwid = of_read_number(cell, ac);
> +		if (arch_match_cpu_phys_id(cpu, hwid)) {
> +			if (thread)
> +				*thread = tid;
> +			return true;
> +		}
> +		cell += ac;
> +	}
> +	return false;
> +}
> +
>  /* Find the device node for a given logical cpu number, also returns the cpu
>   * local thread number (index in ibm,interrupt-server#s) if relevant and
>   * asked for (non NULL)
>   */
>  struct device_node *of_get_cpu_node(int cpu, unsigned int *thread)
>  {
> -	int hardid;
> -	struct device_node *np;
> +	struct device_node *cpun, *cpus;
>  
> -	hardid = get_hard_smp_processor_id(cpu);
> +	cpus = of_find_node_by_path("/cpus");
> +	if (!cpus) {
> +		pr_warn("Missing cpus node, bailing out\n");
> +		return NULL;
> +	}
>  
> -	for_each_node_by_type(np, "cpu") {
> -		const u32 *intserv;
> -		unsigned int plen, t;
> +	for_each_child_of_node(cpus, cpun) {
> +		if (of_node_cmp(cpun->type, "cpu"))
> +			continue;
>  
> -		/* Check for ibm,ppc-interrupt-server#s. If it doesn't exist
> -		 * fallback to "reg" property and assume no threads
> +		/* Check for non-standard "ibm,ppc-interrupt-server#s" property
> +		 * for thread ids on PowerPC. If it doesn't exist fallback to
> +		 * standard "reg" property.
>  		 */
> -		intserv = of_get_property(np, "ibm,ppc-interrupt-server#s",
> -				&plen);
> -		if (intserv == NULL) {
> -			const u32 *reg = of_get_property(np, "reg", NULL);
> -			if (reg == NULL)
> -				continue;
> -			if (*reg == hardid) {
> -				if (thread)
> -					*thread = 0;
> -				return np;
> -			}
> -		} else {
> -			plen /= sizeof(u32);
> -			for (t = 0; t < plen; t++) {
> -				if (hardid == intserv[t]) {
> -					if (thread)
> -						*thread = t;
> -					return np;
> -				}
> -			}
> -		}
> +		if (__of_find_n_match_cpu_property(cpun,
> +				"ibm,ppc-interrupt-server#s", cpu, thread))
> +			return cpun;
> +
> +		if (__of_find_n_match_cpu_property(cpun, "reg", cpu, thread))
> +			return cpun;
>  	}
>  	return NULL;
>  }
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply

* Re: [PATCH v4 06/19] driver/core: cpu: initialize of_node in cpu's device struture
From: Rafael J. Wysocki @ 2013-08-20 12:28 UTC (permalink / raw)
  To: Sudeep KarkadaNagesha, Greg Kroah-Hartman
  Cc: Jonas Bonn, devicetree, Michal Simek, linux-pm,
	Sudeep KarkadaNagesha, Viresh Kumar, linux-kernel, Rob Herring,
	Grant Likely, linuxppc-dev, linux-arm-kernel
In-Reply-To: <1376991021-12160-7-git-send-email-Sudeep.KarkadaNagesha@arm.com>

On Tuesday, August 20, 2013 10:30:08 AM Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> 
> CPUs are also registered as devices but the of_node in these cpu
> devices are not initialized. Currently different drivers requiring
> to access cpu device node are parsing the nodes themselves and
> initialising the of_node in cpu device.
> 
> The of_node in all the cpu devices needs to be initialized properly
> and at one place. The best place to update this is CPU subsystem
> driver when registering the cpu devices.
> 
> The OF/DT core library now provides of_get_cpu_node to retrieve a cpu
> device node for a given logical index by abstracting the architecture
> specific details.
> 
> This patch uses of_get_cpu_node to assign of_node when registering the
> cpu devices.
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Acked-by: Rob Herring <rob.herring@calxeda.com>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Hi Greg,

I this one fine with you?

Rafael


> ---
>  drivers/base/cpu.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> index 4c358bc..4cf0717 100644
> --- a/drivers/base/cpu.c
> +++ b/drivers/base/cpu.c
> @@ -14,6 +14,7 @@
>  #include <linux/slab.h>
>  #include <linux/percpu.h>
>  #include <linux/acpi.h>
> +#include <linux/of.h>
>  
>  #include "base.h"
>  
> @@ -289,6 +290,7 @@ int register_cpu(struct cpu *cpu, int num)
>  	cpu->dev.release = cpu_device_release;
>  	cpu->dev.offline_disabled = !cpu->hotpluggable;
>  	cpu->dev.offline = !cpu_online(num);
> +	cpu->dev.of_node = of_get_cpu_node(num, NULL);
>  #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
>  	cpu->dev.bus->uevent = arch_cpu_uevent;
>  #endif
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply

* Re: [PATCH v4 03/19] powerpc: refactor of_get_cpu_node to support other architectures
From: Sudeep KarkadaNagesha @ 2013-08-20 12:22 UTC (permalink / raw)
  To: Rafael J. Wysocki, Benjamin Herrenschmidt
  Cc: Jonas Bonn, devicetree@vger.kernel.org, Michal Simek,
	linux-pm@vger.kernel.org, Sudeep KarkadaNagesha, Viresh Kumar,
	linux-kernel@vger.kernel.org, rob.herring@calxeda.com,
	Greg Kroah-Hartman, grant.likely@linaro.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org
In-Reply-To: <3703987.W8AZjrDbn0@vostro.rjw.lan>

On 20/08/13 13:27, Rafael J. Wysocki wrote:
> On Tuesday, August 20, 2013 10:30:05 AM Sudeep KarkadaNagesha wrote:
>> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>>
>> Currently different drivers requiring to access cpu device node are
>> parsing the device tree themselves. Since the ordering in the DT need
>> not match the logical cpu ordering, the parsing logic needs to consider
>> that. However, this has resulted in lots of code duplication and in some
>> cases even incorrect logic.
>>
>> It's better to consolidate them by adding support for getting cpu
>> device node for a given logical cpu index in DT core library. However
>> logical to physical index mapping can be architecture specific.
>>
>> PowerPC has it's own implementation to get the cpu node for a given
>> logical index.
>>
>> This patch refactors the current implementation of of_get_cpu_node.
>> This in preparation to move the implementation to DT core library.
>> It separates out the logical to physical mapping so that a default
>> matching of the physical id to the logical cpu index can be added
>> when moved to common code. Architecture specific code can override it.
>>
>> Cc: Rob Herring <rob.herring@calxeda.com>
>> Cc: Grant Likely <grant.likely@linaro.org>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>=20
> This needs an ACK from Ben to go anywhere.
>=20
Hi Rafael,

Correct, he has reviewed but I am waiting for his ACK before I could
sent you pull request. Hopefully I should be able to send pull request
tomorrow with his ACK.

Hi Ben,

If this is patch is fine, can I have your ACK ?

Regards,
Sudeep

^ permalink raw reply

* Re: [PATCH] sata: fsl: save irqs while coalescing
From: Tejun Heo @ 2013-08-20 12:39 UTC (permalink / raw)
  To: Anthony Foiani
  Cc: Anthony Foiani, linux-ide, linuxppc-dev, Scott Wood,
	Bhushan Bharat-R65777
In-Reply-To: <1376961630-6255-1-git-send-email-anthony.foiani@gmail.com>

On Mon, Aug 19, 2013 at 07:20:30PM -0600, Anthony Foiani wrote:
> This patch is based off linux-next tag next-20130819
> (which is commit 66a01bae29d11916c09f9f5a937cafe7d402e4a5 )
> 
> Signed-off-by: Anthony Foiani <anthony.foiani@gmail.com>

Applied to libata/for-3.11-fixes w/ stable cc'd.

Thanks.

-- 
tejun

^ permalink raw reply

* Re: [PATCH v4 06/19] driver/core: cpu: initialize of_node in cpu's device struture
From: Greg Kroah-Hartman @ 2013-08-20 15:18 UTC (permalink / raw)
  To: Sudeep KarkadaNagesha
  Cc: Jonas Bonn, devicetree, Michal Simek, linux-pm, Viresh Kumar,
	linux-kernel, Rob Herring, Rafael J. Wysocki, Grant Likely,
	linuxppc-dev, linux-arm-kernel
In-Reply-To: <1376991021-12160-7-git-send-email-Sudeep.KarkadaNagesha@arm.com>

On Tue, Aug 20, 2013 at 10:30:08AM +0100, Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> 
> CPUs are also registered as devices but the of_node in these cpu
> devices are not initialized. Currently different drivers requiring
> to access cpu device node are parsing the nodes themselves and
> initialising the of_node in cpu device.
> 
> The of_node in all the cpu devices needs to be initialized properly
> and at one place. The best place to update this is CPU subsystem
> driver when registering the cpu devices.
> 
> The OF/DT core library now provides of_get_cpu_node to retrieve a cpu
> device node for a given logical index by abstracting the architecture
> specific details.
> 
> This patch uses of_get_cpu_node to assign of_node when registering the
> cpu devices.
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Acked-by: Rob Herring <rob.herring@calxeda.com>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply

* Re: [PATCH v8 2/2] ASoC: fsl: Add S/PDIF machine driver
From: Stephen Warren @ 2013-08-20 15:48 UTC (permalink / raw)
  To: Mark Brown
  Cc: mark.rutland, devicetree, alsa-devel, lars, festevam, s.hauer,
	Nicolin Chen, timur, rob.herring, tomasz.figa, p.zabel, R65777,
	shawn.guo, linuxppc-dev
In-Reply-To: <20130820001858.GF30073@sirena.org.uk>

On 08/19/2013 06:18 PM, Mark Brown wrote:
> On Mon, Aug 19, 2013 at 03:39:26PM -0600, Stephen Warren wrote:
>> On 08/19/2013 06:08 AM, Nicolin Chen wrote:
>>> This patch implements a device-tree-only machine driver for
>>> Freescale i.MX series Soc. It works with
>>> spdif_transmitter/spdif_receiver and fsl_spdif.c drivers.
>> 
>>> diff --git
>>> a/Documentation/devicetree/bindings/sound/imx-audio-spdif.txt
>>> b/Documentation/devicetree/bindings/sound/imx-audio-spdif.txt
> 
>>> +Optional properties:
> 
>>> +  - spdif-transmitter : The phandle of the spdif-transmitter
>>> dummy codec +  - spdif-receiver : The phandle of the
>>> spdif-receiver dummy codec
> 
>>> +* Note: At least one of these two properties should be set in
>>> the DT binding.
> 
>> Those object truly don't exist in HW and only exist due to
>> internal details of Linux's ASoC subsystem.
> 
> They will physically exist if they're usefully present on the board
> (in the sense that they're there and can be pointed at) - there
> will be either a TOSLINK optical connector or (less commonly) an
> electrical connector breaking the signal out to go elsewhere though
> they don't have any interaction with software usually which is more
> what you mean here.

Sure, the S/PDIF signal is connected to something, but it is not a
"dummy CODEC"; a "dummy CODEC" is purely something internal to ASoC
and absolutely nothing to do with HW.

>> Or, to map the properties more directly to HW, perhaps name the
>> property "spdif-tx-jack-exists", or even "spdif-tx-jack" and make
>> it a phandle to a node that represents the actual S/PDIF
>> connector?
> 
> S/PDIF is also sometimes used as an interconnect between devices -
> some CODECs have S/PDIF I/O (more normally used as an external
> connector on the box).  This is most frequently seen as a way to
> plumb HDMI in since some HDMI devices seem to provide this as a
> legacy interconnect, though it can get used just for regular CODECs
> as well.  Using this machine driver would probably be a bit of an
> abuse for some applications, though with things like the HDMI one
> the goal of the hardware is to be dropped into a driver like this
> so perhaps it makes sense and is useful anyway.
> 
> Equally well it'd be good to get this stuff actually merged, it
> seems to have been surprisingly time consuming thus far...

That's not a good argument for an incorrect binding.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox