public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] ARM: bcm2836: Send event when onlining other cores
@ 2017-08-08 11:04 Phil Elwell
  2017-08-08 11:04 ` [PATCH] " Phil Elwell
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Elwell @ 2017-08-08 11:04 UTC (permalink / raw)
  To: Eric Anholt, Stefan Wahren, Florian Fainelli, Ray Jui,
	Scott Branden, bcm-kernel-feedback-list, Russell King,
	linux-arm-kernel, linux-kernel
  Cc: Phil Elwell

This two-line patch adds the "sev" instruction required to wake the
secondary cores, should they be sleeping in a "wfe" instruction.
It applies on top of Eric's bcm2835-soc-smp-cleanup branch[1], after
Stefan's patchset moving the SMP startup code out of the irqchip
driver.

[1] - https://github.com/anholt/linux/commits/bcm2835-soc-smp-cleanup

Phil Elwell (1):
  ARM: bcm2836: Send event when onlining other cores

 arch/arm/mach-bcm/platsmp.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] ARM: bcm2836: Send event when onlining other cores
  2017-08-08 11:04 [PATCH 0/1] ARM: bcm2836: Send event when onlining other cores Phil Elwell
@ 2017-08-08 11:04 ` Phil Elwell
  2017-08-14 16:25   ` Florian Fainelli
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Elwell @ 2017-08-08 11:04 UTC (permalink / raw)
  To: Eric Anholt, Stefan Wahren, Florian Fainelli, Ray Jui,
	Scott Branden, bcm-kernel-feedback-list, Russell King,
	linux-arm-kernel, linux-kernel
  Cc: Phil Elwell

Secondary cores should enter a low-power idle state when waiting to
be started. The "wfe" instruction causes a core to wait until an event
or interrupt arrives before continuing to the next instruction, and
the "sev" instruction sends a wakeup event to the other cores.

Add an "sev" (and a memory barrier) to bcm2836_boot_secondary, the
function that wakes the waiting cores during booting. This is required
if the secondary cores are sitting in "wfe", and harmless if not.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
---
 arch/arm/mach-bcm/platsmp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-bcm/platsmp.c b/arch/arm/mach-bcm/platsmp.c
index 3fa1a99..7811160 100644
--- a/arch/arm/mach-bcm/platsmp.c
+++ b/arch/arm/mach-bcm/platsmp.c
@@ -312,6 +312,9 @@ static int bcm2836_boot_secondary(unsigned int cpu, struct task_struct *idle)
 	writel(virt_to_phys(secondary_startup),
 	       intc_base + LOCAL_MAILBOX3_SET0 + 16 * cpu);
 
+	dsb(sy);
+	sev();
+
 	iounmap(intc_base);
 
 	return 0;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: bcm2836: Send event when onlining other cores
  2017-08-08 11:04 ` [PATCH] " Phil Elwell
@ 2017-08-14 16:25   ` Florian Fainelli
  2017-08-14 17:11     ` Stefan Wahren
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2017-08-14 16:25 UTC (permalink / raw)
  To: Phil Elwell, Eric Anholt, Stefan Wahren, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, Russell King,
	linux-arm-kernel, linux-kernel



On 08/08/2017 04:04 AM, Phil Elwell wrote:
> Secondary cores should enter a low-power idle state when waiting to
> be started. The "wfe" instruction causes a core to wait until an event
> or interrupt arrives before continuing to the next instruction, and
> the "sev" instruction sends a wakeup event to the other cores.
> 
> Add an "sev" (and a memory barrier) to bcm2836_boot_secondary, the
> function that wakes the waiting cores during booting. This is required
> if the secondary cores are sitting in "wfe", and harmless if not.

Eric, should I just pick this up for the upcoming ARM SoC pull requests
that I am preparing, or do you have more changes aside from the two tags
I already merged?

Thanks!

