Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752094AbdHHLdL (ORCPT ); Tue, 8 Aug 2017 07:33:11 -0400 Received: from mx07-00252a01.pphosted.com ([62.209.51.214]:38288 "EHLO mx07-00252a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbdHHLdK (ORCPT ); Tue, 8 Aug 2017 07:33:10 -0400 X-Greylist: delayed 1647 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Aug 2017 07:33:09 EDT From: Phil Elwell To: Eric Anholt , Stefan Wahren , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Phil Elwell Subject: [PATCH] ARM: bcm2836: Send event when onlining other cores Date: Tue, 8 Aug 2017 12:04:55 +0100 Message-Id: <1502190295-53391-2-git-send-email-phil@raspberrypi.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502190295-53391-1-git-send-email-phil@raspberrypi.org> References: <1502190295-53391-1-git-send-email-phil@raspberrypi.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-08_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708080177 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1034 Lines: 30 Secondary cores should 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, and the "sev" instruction sends a wakeup event to the other cores. Add an "sev" (and a memory barrier) to bcm2836_boot_secondary, the function that wakes the waiting cores during booting. This is required if the secondary cores are sitting in "wfe", and harmless if not. Signed-off-by: Phil Elwell --- arch/arm/mach-bcm/platsmp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-bcm/platsmp.c b/arch/arm/mach-bcm/platsmp.c index 3fa1a99..7811160 100644 --- a/arch/arm/mach-bcm/platsmp.c +++ b/arch/arm/mach-bcm/platsmp.c @@ -312,6 +312,9 @@ static int bcm2836_boot_secondary(unsigned int cpu, struct task_struct *idle) writel(virt_to_phys(secondary_startup), intc_base + LOCAL_MAILBOX3_SET0 + 16 * cpu); + dsb(sy); + sev(); + iounmap(intc_base); return 0; -- 1.9.1