[PATCH 19/19] ppc64: Use setup_cpu_maps() instead of iSeries specific smp code

David Gibson david at gibson.dropbear.id.au
Wed Jul 27 12:21:04 EST 2005


On Tue, Jul 26, 2005 at 06:58:43PM +1000, Michael Ellerman wrote:
> Call setup_cpu_maps() on iSeries which will setup the cpu maps from the device
> tree. This removes the need for smp_iSeries_numProcs() and makes
> smp_iSeries_probe() a one-liner.
> 
> ---
> 
>  arch/ppc64/kernel/iSeries_smp.c |   30 +-----------------------------
>  arch/ppc64/kernel/setup.c       |    8 +-------
>  2 files changed, 2 insertions(+), 36 deletions(-)
> 
> Index: work/arch/ppc64/kernel/iSeries_smp.c
> ===================================================================
> --- work.orig/arch/ppc64/kernel/iSeries_smp.c
> +++ work/arch/ppc64/kernel/iSeries_smp.c
> @@ -82,35 +82,9 @@ static void smp_iSeries_message_pass(int
>  	}
>  }
>  
> -static int smp_iSeries_numProcs(void)
> -{
> -	unsigned np, i;
> -
> -	np = 0;
> -        for (i=0; i < NR_CPUS; ++i) {
> -                if (paca[i].lppaca.dyn_proc_status < 2) {
> -			cpu_set(i, cpu_possible_map);
> -			cpu_set(i, cpu_present_map);
> -			cpu_set(i, cpu_sibling_map[i]);
> -                        ++np;
> -                }
> -        }
> -	return np;
> -}
> -
>  static int smp_iSeries_probe(void)
>  {
> -	unsigned i;
> -	unsigned np = 0;
> -
> -	for (i=0; i < NR_CPUS; ++i) {
> -		if (paca[i].lppaca.dyn_proc_status < 2) {
> -			/*paca[i].active = 1;*/
> -			++np;
> -		}
> -	}
> -
> -	return np;
> +	return cpus_weight(cpu_possible_map);
>  }

I would be inclined to get rid of this function entirely now, and just
replace it with cpus_weight() in the callers.

>  
>  static void smp_iSeries_kick_cpu(int nr)
> @@ -144,6 +118,4 @@ static struct smp_ops_t iSeries_smp_ops 
>  void __init smp_init_iSeries(void)
>  {
>  	smp_ops = &iSeries_smp_ops;
> -	systemcfg->processorCount	= smp_iSeries_numProcs();
>  }
> -
> Index: work/arch/ppc64/kernel/setup.c
> ===================================================================
> --- work.orig/arch/ppc64/kernel/setup.c
> +++ work/arch/ppc64/kernel/setup.c
> @@ -182,8 +182,6 @@ void __init disable_early_printk(void)
>  	early_console_initialized = 0;
>  }
>  
> -#if defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_SMP)
> -
>  static int smt_enabled_cmdline;
>  
>  /* Look for ibm,smt-enabled OF option */
> @@ -335,7 +333,6 @@ static void __init setup_cpu_maps(void)
>  
>  	systemcfg->processorCount = num_present_cpus();
>  }
> -#endif /* defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_SMP) */
>  
>  
>  #ifdef CONFIG_PPC_MULTIPLATFORM
> @@ -637,12 +634,9 @@ void __init setup_system(void)
>  
>  	parse_early_param();
>  
> -#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES)
> -	/*
> -	 * iSeries has already initialized the cpu maps at this point.
> -	 */
>  	setup_cpu_maps();
>  
> +#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_ISERIES)
>  	/* Release secondary cpus out of their spinloops at 0x60 now that
>  	 * we can map physical -> logical CPU ids
>  	 */
> _______________________________________________
> Linuxppc64-dev mailing list
> Linuxppc64-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc64-dev
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/people/dgibson



More information about the Linuxppc64-dev mailing list