linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irq_bcm2836: Send event when onlining sleeping cores
@ 2017-05-09  8:30 Phil Elwell
  2017-05-09 16:59 ` Eric Anholt
  0 siblings, 1 reply; 19+ messages in thread
From: Phil Elwell @ 2017-05-09  8:30 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier, Florian Fainelli,
	Ray Jui, Scott Branden, bcm-kernel-feedback-list, linux-kernel,
	linux-rpi-kernel

In order to reduce power consumption and bus traffic, it is sensible
for secondary cores to 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.
The sev instruction sends a wakeup event to the other cores, so call
it from bcm2836_smp_boot_secondary, the function that wakes up the
waiting cores during booting.

It is harmless to use this patch without the corresponding change
adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated
and this patch is not applied then the other cores will sleep forever.

See: https://github.com/raspberrypi/linux/issues/1989

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
---
 drivers/irqchip/irq-bcm2836.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c
index e10597c..6dccdf9 100644
--- a/drivers/irqchip/irq-bcm2836.c
+++ b/drivers/irqchip/irq-bcm2836.c
@@ -248,6 +248,9 @@ static int __init bcm2836_smp_boot_secondary(unsigned int cpu,
 	writel(secondary_startup_phys,
 	       intc.base + LOCAL_MAILBOX3_SET0 + 16 * cpu);
 
+	dsb(sy); /* Ensure write has completed before waking the other CPUs */
+	sev();
+
 	return 0;
 }
 
-- 
1.9.1

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

end of thread, other threads:[~2017-05-10 18:23 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09  8:30 [PATCH] irq_bcm2836: Send event when onlining sleeping cores Phil Elwell
2017-05-09 16:59 ` Eric Anholt
2017-05-09 17:09   ` Marc Zyngier
2017-05-09 18:08     ` Eric Anholt
2017-05-09 18:14       ` Marc Zyngier
2017-05-09 18:52         ` Phil Elwell
2017-05-09 18:53           ` Marc Zyngier
2017-05-09 19:02             ` Phil Elwell
2017-05-10  7:42               ` Marc Zyngier
2017-05-10  8:27                 ` Phil Elwell
2017-05-10  8:55                   ` Marc Zyngier
2017-05-10  9:05                     ` Phil Elwell
2017-05-10 10:09                       ` Marc Zyngier
2017-05-10 10:31                         ` Phil Elwell
2017-05-10 16:21                           ` Florian Fainelli
2017-05-10 17:15                             ` Marc Zyngier
2017-05-10 17:59                               ` Florian Fainelli
2017-05-10 18:02                             ` Eric Anholt
2017-05-10 18:23                               ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).