[linux-oxnas] Re: [PATCH 1/2] ARM: oxnas: Add OX820 SMP support |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/linux-oxnas Archives
]
- To: Arnd Bergmann <arnd@xxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
- Subject: [linux-oxnas] Re: [PATCH 1/2] ARM: oxnas: Add OX820 SMP support
- From: Neil Armstrong <narmstrong@xxxxxxxxxxxx>
- Date: Mon, 17 Oct 2016 11:34:32 +0200
- Cc: linux-kernel@xxxxxxxxxxxxxxx, linux-oxnas@xxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=buUvjw6/0za/ElaxUeGHXXFBHmypfgfkdsvU/kRpSSM=; b=1N5pbaCSP5pK0t2ZMATDckjfz9OUd1yVVeHphhvoNq5htjTrRNFoS04KK+6NeA4rEM LLv1oepPrS4fhFXyu5hIOaiRmdCCySFVXqDOOlXpaBvnNW2B0D+M7s4BXuLGWMyC/td4 Np0T4cXwG0RIuNPRtIhDIlH3/dIqBLYyLgQvS9nzXY34l7jTFiHC5XtPneg7vQm/UCVf Fl9jTEvg80c0IvUPOcufM9w65dSw6al8u1ZaiuLWRkwp06lFGC7cMaTPcQ7R7gpcF7Rh PZD+fNkmbssJXk6oE0zWIH4xiQkFe8nblvH6yuK67Os/keVMPmu79FtHsaVv4nCDfezp NwgA==
- Organization: Baylibre
On 10/17/2016 11:06 AM, Arnd Bergmann wrote:
> On Monday, October 17, 2016 10:43:02 AM CEST Neil Armstrong wrote:
>> +
>> + /*
>> + * This is really belt and braces; we hold unintended secondary
>> + * CPUs in the holding pen until we're ready for them. However,
>> + * since we haven't sent them a soft interrupt, they shouldn't
>> + * be there.
>> + */
>> + write_pen_release(cpu);
>> +
>> + /*
>> + * Enable GIC cpu interface in CPU Interface Control Register
>> + */
>> + writel(GIC_CPU_CTRL_ENABLE,
>> + gic_cpu_ctrl + GIC_NCPU_OFFSET(cpu) + GIC_CPU_CTRL);
>> +
>> + /*
>> + * Send the secondary CPU a soft interrupt, thereby causing
>> + * the boot monitor to read the system wide flags register,
>> + * and branch to the address found there.
>> + */
>> +
>> + arch_send_wakeup_ipi_mask(cpumask_of(cpu));
>> + timeout = jiffies + (1 * HZ);
>> + while (time_before(jiffies, timeout)) {
>> + smp_rmb();
>> + if (read_pen_release() == -1)
>> + break;
>> +
>> + udelay(10);
>> + }
>>
>
> This seems to have been copied from plat-versatile, but is really
> not needed here since you apparently have proper hardware support for
> starting up the CPUs.
Yes it seems.
>
> Any reason you can't just write to the cpu_ctrl register
> once and keep going without that whole holding_pen loop
> and spinlock?
I suppose but I did not find any good examples except the plat-versatile code.
I will try some simpler code.
>
> Arnd
>
Neil