From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754262AbdEISJI (ORCPT ); Tue, 9 May 2017 14:09:08 -0400 Received: from anholt.net ([50.246.234.109]:37482 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754053AbdEISJF (ORCPT ); Tue, 9 May 2017 14:09:05 -0400 From: Eric Anholt To: Marc Zyngier , Phil Elwell , Thomas Gleixner , Jason Cooper , 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: <1e871525-3298-f16d-4f95-a44bc78068b5@arm.com> References: <87ziemm0fb.fsf@eliezer.anholt.net> <1e871525-3298-f16d-4f95-a44bc78068b5@arm.com> 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 11:08:56 -0700 Message-ID: <87o9v1c37r.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 Marc Zyngier writes: > On 09/05/17 17:59, Eric Anholt wrote: >> Phil Elwell writes: >>=20 >>> 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-bcm283= 6.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(unsign= ed 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; >>> } >>=20 >> This is also the behavior that the standard arm64 spin-table method has, >> which we unfortunately can't quite use. > > And why is that so? Why do you have to reinvent the wheel (and hide the > cloned wheel in an interrupt controller driver)? > > That doesn't seem right to me. The armv8 stubs (firmware-supplied code in the low page that do the spinning) do actually implement arm64's spin-table method. It's the armv7 stubs that use these registers in the irqchip instead of plain addresses in system memory. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlkSBbgACgkQtdYpNtH8 nuih9g/9Eg9i2M0MCqLM+lagPBpTHd06Em4MLB1vTj0aOy5Hzmrxy/SClKO6VqJ0 9yUOaJx5g6z3bEF/iAJCmexNtpGFfCdnRcCKCPy/iNy+lZANkaTsprM/ScA5ipJR tD9b4zypydobVGKZy15fGy/bGRsMSw3SjJ57jS+Nnu9bONMCOlW6H/MWzepKxFJd XEdMRac45FN3QAYppw8TQdc5kBk5pjjlYpD21n+fLAAt+FgolMAnl+F9Y2PU5+8G 6ABMFUpcMb4wibCaFNlL7Id7oMRCrtYivN3FPyllGiLdthWzloXig7CIcnWc6u8a EWR2jcPcYkHjWBWq9M5ePmqQFuPXKdd1g6ItW8Y83bhFUTUpBc3zmBzdbkhYLU9n slrGD+ZaMzFCVcJZ9k7E8qF4qAsL0mnTxpt+07Rl3A7H3P8UTb7UlL8yVV3B9QrU 4RprKW6W0eb35XZbaXbJGaWgSmDJCSPbDpfQGr3WrBi0tWZiYIt6sQoD0VXB/d6q ed6ZhffiObtQb/KvJ/UVy/rnVr1DFsOXn2QfzkQ2GE6tnQ5luREGf92U+coK4HaU xC/YEJCt4cCM9j4kYi4yF9NSJ5TdmzRaRh30ECAztQoh+CmI9Yju10rsliz3qHk7 xSndmWkwwYOY9yJBAb+HZEgYs+TdZNq7MSHoSdsumg4RlDVN/Xk= =FfBQ -----END PGP SIGNATURE----- --=-=-=--