]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
irq_bcm2836: Send event when onlining sleeping cores
authorPhil Elwell <phil@raspberrypi.org>
Mon, 8 May 2017 15:43:40 +0000 (16:43 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 16 Feb 2018 22:06:45 +0000 (17:06 -0500)
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

index c4e151451cf8c8ebde5225515eac2786d6f61d46..bee4d2d2ebacc3233423bb9d825e076b9f52fccd 100644 (file)
@@ -227,6 +227,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;
 }