Skip to contentSkip to conversation

ARM: DT: remove redundant DT related code

PATCH New Sudeep KarkadaNagesha 7 participants 18 messages Jul 23, 2013 – Aug 9, 2013

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

cover ARM: DT: remove redundant DT related code

From: Sudeep KarkadaNagesha <[email protected]>

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

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(-)
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/5 ARM: keystone: remove redundant smp_init_cpus definition

From: Sudeep KarkadaNagesha <[email protected]>

arm_dt_init_cpu_maps is called before smp_init_cpus. It makes the platform/SoC definition of smp_init_cpus unnecessary.

---
 arch/arm/mach-keystone/platsmp.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-keystone/platsmp.c +0 -1
index 14378e3..c122961 100644
@@ -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,
 };
Signature · 1 line
1.8.1.2
#3 lore raw

PATCH 2/5 ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count

In reply to Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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.

---
 arch/arm/mach-vexpress/platsmp.c | 32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)
arch/arm/mach-vexpress/platsmp.c +1 -31
index 993c9ae..4a2d8c4 100644
@@ -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);
Signature · 1 line
1.8.1.2
#4 lore raw

PATCH 2/5 ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count

Hi Pawel,

Quoted 9 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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

Quoted 65 lines
---
 arch/arm/mach-vexpress/platsmp.c | 32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)
arch/arm/mach-vexpress/platsmp.c +1 -31
index 993c9ae..4a2d8c4 100644
@@ -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);
#5 lore raw

PATCH 3/5 ARM: mach-mvebu: remove redundant DT parsing and validation

In reply to Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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 <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Andrew Lunn <[email protected]>
---
 arch/arm/mach-mvebu/platsmp.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
arch/arm/mach-mvebu/platsmp.c +1 -18
index ce81d30..2e4508a 100644
@@ -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);
 }
 
Signature · 1 line
1.8.1.2
#6 lore raw

PATCH 3/5 ARM: mach-mvebu: remove redundant DT parsing and validation

Quoted 6 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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

Quoted 43 lines
Cc Gregory Clement <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Andrew Lunn <[email protected]>
---
 arch/arm/mach-mvebu/platsmp.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
arch/arm/mach-mvebu/platsmp.c +1 -18
index ce81d30..2e4508a 100644
@@ -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);
 }
 
#7 lore raw

PATCH 3/5 ARM: mach-mvebu: remove redundant DT parsing and validation

Quoted 10 lines · Sudeep KarkadaNagesha
Quoted 6 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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 <[email protected]>

Quoted 2 lines

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,

Quoted 49 lines

Regards,
Sudeep

Quoted 43 lines
Cc Gregory Clement <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Andrew Lunn <[email protected]>
---
 arch/arm/mach-mvebu/platsmp.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
arch/arm/mach-mvebu/platsmp.c +1 -18
index ce81d30..2e4508a 100644
@@ -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);
 }
 
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#8 lore raw

PATCH 3/5 ARM: mach-mvebu: remove redundant DT parsing and validation

Quoted 23 lines · Gregory CLEMENT
Quoted 10 lines · Sudeep KarkadaNagesha
Quoted 6 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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 <[email protected]>

Quoted 2 lines

If OK, not sure if you prefer to pick up this or want me to send to arm-soc guys.

Quoted 6 lines

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.

Applied
#9 lore raw

PATCH 3/5 ARM: mach-mvebu: remove redundant DT parsing and validation

In reply to Sudeep KarkadaNagesha
Quoted 6 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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.

Quoted 7 lines
Cc Gregory Clement <[email protected]>
Cc Jason Cooper <[email protected]>
Cc Andrew Lunn <[email protected]>
---
 arch/arm/mach-mvebu/platsmp.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

Applied to mvebu/soc with Gregory's Ack

thx,

Jason.

#10 lore raw

PATCH 4/5 ARM: highbank: remove redundant smp_init_cpus definition

In reply to Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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.

---
 arch/arm/mach-highbank/platsmp.c | 22 ----------------------
 1 file changed, 22 deletions(-)
arch/arm/mach-highbank/platsmp.c +0 -22
index 32d75cf5..25b0bae 100644
@@ -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
Signature · 1 line
1.8.1.2
#11 lore raw

PATCH 4/5 ARM: highbank: remove redundant smp_init_cpus definition

Quoted 5 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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

Quoted 47 lines
---
 arch/arm/mach-highbank/platsmp.c | 22 ----------------------
 1 file changed, 22 deletions(-)
arch/arm/mach-highbank/platsmp.c +0 -22
index 32d75cf5..25b0bae 100644
@@ -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
#12 lore raw

PATCH 4/5 ARM: highbank: remove redundant smp_init_cpus definition

Quoted 10 lines · Rob Herring
Quoted 5 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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

#13 lore raw

PATCH 5/5 ARM: zynq: remove unnecessary setting of cpu_present_mask

In reply to Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

This patch also removes setting cpu_present_mask as platforms should only re-initialize it in smp_prepare_cpus() if present != possible.

---
 arch/arm/mach-zynq/platsmp.c | 9 ---------
 1 file changed, 9 deletions(-)
arch/arm/mach-zynq/platsmp.c +0 -9
index 689fbbc..ae121b8 100644
@@ -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);
 }
 
Signature · 1 line
1.8.1.2
#14 lore raw

cover ARM: DT: remove redundant DT related code

In reply to Sudeep KarkadaNagesha
Quoted 9 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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.

Quoted 7 lines

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

Signature · 14 lines
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>
#15 lore raw

cover ARM: DT: remove redundant DT related code

Quoted 15 lines · Michal Simek
Quoted 14 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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.

Quoted 5 lines
Quoted 2 lines

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

#16 lore raw

cover ARM: DT: remove redundant DT related code

In reply to Sudeep KarkadaNagesha
Quoted 14 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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.

Quoted 5 lines

However this series targets only the platforms using DT for cpu count (i.e. not using SCU)

Regards,
Sudeep

For the whole series:

Quoted 24 lines

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(-)
Signature · 8 lines
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
#17 lore raw

cover ARM: DT: remove redundant DT related code

Quoted 16 lines · Nicolas Pitre
Quoted 14 lines · Sudeep KarkadaNagesha

From: Sudeep KarkadaNagesha <[email protected]>

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.

Quoted 9 lines
Quoted 5 lines

However this series targets only the platforms using DT for cpu count (i.e. not using SCU)

Regards,
Sudeep

For the whole series:

Thanks for the review.

Regards,
Sudeep