> 
> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
> ---
>  arch/arm/mach-bcm/platsmp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/mach-bcm/platsmp.c b/arch/arm/mach-bcm/platsmp.c
> index 3fa1a99..7811160 100644
> --- a/arch/arm/mach-bcm/platsmp.c
> +++ b/arch/arm/mach-bcm/platsmp.c
> @@ -312,6 +312,9 @@ static int bcm2836_boot_secondary(unsigned int cpu, struct task_struct *idle)
>  	writel(virt_to_phys(secondary_startup),
>  	       intc_base + LOCAL_MAILBOX3_SET0 + 16 * cpu);
>  
> +	dsb(sy);
> +	sev();
> +
>  	iounmap(intc_base);
>  
>  	return 0;
> 

-- 
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: bcm2836: Send event when onlining other cores
  2017-08-14 16:25   ` Florian Fainelli
@ 2017-08-14 17:11     ` Stefan Wahren
  2017-08-14 18:40       ` Stefan Wahren
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Wahren @ 2017-08-14 17:11 UTC (permalink / raw)
  To: Eric Anholt, Florian Fainelli
  Cc: Phil Elwell, Scott Branden, Ray Jui, Russell King, linux-kernel,
	linux-arm-kernel, bcm-kernel-feedback-list

Hi Florian,

> Florian Fainelli <f.fainelli@gmail.com> hat am 14. August 2017 um 18:25 geschrieben:
> 
> 
> 
> 
> On 08/08/2017 04:04 AM, Phil Elwell wrote:
> > Secondary cores should enter a low-power idle state when waiting to
> > be started. The "wfe" instruction causes a core to wait until an event
> > or interrupt arrives before continuing to the next instruction, and
> > the "sev" instruction sends a wakeup event to the other cores.
> > 
> > Add an "sev" (and a memory barrier) to bcm2836_boot_secondary, the
> > function that wakes the waiting cores during booting. This is required
> > if the secondary cores are sitting in "wfe", and harmless if not.
> 
> Eric, should I just pick this up for the upcoming ARM SoC pull requests
> that I am preparing, or do you have more changes aside from the two tags
> I already merged?

this patch depends on series "ARM: bcm2836: Move SMP startup code to arch/arm".

I didn't had the time to test Phil's patch in all relevant cases. But i could at least prepare a branch with my changes with the acks.

Stefan

> 
> Thanks!
> 
> > 
> > Signed-off-by: Phil Elwell <phil@raspberrypi.org>
> > ---
> >  arch/arm/mach-bcm/platsmp.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/arch/arm/mach-bcm/platsmp.c b/arch/arm/mach-bcm/platsmp.c
> > index 3fa1a99..7811160 100644
> > --- a/arch/arm/mach-bcm/platsmp.c
> > +++ b/arch/arm/mach-bcm/platsmp.c
> > @@ -312,6 +312,9 @@ static int bcm2836_boot_secondary(unsigned int cpu, struct task_struct *idle)
> >  	writel(virt_to_phys(secondary_startup),
> >  	       intc_base + LOCAL_MAILBOX3_SET0 + 16 * cpu);
> >  
> > +	dsb(sy);
> > +	sev();
> > +
> >  	iounmap(intc_base);
> >  
> >  	return 0;
> > 
> 
> -- 
> Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: bcm2836: Send event when onlining other cores
  2017-08-14 17:11     ` Stefan Wahren
@ 2017-08-14 18:40       ` Stefan Wahren
  2017-08-15 18:04         ` Eric Anholt
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Wahren @ 2017-08-14 18:40 UTC (permalink / raw)
  To: Eric Anholt, Florian Fainelli
  Cc: Phil Elwell, Scott Branden, Ray Jui, Russell King, linux-kernel,
	bcm-kernel-feedback-list, linux-arm-kernel

Hi Eric,

