From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754981AbdEIQ7J (ORCPT ); Tue, 9 May 2017 12:59:09 -0400 Received: from anholt.net ([50.246.234.109]:37010 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754330AbdEIQ7I (ORCPT ); Tue, 9 May 2017 12:59:08 -0400 From: Eric Anholt To: Phil Elwell , Thomas Gleixner , Jason Cooper , Marc Zyngier , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org Subject: Re: [PATCH] irq_bcm2836: Send event when onlining sleeping cores In-Reply-To: References: User-Agent: Notmuch/0.22.2+1~gb0bcfaa (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Tue, 09 May 2017 09:59:04 -0700 Message-ID: <87ziemm0fb.fsf@eliezer.anholt.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Phil Elwell writes: > 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 > --- > 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); >=20=20 > + dsb(sy); /* Ensure write has completed before waking the other CPUs */ > + sev(); > + > return 0; > } This is also the behavior that the standard arm64 spin-table method has, which we unfortunately can't quite use. Acked-by: Eric Anholt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlkR9VgACgkQtdYpNtH8 nugSXQ//UTg+SKucFOHXQGsXZRhH3Nq847fVBefBdF1QfV8c5r1ZrWxiPdDGglD2 Kne7dsISF5b5f/6T8rQBu3aO7otW1nm4ex7sxoqDHx8Y9M8Kme+h8VJKw6Urm+Xz xctmbiycnO/kEVupF3xVPAgWCYYP43WqT5t8qSec4QquTYBC4vWDek+jfHQMDUqE Z7NHauHODT4bF9jaBmAwrlA00cndk/FDppc/L2Qo+q/AlixlA2Py1IVGdJ9VpfV6 wyaBFqhhi7I9ynjACn3OslS87EUe/pe1FMyYHFmCEynxaq9OzVozqGVNaladx6rq xA1WJj7/BRVX+DgMiCTNKioCEpaOZq2HTe3nTyK48bU/R75UXzqcZlfKSmqmAW2g jMTcmtXkstrVYTDrgbnUGKm2vW/r9B6lE/q27St/a+KV1X1WzpjPMcyesUU90raL wilLsYlmvaVSqapeA1cYd4J/br9laYqQBnhaczNeoKz3GKy4iuQVgvzYj8O1med8 kcJugQhTzxJliX3naOZqHg9pLOpAIASx+X9KkN0Hy9nI6KCtwwb3PW7g5rAs5Su8 JtHuLgkzoRogyFM4GsghASyl7cZiszytDaxnfsQLRFpCV8kmI1BVVqwUqUA8pigd OdVrw3BpyXuF402wkiS+uK9cZTX88ErQcB1LpCLpI78u219eHTs= =hxYy -----END PGP SIGNATURE----- --=-=-=--