From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 568AEC54EAA for ; Mon, 30 Jan 2023 10:03:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3758E81F59; Mon, 30 Jan 2023 11:03:18 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kicherer.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=kicherer.org header.i=@kicherer.org header.b="c0FzYvWg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9219E8340F; Mon, 30 Jan 2023 11:03:15 +0100 (CET) Received: from mail.zeus06.de (www.zeus06.de [194.117.254.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 08ECD81930 for ; Mon, 30 Jan 2023 11:03:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kicherer.org Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=dev@kicherer.org DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=kicherer.org; h=from:to :cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=LW/YvC1I42irUvxXIstO3jskuP3 pX5PNQzXWKLaX2lo=; b=c0FzYvWgGErIim6V7vx222jeorPYdDhmmPmQk+l3xST efE2iJwNTmI78Hvd/UV52C3Tz+NDqkAlIIrhTD0sTEL+qpCaYo36MX7+yFEhdCHp l4+98xvOTVeDlbMKBa/bh4cc9D3GyCgXgpccBk8GsP8ro2kmY+whGyaTUedPFHBk = Received: (qmail 1582241 invoked from network); 30 Jan 2023 11:03:12 +0100 Received: by mail.zeus06.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 30 Jan 2023 11:03:12 +0100 X-UD-Smtp-Session: l3s6476p2@zwuMUnjzgYXCtAHJ From: Mario Kicherer To: u-boot@lists.denx.de Cc: Mario Kicherer Subject: [PATCH] spl: spl_nor: use panic instead of hang if booting fails Date: Mon, 30 Jan 2023 11:03:03 +0100 Message-Id: <20230130100303.258229-1-dev@kicherer.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On systems without a watchdog, using hang() prevents a system to recover from an error. For example, a board could implement a boot counter to switch to an alternative load address after some failed tries. Signed-off-by: Mario Kicherer --- common/spl/spl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 2855cdd117..d1aa2fb8a9 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -822,11 +822,10 @@ void board_init_r(gd_t *dummy1, ulong dummy2) if (ret) { if (CONFIG_IS_ENABLED(SHOW_ERRORS) && CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)) - printf(SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n", - ret); + panic(SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n", + ret); else - puts(SPL_TPL_PROMPT "failed to boot from all boot devices\n"); - hang(); + panic_str(SPL_TPL_PROMPT "failed to boot from all boot devices\n"); } spl_perform_fixups(&spl_image); -- 2.34.1