Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-29 Thread Lorenzo Pieralisi
On Wed, Aug 28, 2013 at 08:46:38PM +0100, Grant Likely wrote: > On Thu, 22 Aug 2013 14:59:30 +0100, Mark Rutland wrote: > > On Mon, Aug 19, 2013 at 02:56:10PM +0100, Sudeep KarkadaNagesha wrote: > > > On 19/08/13 14:02, Rob Herring wrote: > > > > On 08/19/2013 05:19 AM, Mark Rutland wrote: > > >

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-29 Thread Lorenzo Pieralisi
On Wed, Aug 28, 2013 at 08:46:38PM +0100, Grant Likely wrote: On Thu, 22 Aug 2013 14:59:30 +0100, Mark Rutland mark.rutl...@arm.com wrote: On Mon, Aug 19, 2013 at 02:56:10PM +0100, Sudeep KarkadaNagesha wrote: On 19/08/13 14:02, Rob Herring wrote: On 08/19/2013 05:19 AM, Mark Rutland

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-28 Thread Grant Likely
On Thu, 22 Aug 2013 14:59:30 +0100, Mark Rutland wrote: > On Mon, Aug 19, 2013 at 02:56:10PM +0100, Sudeep KarkadaNagesha wrote: > > On 19/08/13 14:02, Rob Herring wrote: > > > On 08/19/2013 05:19 AM, Mark Rutland wrote: > > >> On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-28 Thread Grant Likely
On Thu, 22 Aug 2013 14:59:30 +0100, Mark Rutland mark.rutl...@arm.com wrote: On Mon, Aug 19, 2013 at 02:56:10PM +0100, Sudeep KarkadaNagesha wrote: On 19/08/13 14:02, Rob Herring wrote: On 08/19/2013 05:19 AM, Mark Rutland wrote: On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-22 Thread Sudeep KarkadaNagesha
On 22/08/13 14:59, Mark Rutland wrote: > On Mon, Aug 19, 2013 at 02:56:10PM +0100, Sudeep KarkadaNagesha wrote: >> On 19/08/13 14:02, Rob Herring wrote: >>> On 08/19/2013 05:19 AM, Mark Rutland wrote: On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt wrote: > On Sat,

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-22 Thread Mark Rutland
On Mon, Aug 19, 2013 at 02:56:10PM +0100, Sudeep KarkadaNagesha wrote: > On 19/08/13 14:02, Rob Herring wrote: > > On 08/19/2013 05:19 AM, Mark Rutland wrote: > >> On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt wrote: > >>> On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: >

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-22 Thread Mark Rutland
On Mon, Aug 19, 2013 at 02:56:10PM +0100, Sudeep KarkadaNagesha wrote: On 19/08/13 14:02, Rob Herring wrote: On 08/19/2013 05:19 AM, Mark Rutland wrote: On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt wrote: On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: I wonder

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-22 Thread Sudeep KarkadaNagesha
On 22/08/13 14:59, Mark Rutland wrote: On Mon, Aug 19, 2013 at 02:56:10PM +0100, Sudeep KarkadaNagesha wrote: On 19/08/13 14:02, Rob Herring wrote: On 08/19/2013 05:19 AM, Mark Rutland wrote: On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt wrote: On Sat, 2013-08-17 at 12:50

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-19 Thread Sudeep KarkadaNagesha
On 19/08/13 14:02, Rob Herring wrote: > On 08/19/2013 05:19 AM, Mark Rutland wrote: >> On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt wrote: >>> On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: I wonder how would this handle uniprocessor ARM (pre-v7) cores, for

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-19 Thread Rob Herring
On 08/19/2013 05:19 AM, Mark Rutland wrote: > On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt wrote: >> On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: >>> I wonder how would this handle uniprocessor ARM (pre-v7) cores, for >>> which >>> the updated bindings[1] define

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-19 Thread Mark Rutland
On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt wrote: > On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: > > I wonder how would this handle uniprocessor ARM (pre-v7) cores, for > > which > > the updated bindings[1] define #address-cells = <0> and so no reg > > property. >

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-19 Thread Sudeep KarkadaNagesha
On 16/08/13 23:13, Benjamin Herrenschmidt wrote: > On Fri, 2013-08-16 at 18:39 +0100, Sudeep KarkadaNagesha wrote: >> +static bool __of_find_n_match_cpu_property(struct device_node *cpun, >> + const char *prop_name, int cpu, unsigned int >> *thread) >> +{ >> + const

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-19 Thread Sudeep KarkadaNagesha
On 16/08/13 23:13, Benjamin Herrenschmidt wrote: On Fri, 2013-08-16 at 18:39 +0100, Sudeep KarkadaNagesha wrote: +static bool __of_find_n_match_cpu_property(struct device_node *cpun, + const char *prop_name, int cpu, unsigned int *thread) +{ + const __be32 *cell;

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-19 Thread Mark Rutland
On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt wrote: On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: I wonder how would this handle uniprocessor ARM (pre-v7) cores, for which the updated bindings[1] define #address-cells = 0 and so no reg property. [1] -

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-19 Thread Rob Herring
On 08/19/2013 05:19 AM, Mark Rutland wrote: On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt wrote: On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: I wonder how would this handle uniprocessor ARM (pre-v7) cores, for which the updated bindings[1] define #address-cells =

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-19 Thread Sudeep KarkadaNagesha
On 19/08/13 14:02, Rob Herring wrote: On 08/19/2013 05:19 AM, Mark Rutland wrote: On Sat, Aug 17, 2013 at 11:09:36PM +0100, Benjamin Herrenschmidt wrote: On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: I wonder how would this handle uniprocessor ARM (pre-v7) cores, for which the

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-17 Thread Tomasz Figa
On Sunday 18 of August 2013 08:09:36 Benjamin Herrenschmidt wrote: > On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: > > I wonder how would this handle uniprocessor ARM (pre-v7) cores, for > > which > > the updated bindings[1] define #address-cells = <0> and so no reg > > property. > > > >

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-17 Thread Benjamin Herrenschmidt
On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: > I wonder how would this handle uniprocessor ARM (pre-v7) cores, for > which > the updated bindings[1] define #address-cells = <0> and so no reg > property. > > [1] - http://thread.gmane.org/gmane.linux.ports.arm.kernel/260795 Why did you

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-17 Thread Tomasz Figa
Hi Sudeep, This looks good to me overall, but I have one more question inline. On Friday 16 of August 2013 18:39:50 Sudeep KarkadaNagesha wrote: > From: Sudeep KarkadaNagesha > > Currently different drivers requiring to access cpu device node are > parsing the device tree themselves. Since the

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-17 Thread Tomasz Figa
Hi Sudeep, This looks good to me overall, but I have one more question inline. On Friday 16 of August 2013 18:39:50 Sudeep KarkadaNagesha wrote: From: Sudeep KarkadaNagesha sudeep.karkadanage...@arm.com Currently different drivers requiring to access cpu device node are parsing the device

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-17 Thread Benjamin Herrenschmidt
On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: I wonder how would this handle uniprocessor ARM (pre-v7) cores, for which the updated bindings[1] define #address-cells = 0 and so no reg property. [1] - http://thread.gmane.org/gmane.linux.ports.arm.kernel/260795 Why did you do that

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-17 Thread Tomasz Figa
On Sunday 18 of August 2013 08:09:36 Benjamin Herrenschmidt wrote: On Sat, 2013-08-17 at 12:50 +0200, Tomasz Figa wrote: I wonder how would this handle uniprocessor ARM (pre-v7) cores, for which the updated bindings[1] define #address-cells = 0 and so no reg property. [1] -

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-16 Thread Benjamin Herrenschmidt
On Fri, 2013-08-16 at 18:39 +0100, Sudeep KarkadaNagesha wrote: > +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; > +

Re: [RFC PATCH v2 3/4] powerpc: refactor of_get_cpu_node to support other architectures

2013-08-16 Thread Benjamin Herrenschmidt
On Fri, 2013-08-16 at 18:39 +0100, Sudeep KarkadaNagesha wrote: +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;