* [PATCH 1/5] ARM: keystone: remove redundant smp_init_cpus definition
2013-07-23 11:32 [PATCH 0/5] ARM: DT: remove redundant DT related code Sudeep KarkadaNagesha
@ 2013-07-23 11:32 ` Sudeep KarkadaNagesha
2013-07-23 13:26 ` Santosh Shilimkar
2013-07-23 11:32 ` [PATCH 2/5] ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count Sudeep KarkadaNagesha
` (5 subsequent siblings)
6 siblings, 1 reply; 18+ messages in thread
From: Sudeep KarkadaNagesha @ 2013-07-23 11:32 UTC (permalink / raw)
To: linux-arm-kernel
From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
arm_dt_init_cpu_maps is called before smp_init_cpus. It makes the
platform/SoC definition of smp_init_cpus unnecessary.
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
arch/arm/mach-keystone/platsmp.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/mach-keystone/platsmp.c b/arch/arm/mach-keystone/platsmp.c
index 14378e3..c122961 100644
--- a/arch/arm/mach-keystone/platsmp.c
+++ b/arch/arm/mach-keystone/platsmp.c
@@ -38,6 +38,5 @@ static int keystone_smp_boot_secondary(unsigned int cpu,
}
struct smp_operations keystone_smp_ops __initdata = {
- .smp_init_cpus = arm_dt_init_cpu_maps,
.smp_boot_secondary = keystone_smp_boot_secondary,
};
--
1.8.1.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 2/5] ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count
2013-07-23 11:32 [PATCH 0/5] ARM: DT: remove redundant DT related code Sudeep KarkadaNagesha
2013-07-23 11:32 ` [PATCH 1/5] ARM: keystone: remove redundant smp_init_cpus definition Sudeep KarkadaNagesha
@ 2013-07-23 11:32 ` Sudeep KarkadaNagesha
2013-08-09 9:25 ` Sudeep KarkadaNagesha
2013-07-23 11:32 ` [PATCH 3/5] ARM: mach-mvebu: remove redundant DT parsing and validation Sudeep KarkadaNagesha
` (4 subsequent siblings)
6 siblings, 1 reply; 18+ messages in thread
From: Sudeep KarkadaNagesha @ 2013-07-23 11:32 UTC (permalink / raw)
To: linux-arm-kernel
From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
arm_dt_init_cpu_maps parses the device tree, validates and sets the
cpu_possible_mask appropriately. It is unnecessary to do another DT
parse to get the number of cpus, use num_possible_cpus instead.
This patch also removes setting cpu_present_mask as platforms should
only re-initialize it in smp_prepare_cpus() if present != possible.
Acked-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
arch/arm/mach-vexpress/platsmp.c | 32 +-------------------------------
1 file changed, 1 insertion(+), 31 deletions(-)
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c
index 993c9ae..4a2d8c4 100644
--- a/arch/arm/mach-vexpress/platsmp.c
+++ b/arch/arm/mach-vexpress/platsmp.c
@@ -77,39 +77,13 @@ void __init vexpress_dt_smp_map_io(void)
WARN_ON(of_scan_flat_dt(vexpress_dt_find_scu, NULL));
}
-static int __init vexpress_dt_cpus_num(unsigned long node, const char *uname,
- int depth, void *data)
-{
- static int prev_depth = -1;
- static int nr_cpus = -1;
-
- if (prev_depth > depth && nr_cpus > 0)
- return nr_cpus;
-
- if (nr_cpus < 0 && strcmp(uname, "cpus") == 0)
- nr_cpus = 0;
-
- if (nr_cpus >= 0) {
- const char *device_type = of_get_flat_dt_prop(node,
- "device_type", NULL);
-
- if (device_type && strcmp(device_type, "cpu") == 0)
- nr_cpus++;
- }
-
- prev_depth = depth;
-
- return 0;
-}
-
static void __init vexpress_dt_smp_init_cpus(void)
{
int ncores = 0, i;
switch (vexpress_dt_scu) {
case GENERIC_SCU:
- ncores = of_scan_flat_dt(vexpress_dt_cpus_num, NULL);
- break;
+ return;
case CORTEX_A9_SCU:
ncores = scu_get_core_count(vexpress_dt_cortex_a9_scu_base);
break;
@@ -133,12 +107,8 @@ static void __init vexpress_dt_smp_init_cpus(void)
static void __init vexpress_dt_smp_prepare_cpus(unsigned int max_cpus)
{
- int i;
-
switch (vexpress_dt_scu) {
case GENERIC_SCU:
- for (i = 0; i < max_cpus; i++)
- set_cpu_present(i, true);
break;
case CORTEX_A9_SCU:
scu_enable(vexpress_dt_cortex_a9_scu_base);
--
1.8.1.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 2/5] ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count
2013-07-23 11:32 ` [PATCH 2/5] ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count Sudeep KarkadaNagesha
@ 2013-08-09 9:25 ` Sudeep KarkadaNagesha
0 siblings, 0 replies; 18+ messages in thread
From: Sudeep KarkadaNagesha @ 2013-08-09 9:25 UTC (permalink / raw)
To: linux-arm-kernel
Hi Pawel,
On 23/07/13 12:32, Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>
> arm_dt_init_cpu_maps parses the device tree, validates and sets the
> cpu_possible_mask appropriately. It is unnecessary to do another DT
> parse to get the number of cpus, use num_possible_cpus instead.
>
> This patch also removes setting cpu_present_mask as platforms should
> only re-initialize it in smp_prepare_cpus() if present != possible.
>
Can you pick this patch for v3.12 ?
Regards,
Sudeep
> Acked-by: Pawel Moll <pawel.moll@arm.com>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> ---
> arch/arm/mach-vexpress/platsmp.c | 32 +-------------------------------
> 1 file changed, 1 insertion(+), 31 deletions(-)
>
> diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c
> index 993c9ae..4a2d8c4 100644
> --- a/arch/arm/mach-vexpress/platsmp.c
> +++ b/arch/arm/mach-vexpress/platsmp.c
> @@ -77,39 +77,13 @@ void __init vexpress_dt_smp_map_io(void)
> WARN_ON(of_scan_flat_dt(vexpress_dt_find_scu, NULL));
> }
>
> -static int __init vexpress_dt_cpus_num(unsigned long node, const char *uname,
> - int depth, void *data)
> -{
> - static int prev_depth = -1;
> - static int nr_cpus = -1;
> -
> - if (prev_depth > depth && nr_cpus > 0)
> - return nr_cpus;
> -
> - if (nr_cpus < 0 && strcmp(uname, "cpus") == 0)
> - nr_cpus = 0;
> -
> - if (nr_cpus >= 0) {
> - const char *device_type = of_get_flat_dt_prop(node,
> - "device_type", NULL);
> -
> - if (device_type && strcmp(device_type, "cpu") == 0)
> - nr_cpus++;
> - }
> -
> - prev_depth = depth;
> -
> - return 0;
> -}
> -
> static void __init vexpress_dt_smp_init_cpus(void)
> {
> int ncores = 0, i;
>
> switch (vexpress_dt_scu) {
> case GENERIC_SCU:
> - ncores = of_scan_flat_dt(vexpress_dt_cpus_num, NULL);
> - break;
> + return;
> case CORTEX_A9_SCU:
> ncores = scu_get_core_count(vexpress_dt_cortex_a9_scu_base);
> break;
> @@ -133,12 +107,8 @@ static void __init vexpress_dt_smp_init_cpus(void)
>
> static void __init vexpress_dt_smp_prepare_cpus(unsigned int max_cpus)
> {
> - int i;
> -
> switch (vexpress_dt_scu) {
> case GENERIC_SCU:
> - for (i = 0; i < max_cpus; i++)
> - set_cpu_present(i, true);
> break;
> case CORTEX_A9_SCU:
> scu_enable(vexpress_dt_cortex_a9_scu_base);
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/5] ARM: mach-mvebu: remove redundant DT parsing and validation
2013-07-23 11:32 [PATCH 0/5] ARM: DT: remove redundant DT related code Sudeep KarkadaNagesha
2013-07-23 11:32 ` [PATCH 1/5] ARM: keystone: remove redundant smp_init_cpus definition Sudeep KarkadaNagesha
2013-07-23 11:32 ` [PATCH 2/5] ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count Sudeep KarkadaNagesha
@ 2013-07-23 11:32 ` Sudeep KarkadaNagesha
2013-08-08 14:54 ` Sudeep KarkadaNagesha
2013-08-09 13:11 ` Jason Cooper
2013-07-23 11:32 ` [PATCH 4/5] ARM: highbank: remove redundant smp_init_cpus definition Sudeep KarkadaNagesha
` (3 subsequent siblings)
6 siblings, 2 replies; 18+ messages in thread
From: Sudeep KarkadaNagesha @ 2013-07-23 11:32 UTC (permalink / raw)
To: linux-arm-kernel
From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
arm_dt_init_cpu_maps parses the device tree, validates and sets the
cpu_possible_mask appropriately. It is unnecessary to do another DT
parse to get the number of cpus, use num_possible_cpus instead.
Cc: Gregory Clement <gregory.clement@free-electrons.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
arch/arm/mach-mvebu/platsmp.c | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
index ce81d30..2e4508a 100644
--- a/arch/arm/mach-mvebu/platsmp.c
+++ b/arch/arm/mach-mvebu/platsmp.c
@@ -87,28 +87,11 @@ static int armada_xp_boot_secondary(unsigned int cpu, struct task_struct *idle)
static void __init armada_xp_smp_init_cpus(void)
{
- struct device_node *np;
- unsigned int i, ncores;
+ unsigned int ncores = num_possible_cpus();
- np = of_find_node_by_name(NULL, "cpus");
- if (!np)
- panic("No 'cpus' node found\n");
-
- ncores = of_get_child_count(np);
if (ncores == 0 || ncores > ARMADA_XP_MAX_CPUS)
panic("Invalid number of CPUs in DT\n");
- /* Limit possible CPUs to defconfig */
- if (ncores > nr_cpu_ids) {
- pr_warn("SMP: %d CPUs physically present. Only %d configured.",
- ncores, nr_cpu_ids);
- pr_warn("Clipping CPU count to %d\n", nr_cpu_ids);
- ncores = nr_cpu_ids;
- }
-
- for (i = 0; i < ncores; i++)
- set_cpu_possible(i, true);
-
set_smp_cross_call(armada_mpic_send_doorbell);
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 3/5] ARM: mach-mvebu: remove redundant DT parsing and validation
2013-07-23 11:32 ` [PATCH 3/5] ARM: mach-mvebu: remove redundant DT parsing and validation Sudeep KarkadaNagesha
@ 2013-08-08 14:54 ` Sudeep KarkadaNagesha
2013-08-08 15:19 ` Gregory CLEMENT
2013-08-09 13:11 ` Jason Cooper
1 sibling, 1 reply; 18+ messages in thread
From: Sudeep KarkadaNagesha @ 2013-08-08 14:54 UTC (permalink / raw)
To: linux-arm-kernel
On 23/07/13 12:32, Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>
> arm_dt_init_cpu_maps parses the device tree, validates and sets the
> cpu_possible_mask appropriately. It is unnecessary to do another DT
> parse to get the number of cpus, use num_possible_cpus instead.
>
Hi Gregory,
Does this change look fine ?
If OK, not sure if you prefer to pick up this or want me to send to
arm-soc guys.
Regards,
Sudeep
> Cc: Gregory Clement <gregory.clement@free-electrons.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> ---
> arch/arm/mach-mvebu/platsmp.c | 19 +------------------
> 1 file changed, 1 insertion(+), 18 deletions(-)
>
> diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
> index ce81d30..2e4508a 100644
> --- a/arch/arm/mach-mvebu/platsmp.c
> +++ b/arch/arm/mach-mvebu/platsmp.c
> @@ -87,28 +87,11 @@ static int armada_xp_boot_secondary(unsigned int cpu, struct task_struct *idle)
>
> static void __init armada_xp_smp_init_cpus(void)
> {
> - struct device_node *np;
> - unsigned int i, ncores;
> + unsigned int ncores = num_possible_cpus();
>
> - np = of_find_node_by_name(NULL, "cpus");
> - if (!np)
> - panic("No 'cpus' node found\n");
> -
> - ncores = of_get_child_count(np);
> if (ncores == 0 || ncores > ARMADA_XP_MAX_CPUS)
> panic("Invalid number of CPUs in DT\n");
>
> - /* Limit possible CPUs to defconfig */
> - if (ncores > nr_cpu_ids) {
> - pr_warn("SMP: %d CPUs physically present. Only %d configured.",
> - ncores, nr_cpu_ids);
> - pr_warn("Clipping CPU count to %d\n", nr_cpu_ids);
> - ncores = nr_cpu_ids;
> - }
> -
> - for (i = 0; i < ncores; i++)
> - set_cpu_possible(i, true);
> -
> set_smp_cross_call(armada_mpic_send_doorbell);
> }
>
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/5] ARM: mach-mvebu: remove redundant DT parsing and validation
2013-08-08 14:54 ` Sudeep KarkadaNagesha
@ 2013-08-08 15:19 ` Gregory CLEMENT
2013-08-08 15:50 ` Jason Cooper
0 siblings, 1 reply; 18+ messages in thread
From: Gregory CLEMENT @ 2013-08-08 15:19 UTC (permalink / raw)
To: linux-arm-kernel
On 08/08/2013 16:54, Sudeep KarkadaNagesha wrote:
> On 23/07/13 12:32, Sudeep KarkadaNagesha wrote:
>> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>>
>> arm_dt_init_cpu_maps parses the device tree, validates and sets the
>> cpu_possible_mask appropriately. It is unnecessary to do another DT
>> parse to get the number of cpus, use num_possible_cpus instead.
>>
> Hi Gregory,
>
> Does this change look fine ?
Yes it is a nice cleanup.
and I have just test it on an Armada XP DB board.
So you can add
my Acked-by: Gregory Clement <gregory.clement@free-electrons.com>
> If OK, not sure if you prefer to pick up this or want me to send to
> arm-soc guys.
I think it is better if we pick up this patch as it only touch a file
belonging to mvebu.
Jason,
do you agree to pick it up and then push it to in your next (and maybe
last) pull request?
Thanks,
>
> Regards,
> Sudeep
>
>> Cc: Gregory Clement <gregory.clement@free-electrons.com>
>> Cc: Jason Cooper <jason@lakedaemon.net>
>> Cc: Andrew Lunn <andrew@lunn.ch>
>> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>> ---
>> arch/arm/mach-mvebu/platsmp.c | 19 +------------------
>> 1 file changed, 1 insertion(+), 18 deletions(-)
>>
>> diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
>> index ce81d30..2e4508a 100644
>> --- a/arch/arm/mach-mvebu/platsmp.c
>> +++ b/arch/arm/mach-mvebu/platsmp.c
>> @@ -87,28 +87,11 @@ static int armada_xp_boot_secondary(unsigned int cpu, struct task_struct *idle)
>>
>> static void __init armada_xp_smp_init_cpus(void)
>> {
>> - struct device_node *np;
>> - unsigned int i, ncores;
>> + unsigned int ncores = num_possible_cpus();
>>
>> - np = of_find_node_by_name(NULL, "cpus");
>> - if (!np)
>> - panic("No 'cpus' node found\n");
>> -
>> - ncores = of_get_child_count(np);
>> if (ncores == 0 || ncores > ARMADA_XP_MAX_CPUS)
>> panic("Invalid number of CPUs in DT\n");
>>
>> - /* Limit possible CPUs to defconfig */
>> - if (ncores > nr_cpu_ids) {
>> - pr_warn("SMP: %d CPUs physically present. Only %d configured.",
>> - ncores, nr_cpu_ids);
>> - pr_warn("Clipping CPU count to %d\n", nr_cpu_ids);
>> - ncores = nr_cpu_ids;
>> - }
>> -
>> - for (i = 0; i < ncores; i++)
>> - set_cpu_possible(i, true);
>> -
>> set_smp_cross_call(armada_mpic_send_doorbell);
>> }
>>
>>
>
>
--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/5] ARM: mach-mvebu: remove redundant DT parsing and validation
2013-08-08 15:19 ` Gregory CLEMENT
@ 2013-08-08 15:50 ` Jason Cooper
0 siblings, 0 replies; 18+ messages in thread
From: Jason Cooper @ 2013-08-08 15:50 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Aug 08, 2013 at 05:19:43PM +0200, Gregory CLEMENT wrote:
> On 08/08/2013 16:54, Sudeep KarkadaNagesha wrote:
> > On 23/07/13 12:32, Sudeep KarkadaNagesha wrote:
> >> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> >>
> >> arm_dt_init_cpu_maps parses the device tree, validates and sets the
> >> cpu_possible_mask appropriately. It is unnecessary to do another DT
> >> parse to get the number of cpus, use num_possible_cpus instead.
> >>
> > Hi Gregory,
> >
> > Does this change look fine ?
>
> Yes it is a nice cleanup.
>
> and I have just test it on an Armada XP DB board.
>
> So you can add
>
> my Acked-by: Gregory Clement <gregory.clement@free-electrons.com>
>
> > If OK, not sure if you prefer to pick up this or want me to send to
> > arm-soc guys.
>
> I think it is better if we pick up this patch as it only touch a file
> belonging to mvebu.
>
> Jason,
> do you agree to pick it up and then push it to in your next (and maybe
> last) pull request?
Yep.
thx,
Jason.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/5] ARM: mach-mvebu: remove redundant DT parsing and validation
2013-07-23 11:32 ` [PATCH 3/5] ARM: mach-mvebu: remove redundant DT parsing and validation Sudeep KarkadaNagesha
2013-08-08 14:54 ` Sudeep KarkadaNagesha
@ 2013-08-09 13:11 ` Jason Cooper
1 sibling, 0 replies; 18+ messages in thread
From: Jason Cooper @ 2013-08-09 13:11 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jul 23, 2013 at 12:32:42PM +0100, Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>
> arm_dt_init_cpu_maps parses the device tree, validates and sets the
> cpu_possible_mask appropriately. It is unnecessary to do another DT
> parse to get the number of cpus, use num_possible_cpus instead.
>
> Cc: Gregory Clement <gregory.clement@free-electrons.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> ---
> arch/arm/mach-mvebu/platsmp.c | 19 +------------------
> 1 file changed, 1 insertion(+), 18 deletions(-)
Applied to mvebu/soc with Gregory's Ack
thx,
Jason.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 4/5] ARM: highbank: remove redundant smp_init_cpus definition
2013-07-23 11:32 [PATCH 0/5] ARM: DT: remove redundant DT related code Sudeep KarkadaNagesha
` (2 preceding siblings ...)
2013-07-23 11:32 ` [PATCH 3/5] ARM: mach-mvebu: remove redundant DT parsing and validation Sudeep KarkadaNagesha
@ 2013-07-23 11:32 ` Sudeep KarkadaNagesha
2013-07-23 15:03 ` Rob Herring
2013-07-23 11:32 ` [PATCH 5/5] ARM: zynq: remove unnecessary setting of cpu_present_mask Sudeep KarkadaNagesha
` (2 subsequent siblings)
6 siblings, 1 reply; 18+ messages in thread
From: Sudeep KarkadaNagesha @ 2013-07-23 11:32 UTC (permalink / raw)
To: linux-arm-kernel
From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
arm_dt_init_cpu_maps is called before smp_init_cpus, which sets the
cpu_possible_mask appropriately. Since highbank_smp_init_cpus does
nothing extra, it can be removed.
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
arch/arm/mach-highbank/platsmp.c | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c
index 32d75cf5..25b0bae 100644
--- a/arch/arm/mach-highbank/platsmp.c
+++ b/arch/arm/mach-highbank/platsmp.c
@@ -31,27 +31,6 @@ static int highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
return 0;
}
-/*
- * Initialise the CPU possible map early - this describes the CPUs
- * which may be present or become present in the system.
- */
-static void __init highbank_smp_init_cpus(void)
-{
- unsigned int i, ncores = 4;
-
- /* sanity check */
- if (ncores > NR_CPUS) {
- printk(KERN_WARNING
- "highbank: no. of cores (%d) greater than configured "
- "maximum of %d - clipping\n",
- ncores, NR_CPUS);
- ncores = NR_CPUS;
- }
-
- for (i = 0; i < ncores; i++)
- set_cpu_possible(i, true);
-}
-
static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
{
if (scu_base_addr)
@@ -59,7 +38,6 @@ static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
}
struct smp_operations highbank_smp_ops __initdata = {
- .smp_init_cpus = highbank_smp_init_cpus,
.smp_prepare_cpus = highbank_smp_prepare_cpus,
.smp_boot_secondary = highbank_boot_secondary,
#ifdef CONFIG_HOTPLUG_CPU
--
1.8.1.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 4/5] ARM: highbank: remove redundant smp_init_cpus definition
2013-07-23 11:32 ` [PATCH 4/5] ARM: highbank: remove redundant smp_init_cpus definition Sudeep KarkadaNagesha
@ 2013-07-23 15:03 ` Rob Herring
2013-07-23 15:34 ` Sudeep KarkadaNagesha
0 siblings, 1 reply; 18+ messages in thread
From: Rob Herring @ 2013-07-23 15:03 UTC (permalink / raw)
To: linux-arm-kernel
On 07/23/2013 06:32 AM, Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>
> arm_dt_init_cpu_maps is called before smp_init_cpus, which sets the
> cpu_possible_mask appropriately. Since highbank_smp_init_cpus does
> nothing extra, it can be removed.
This is all going to get removed in my PSCI support series. Trying to
get an updated version out soon.
Rob
> Cc: Rob Herring <rob.herring@calxeda.com>
> Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
> ---
> arch/arm/mach-highbank/platsmp.c | 22 ----------------------
> 1 file changed, 22 deletions(-)
>
> diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c
> index 32d75cf5..25b0bae 100644
> --- a/arch/arm/mach-highbank/platsmp.c
> +++ b/arch/arm/mach-highbank/platsmp.c
> @@ -31,27 +31,6 @@ static int highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
> return 0;
> }
>
> -/*
> - * Initialise the CPU possible map early - this describes the CPUs
> - * which may be present or become present in the system.
> - */
> -static void __init highbank_smp_init_cpus(void)
> -{
> - unsigned int i, ncores = 4;
> -
> - /* sanity check */
> - if (ncores > NR_CPUS) {
> - printk(KERN_WARNING
> - "highbank: no. of cores (%d) greater than configured "
> - "maximum of %d - clipping\n",
> - ncores, NR_CPUS);
> - ncores = NR_CPUS;
> - }
> -
> - for (i = 0; i < ncores; i++)
> - set_cpu_possible(i, true);
> -}
> -
> static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
> {
> if (scu_base_addr)
> @@ -59,7 +38,6 @@ static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
> }
>
> struct smp_operations highbank_smp_ops __initdata = {
> - .smp_init_cpus = highbank_smp_init_cpus,
> .smp_prepare_cpus = highbank_smp_prepare_cpus,
> .smp_boot_secondary = highbank_boot_secondary,
> #ifdef CONFIG_HOTPLUG_CPU
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 4/5] ARM: highbank: remove redundant smp_init_cpus definition
2013-07-23 15:03 ` Rob Herring
@ 2013-07-23 15:34 ` Sudeep KarkadaNagesha
0 siblings, 0 replies; 18+ messages in thread
From: Sudeep KarkadaNagesha @ 2013-07-23 15:34 UTC (permalink / raw)
To: linux-arm-kernel
On 23/07/13 16:03, Rob Herring wrote:
> On 07/23/2013 06:32 AM, Sudeep KarkadaNagesha wrote:
>> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>>
>> arm_dt_init_cpu_maps is called before smp_init_cpus, which sets the
>> cpu_possible_mask appropriately. Since highbank_smp_init_cpus does
>> nothing extra, it can be removed.
>
> This is all going to get removed in my PSCI support series. Trying to
> get an updated version out soon.
>
Thanks for the update.
Regards,
Sudeep
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 5/5] ARM: zynq: remove unnecessary setting of cpu_present_mask
2013-07-23 11:32 [PATCH 0/5] ARM: DT: remove redundant DT related code Sudeep KarkadaNagesha
` (3 preceding siblings ...)
2013-07-23 11:32 ` [PATCH 4/5] ARM: highbank: remove redundant smp_init_cpus definition Sudeep KarkadaNagesha
@ 2013-07-23 11:32 ` Sudeep KarkadaNagesha
2013-07-23 12:31 ` [PATCH 0/5] ARM: DT: remove redundant DT related code Michal Simek
2013-07-23 19:45 ` Nicolas Pitre
6 siblings, 0 replies; 18+ messages in thread
From: Sudeep KarkadaNagesha @ 2013-07-23 11:32 UTC (permalink / raw)
To: linux-arm-kernel
From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
This patch also removes setting cpu_present_mask as platforms should
only re-initialize it in smp_prepare_cpus() if present != possible.
Cc: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
---
arch/arm/mach-zynq/platsmp.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
index 689fbbc..ae121b8 100644
--- a/arch/arm/mach-zynq/platsmp.c
+++ b/arch/arm/mach-zynq/platsmp.c
@@ -114,15 +114,6 @@ static void __init zynq_smp_init_cpus(void)
static void __init zynq_smp_prepare_cpus(unsigned int max_cpus)
{
- int i;
-
- /*
- * Initialise the present map, which describes the set of CPUs
- * actually populated at the present time.
- */
- for (i = 0; i < max_cpus; i++)
- set_cpu_present(i, true);
-
scu_enable(zynq_scu_base);
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 0/5] ARM: DT: remove redundant DT related code
2013-07-23 11:32 [PATCH 0/5] ARM: DT: remove redundant DT related code Sudeep KarkadaNagesha
` (4 preceding siblings ...)
2013-07-23 11:32 ` [PATCH 5/5] ARM: zynq: remove unnecessary setting of cpu_present_mask Sudeep KarkadaNagesha
@ 2013-07-23 12:31 ` Michal Simek
2013-07-23 12:36 ` Sudeep KarkadaNagesha
2013-07-23 19:45 ` Nicolas Pitre
6 siblings, 1 reply; 18+ messages in thread
From: Michal Simek @ 2013-07-23 12:31 UTC (permalink / raw)
To: linux-arm-kernel
On 07/23/2013 01:32 PM, Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>
> Hi,
>
> As part of my changes to remove duplicate code for parsing cpu nodes
> in the device tree, I found few unnecessary code mostly around smp_init_cpus.
> Most of the ARM Cortex A9 based platforms use SCU to get the number of cpus
> while many others depend on the device tree.
>
> Even on DT based platforms using SCU, they can be made to depend on DT
> to cpu count simplifying smp_init_cpus. In fact arm_dt_init_cpu_maps called
> before smp_init_cpus, already does the device tree parsing, validating
> nr_cpu_ids and setting the cpu_possible_mask appropriately.
>
> However this series targets only the platforms using DT for cpu count
> (i.e. not using SCU)
Just a note. Zynq is using SCU to get cpu count not DT.
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130723/4d2280f8/attachment.sig>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 0/5] ARM: DT: remove redundant DT related code
2013-07-23 12:31 ` [PATCH 0/5] ARM: DT: remove redundant DT related code Michal Simek
@ 2013-07-23 12:36 ` Sudeep KarkadaNagesha
0 siblings, 0 replies; 18+ messages in thread
From: Sudeep KarkadaNagesha @ 2013-07-23 12:36 UTC (permalink / raw)
To: linux-arm-kernel
On 23/07/13 13:31, Michal Simek wrote:
> On 07/23/2013 01:32 PM, Sudeep KarkadaNagesha wrote:
>> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>>
>> Hi,
>>
>> As part of my changes to remove duplicate code for parsing cpu nodes
>> in the device tree, I found few unnecessary code mostly around smp_init_cpus.
>> Most of the ARM Cortex A9 based platforms use SCU to get the number of cpus
>> while many others depend on the device tree.
>>
>> Even on DT based platforms using SCU, they can be made to depend on DT
>> to cpu count simplifying smp_init_cpus. In fact arm_dt_init_cpu_maps called
>> before smp_init_cpus, already does the device tree parsing, validating
>> nr_cpu_ids and setting the cpu_possible_mask appropriately.
>>
>> However this series targets only the platforms using DT for cpu count
>> (i.e. not using SCU)
>
> Just a note. Zynq is using SCU to get cpu count not DT.
>
Correct, when I saw that vexpress and zynq were only 2 platforms
setting cpu_present_mask which is unnecessary, I added Zynq last minute
to this series.
Regards,
Sudeep
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 0/5] ARM: DT: remove redundant DT related code
2013-07-23 11:32 [PATCH 0/5] ARM: DT: remove redundant DT related code Sudeep KarkadaNagesha
` (5 preceding siblings ...)
2013-07-23 12:31 ` [PATCH 0/5] ARM: DT: remove redundant DT related code Michal Simek
@ 2013-07-23 19:45 ` Nicolas Pitre
2013-07-24 10:48 ` Sudeep KarkadaNagesha
6 siblings, 1 reply; 18+ messages in thread
From: Nicolas Pitre @ 2013-07-23 19:45 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 23 Jul 2013, Sudeep KarkadaNagesha wrote:
> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>
> Hi,
>
> As part of my changes to remove duplicate code for parsing cpu nodes
> in the device tree, I found few unnecessary code mostly around smp_init_cpus.
> Most of the ARM Cortex A9 based platforms use SCU to get the number of cpus
> while many others depend on the device tree.
>
> Even on DT based platforms using SCU, they can be made to depend on DT
> to cpu count simplifying smp_init_cpus. In fact arm_dt_init_cpu_maps called
> before smp_init_cpus, already does the device tree parsing, validating
> nr_cpu_ids and setting the cpu_possible_mask appropriately.
>
> However this series targets only the platforms using DT for cpu count
> (i.e. not using SCU)
>
> Regards,
> Sudeep
For the whole series:
Acked-by: Nicolas Pitre <nico@linaro.org>
> Sudeep KarkadaNagesha (5):
> ARM: keystone: remove redundant smp_init_cpus definition
> ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count
> ARM: mach-mvebu: remove redundant DT parsing and validation
> ARM: highbank: remove redundant smp_init_cpus definition
> ARM: zynq: remove unnecessary setting of cpu_present_mask
>
> arch/arm/mach-highbank/platsmp.c | 22 ----------------------
> arch/arm/mach-keystone/platsmp.c | 1 -
> arch/arm/mach-mvebu/platsmp.c | 19 +------------------
> arch/arm/mach-vexpress/platsmp.c | 32 +-------------------------------
> arch/arm/mach-zynq/platsmp.c | 9 ---------
> 5 files changed, 2 insertions(+), 81 deletions(-)
>
> --
> 1.8.1.2
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 0/5] ARM: DT: remove redundant DT related code
2013-07-23 19:45 ` Nicolas Pitre
@ 2013-07-24 10:48 ` Sudeep KarkadaNagesha
0 siblings, 0 replies; 18+ messages in thread
From: Sudeep KarkadaNagesha @ 2013-07-24 10:48 UTC (permalink / raw)
To: linux-arm-kernel
On 23/07/13 20:45, Nicolas Pitre wrote:
> On Tue, 23 Jul 2013, Sudeep KarkadaNagesha wrote:
>
>> From: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
>>
>> Hi,
>>
>> As part of my changes to remove duplicate code for parsing cpu nodes
>> in the device tree, I found few unnecessary code mostly around smp_init_cpus.
>> Most of the ARM Cortex A9 based platforms use SCU to get the number of cpus
>> while many others depend on the device tree.
>>
>> Even on DT based platforms using SCU, they can be made to depend on DT
>> to cpu count simplifying smp_init_cpus. In fact arm_dt_init_cpu_maps called
>> before smp_init_cpus, already does the device tree parsing, validating
>> nr_cpu_ids and setting the cpu_possible_mask appropriately.
>>
>> However this series targets only the platforms using DT for cpu count
>> (i.e. not using SCU)
>>
>> Regards,
>> Sudeep
> For the whole series:
>
> Acked-by: Nicolas Pitre <nico@linaro.org>
>
Thanks for the review.
Regards,
Sudeep
^ permalink raw reply [flat|nested] 18+ messages in thread