From patchwork Sun Mar 17 18:28:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Auer X-Patchwork-Id: 1057558 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aisec.fraunhofer.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44MnzX1mTfz9s5c for ; Mon, 18 Mar 2019 05:34:48 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id D04C3C21DE8; Sun, 17 Mar 2019 18:32:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 51537C21EE0; Sun, 17 Mar 2019 18:29:39 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DD87BC21E45; Sun, 17 Mar 2019 18:29:25 +0000 (UTC) Received: from mail-edgeKA24.fraunhofer.de (mail-edgeka24.fraunhofer.de [153.96.1.24]) by lists.denx.de (Postfix) with ESMTPS id C52A0C21E0F for ; Sun, 17 Mar 2019 18:29:19 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2EVAAB0kY5c/xwBYJljGgEBAQEBAgEBAQEHAgEBAQGBVAIBAQEBCwGCEIISjQaKQpw5DYRsAoRRIjcGDQEBAwEBCQEDAgICaSiFTAYyAUYQUT0aBg4FgyKBdQGqYIolCQGBJQGGaIRHgVc/g26Ef4EEhRQDih2CEYY9kWoHAoEmgSEEkE4MGYsLiEyeKoFdI4FWMxokgzuQTD4BMgGMYYJNAQE X-IPAS-Result: A2EVAAB0kY5c/xwBYJljGgEBAQEBAgEBAQEHAgEBAQGBVAIBAQEBCwGCEIISjQaKQpw5DYRsAoRRIjcGDQEBAwEBCQEDAgICaSiFTAYyAUYQUT0aBg4FgyKBdQGqYIolCQGBJQGGaIRHgVc/g26Ef4EEhRQDih2CEYY9kWoHAoEmgSEEkE4MGYsLiEyeKoFdI4FWMxokgzuQTD4BMgGMYYJNAQE X-IronPort-AV: E=Sophos;i="5.58,490,1544482800"; d="scan'208";a="13835745" Received: from mail-mtaka28.fraunhofer.de ([153.96.1.28]) by mail-edgeKA24.fraunhofer.de with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Mar 2019 19:29:19 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ATAACWkY5cfRBhWMBjGgEBAQEBAgEBAQEHAgEBAQGBVAIBAQEBCwGDSCE5jQamew2EbAKEcjcGDQEBAwEBCQEDAhQBARY6L4VLAwMyAUYQUT0aBg4FgyKBdqpgiiUJAYElAYZohh4/g26Ef4EEhRQDih2CEYY9kWoHAoEmgSEEkE4MGYsLiEyeKoFdIYFXMxokgzuQTD4DMAGMYYJNAQE X-IronPort-AV: E=Sophos;i="5.58,490,1544482800"; d="scan'208";a="19588564" Received: from fgdemucivp01ltm.xch.fraunhofer.de (HELO FGDEMUCIMP11EXC.ads.fraunhofer.de) ([192.88.97.16]) by mail-mtaKA28.fraunhofer.de with ESMTP/TLS/AES256-SHA; 17 Mar 2019 19:29:20 +0100 Received: from localhost.de (10.80.233.50) by FGDEMUCIMP11EXC.ads.fraunhofer.de (10.80.232.42) with Microsoft SMTP Server (TLS) id 14.3.435.0; Sun, 17 Mar 2019 19:29:18 +0100 From: Lukas Auer To: Date: Sun, 17 Mar 2019 19:28:40 +0100 Message-ID: <20190317182842.18108-10-lukas.auer@aisec.fraunhofer.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190317182842.18108-1-lukas.auer@aisec.fraunhofer.de> References: <20190317182842.18108-1-lukas.auer@aisec.fraunhofer.de> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-11.0.0.4179-8.200.1013-24494.006 X-TM-AS-Result: No--3.040600-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Cc: Andreas Schwab , Palmer Dabbelt Subject: [U-Boot] [PATCH v3 09/11] riscv: hang if relocation of secondary harts fails X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Print an error message and hang if smp_call_function() returns an error, indicating that relocation of the secondary harts has failed. Signed-off-by: Lukas Auer Reviewed-by: Bin Meng Tested-by: Bin Meng Reviewed-by: Anup Patel --- Changes in v3: - New patch to hang if relocation of secondary harts fails Changes in v2: None arch/riscv/cpu/start.S | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S index 5ac899b141..a4433fbd6b 100644 --- a/arch/riscv/cpu/start.S +++ b/arch/riscv/cpu/start.S @@ -33,6 +33,10 @@ #define SYM_SIZE 0x18 #endif +.section .data +secondary_harts_relocation_error: + .ascii "Relocation of secondary harts has failed, error %d\n" + .section .text .globl _start _start: @@ -274,8 +278,15 @@ relocate_secondary_harts: mv a2, s3 jal smp_call_function + /* hang if relocation of secondary harts has failed */ + beqz a0, 1f + mv a1, a0 + la a0, secondary_harts_relocation_error + jal printf + jal hang + /* restore relocation offset */ - mv t6, s5 +1: mv t6, s5 #endif /*