48ccfbfab48447aaac43bf089267689d3f530700
[openwrt/staging/ynezz.git] /
1 From 6b8b69ff7c4c25f01535cbe49a80516df6dbcfe8 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 8 May 2017 16:43:40 +0100
4 Subject: [PATCH 010/454] irq_bcm2836: Send event when onlining sleeping cores
5
6 In order to reduce power consumption and bus traffic, it is sensible
7 for secondary cores to enter a low-power idle state when waiting to
8 be started. The wfe instruction causes a core to wait until an event
9 or interrupt arrives before continuing to the next instruction.
10 The sev instruction sends a wakeup event to the other cores, so call
11 it from bcm2836_smp_boot_secondary, the function that wakes up the
12 waiting cores during booting.
13
14 It is harmless to use this patch without the corresponding change
15 adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated
16 and this patch is not applied then the other cores will sleep forever.
17
18 See: https://github.com/raspberrypi/linux/issues/1989
19
20 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
21 ---
22 drivers/irqchip/irq-bcm2836.c | 3 +++
23 1 file changed, 3 insertions(+)
24
25 --- a/drivers/irqchip/irq-bcm2836.c
26 +++ b/drivers/irqchip/irq-bcm2836.c
27 @@ -227,6 +227,9 @@ static int __init bcm2836_smp_boot_secon
28 writel(secondary_startup_phys,
29 intc.base + LOCAL_MAILBOX3_SET0 + 16 * cpu);
30
31 + dsb(sy); /* Ensure write has completed before waking the other CPUs */
32 + sev();
33 +
34 return 0;
35 }
36