public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: santosh.shilimkar@ti.com (Santosh)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v2 2/3] ARM: SoC: Add per SoC SMP and CPU hotplug operations
Date: Fri, 09 Sep 2011 22:37:51 +0530	[thread overview]
Message-ID: <4E6A47E7.5020006@ti.com> (raw)
In-Reply-To: <4E6A2D32.90600@arm.com>

On Friday 09 September 2011 08:43 PM, Marc Zyngier wrote:
> Hi Santosh,
>
> On 09/09/11 15:55, Santosh wrote:
>> Marc,
>>
>> On Friday 09 September 2011 08:16 PM, Marc Zyngier wrote:
>>> Populate the SoC descriptor structure with the SMP and CPU hotplug
>>> operations. To allow the kernel to continue building, the platform
>>> hooks are defined as weak symbols which are overrided by the
>>> platform code. Once all platforms are converted, the "weak" attribute
>>> will be removed and the function made static.
>>>
>>> Cc: Arnd Bergmann<arnd@arndb.de>
>>> Cc: Nicolas Pitre<nico@fluxnic.net>
>>> Signed-off-by: Marc Zyngier<marc.zyngier@arm.com>
>>> ---
>>>    arch/arm/include/asm/soc.h |   18 ++++++++++++++++
>>>    arch/arm/kernel/setup.c    |   11 ++++++++++
>>>    arch/arm/kernel/smp.c      |   47 ++++++++++++++++++++++++++++++++++++++++++++
>>>    3 files changed, 76 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/include/asm/soc.h b/arch/arm/include/asm/soc.h
>>> index ce92784..2593f90 100644
>>> --- a/arch/arm/include/asm/soc.h
>>> +++ b/arch/arm/include/asm/soc.h
>>> @@ -12,10 +12,28 @@
>>>    #ifndef __ASM_ARM_SOC_H
>>>    #define __ASM_ARM_SOC_H
>>>
>>> +struct task_struct;
>>> +
>>> +struct arm_soc_smp_ops {
>>> +	void (*smp_init_cpus)(void);
>>> +	void (*smp_prepare_cpus)(unsigned int max_cpus);
>>> +	void (*smp_secondary_init)(unsigned int cpu);
>>> +	int  (*smp_boot_secondary)(unsigned int cpu, struct task_struct *idle);
>>> +#ifdef CONFIG_HOTPLUG_CPU
>>> +	int  (*cpu_kill)(unsigned int cpu);
>>> +	void (*cpu_die)(unsigned int cpu);
>>> +	int  (*cpu_disable)(unsigned int cpu);
>>> +#endif
>>> +};
>> Sorry for such a basic question but I don't understand the need
>> of these wrappers.
>> I am not upto speed on this topic but what is the motivation
>> behind the soc_smp_ops(). All of above functions are CPU specific
>> and not really soc specific though, I agree that every SOC,
>> implements it's own version.
>
> My understanding is that they really are SoC specific. If you compare
> OMAP4, Tegra and VExpress (for example), you'll notice that these
> functions are quite different, despite using the same A9 CPU.
>
> For example, you boot a secondary CPU on OMAP4 by trapping into secure
> mode, on Tegra by powering it on, and on VE by writing the expected
> value to some location.
>
> Indirecting these functions makes it possible to compile support for
> multiple SMP platforms into the same image. Probably it is possible to
> reduce the differences to something smaller than the above, but I'd
> rather change one thing at a time.
>
> Let's add the indirection first (which essentially preserves the
> existing internal API), and only then let's see if we can spot common
> patterns across the whole range of SMP implementations.
>
Thanks Marc for the heads up. I agree with the current approach

  reply	other threads:[~2011-09-09 17:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-09 14:46 [RFC PATCH v2 0/3] Per SoC descriptor Marc Zyngier
2011-09-09 14:46 ` [RFC PATCH v2 1/3] ARM: SoC: Introduce per " Marc Zyngier
2011-09-09 14:46 ` [RFC PATCH v2 2/3] ARM: SoC: Add per SoC SMP and CPU hotplug operations Marc Zyngier
2011-09-09 14:55   ` Santosh
2011-09-09 15:06     ` Arnd Bergmann
2011-09-09 17:06       ` Santosh
2011-09-09 15:13     ` Marc Zyngier
2011-09-09 17:07       ` Santosh [this message]
2011-09-09 18:17   ` Nicolas Pitre
2011-09-09 14:46 ` [RFC PATCH v2 3/3] ARM: SoC: convert VExpress/RealView to SoC descriptor Marc Zyngier
2011-09-09 14:56   ` Arnd Bergmann
2011-09-09 15:20     ` Marc Zyngier

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=4E6A47E7.5020006@ti.com \
    --to=santosh.shilimkar@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox