All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep.KarkadaNagesha@arm.com (Sudeep KarkadaNagesha)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] ARM: vexpress: remove redundant vexpress_dt_cpus_num to get cpu count
Date: Fri, 09 Aug 2013 10:25:33 +0100	[thread overview]
Message-ID: <5204B58D.2030501@arm.com> (raw)
In-Reply-To: <1374579164-30255-3-git-send-email-Sudeep.KarkadaNagesha@arm.com>

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);
> 

  reply	other threads:[~2013-08-09  9:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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
2013-08-09  9:25   ` Sudeep KarkadaNagesha [this message]
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-08 15:50       ` Jason Cooper
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
2013-07-23 15:03   ` Rob Herring
2013-07-23 15:34     ` Sudeep KarkadaNagesha
2013-07-23 11:32 ` [PATCH 5/5] ARM: zynq: remove unnecessary setting of cpu_present_mask Sudeep KarkadaNagesha
2013-07-23 12:31 ` [PATCH 0/5] ARM: DT: remove redundant DT related code Michal Simek
2013-07-23 12:36   ` Sudeep KarkadaNagesha
2013-07-23 19:45 ` Nicolas Pitre
2013-07-24 10:48   ` Sudeep KarkadaNagesha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5204B58D.2030501@arm.com \
    --to=sudeep.karkadanagesha@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.