> Stefan Wahren <stefan.wahren@i2se.com> hat am 14. August 2017 um 19:11 geschrieben:
> 
> 
> Hi Florian,
> 
> > Florian Fainelli <f.fainelli@gmail.com> hat am 14. August 2017 um 18:25 geschrieben:
> > 
> > 
> > 
> > 
> > On 08/08/2017 04:04 AM, Phil Elwell wrote:
> > > Secondary cores should enter a low-power idle state when waiting to
> > > be started. The "wfe" instruction causes a core to wait until an event
> > > or interrupt arrives before continuing to the next instruction, and
> > > the "sev" instruction sends a wakeup event to the other cores.
> > > 
> > > Add an "sev" (and a memory barrier) to bcm2836_boot_secondary, the
> > > function that wakes the waiting cores during booting. This is required
> > > if the secondary cores are sitting in "wfe", and harmless if not.
> > 
> > Eric, should I just pick this up for the upcoming ARM SoC pull requests
> > that I am preparing, or do you have more changes aside from the two tags
> > I already merged?
> 
> this patch depends on series "ARM: bcm2836: Move SMP startup code to arch/arm".
> 
> I didn't had the time to test Phil's patch in all relevant cases. But i could at least prepare a branch with my changes with the acks.

i prepared the branches bcm2835-dt-next-v2 and bcm2835-soc-next.

Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: bcm2836: Send event when onlining other cores
  2017-08-14 18:40       ` Stefan Wahren
@ 2017-08-15 18:04         ` Eric Anholt
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Anholt @ 2017-08-15 18:04 UTC (permalink / raw)
  To: Stefan Wahren, Florian Fainelli
  Cc: Phil Elwell, Scott Branden, Ray Jui, Russell King, linux-kernel,
	bcm-kernel-feedback-list, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1586 bytes --]

Stefan Wahren <stefan.wahren@i2se.com> writes:

> Hi Eric,
>
>> Stefan Wahren <stefan.wahren@i2se.com> hat am 14. August 2017 um 19:11 geschrieben:
>> 
>> 
>> Hi Florian,
>> 
>> > Florian Fainelli <f.fainelli@gmail.com> hat am 14. August 2017 um 18:25 geschrieben:
>> > 
>> > 
>> > 
>> > 
>> > On 08/08/2017 04:04 AM, Phil Elwell wrote:
>> > > Secondary cores should enter a low-power idle state when waiting to
>> > > be started. The "wfe" instruction causes a core to wait until an event
>> > > or interrupt arrives before continuing to the next instruction, and
>> > > the "sev" instruction sends a wakeup event to the other cores.
>> > > 
>> > > Add an "sev" (and a memory barrier) to bcm2836_boot_secondary, the
>> > > function that wakes the waiting cores during booting. This is required
>> > > if the secondary cores are sitting in "wfe", and harmless if not.
>> > 
>> > Eric, should I just pick this up for the upcoming ARM SoC pull requests
>> > that I am preparing, or do you have more changes aside from the two tags
>> > I already merged?
>> 
>> this patch depends on series "ARM: bcm2836: Move SMP startup code to arch/arm".
>> 
>> I didn't had the time to test Phil's patch in all relevant cases. But i could at least prepare a branch with my changes with the acks.
>
> i prepared the branches bcm2835-dt-next-v2 and bcm2835-soc-next.

bcm2835-soc-next on its own breaks boot for me on the Pi2, so I had to
merge in the DT branch first.  I've rebased to do that, pulled in this
patch (and the clk one), and sent PRs for -dt and -soc.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-08-15 18:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-08 11:04 [PATCH 0/1] ARM: bcm2836: Send event when onlining other cores Phil Elwell
2017-08-08 11:04 ` [PATCH] " Phil Elwell
2017-08-14 16:25   ` Florian Fainelli
2017-08-14 17:11     ` Stefan Wahren
2017-08-14 18:40       ` Stefan Wahren
2017-08-15 18:04         ` Eric Anholt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox