From patchwork Sun Mar 31 02:08:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniu Rosca X-Patchwork-Id: 1071587 X-Patchwork-Delegate: sjg@chromium.org 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UHnacoMS"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44XCgj3HDZz9sQt for ; Sun, 31 Mar 2019 22:20:17 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 1BC65C21E12; Sun, 31 Mar 2019 11:19:18 +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=0.0 required=5.0 tests=FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID 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 CCD75C21D83; Sun, 31 Mar 2019 11:19:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B6F93C21C2C; Sun, 31 Mar 2019 02:09:38 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by lists.denx.de (Postfix) with ESMTPS id AC540C21C27 for ; Sun, 31 Mar 2019 02:09:37 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id t17so7256469wrw.13 for ; Sat, 30 Mar 2019 19:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=afPIqgh7pKdtp/qaGkm5xPJpXhKLdf8hsF7TB3JA0as=; b=UHnacoMSq+12n8rfifNpJ+Rvfpp0s6duP0dP21Vbllq9LzXatSVUfmhEO1FRZJoNhH C0aK7Mf4vOslx6akus9/Am1Gq1PHtwxcEjXL/a9cElKZKn5c+igPRAhu+UXieq7v/nq4 nmzKkA7RGkONT9LdvZel6CL2BkDm51vXZvgNj9cHaG63YbKY3EfZa+aGPmfqAc1+HQLH mGcUJW/ZVKM3YjgEHaAnnDMty5V/jTma9/g7sNKZgrp/PMRqDRg9g1X4rwE5HTOHsjMf kBKXB/wIMWzMT1DNowlgoZFfNVQ/OETTR8L79bWmFY2GhKvuwSJOf1J6UvQsHuWn2+qw AbYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=afPIqgh7pKdtp/qaGkm5xPJpXhKLdf8hsF7TB3JA0as=; b=eQc+7Q5v4WLKe/DpgHD3PoKDCe8EJ68f07x+m3bl4FuH/WvClq+ZIo9UBsoRDfzCpi 0+7OmQM/9ytjubLAOUCywHjuQVu6lGGLNLqInYfmZoFXoJG+pVX74nZDzUfgmpgzOfDN /tkkQXveRnSwOyhkkLmz3xCvoqWJOtT859/q7f5HRBUBtpSuiqwARXwmy+Og2yitAQ87 zF6Yg9HQGFZbO+fjuCv34M6n9kS1K5vviEVzoBZU2RF1Wi8gv6JG7kFhIxoZ1WF7Wp15 BwTI13VS5KiCTv/+9oJ8nrPAcavdY5Yrd9maiVG5Z4WjrigwIA9bhrXebVL1+ZLIEzkC UwIw== X-Gm-Message-State: APjAAAXQNSPXypP4f9kIWwG3vG3Nhz2u14+rTFk83aDRx4n/qGSyv3jg Y4lLNgGwgv6lZsOQybJvPfs= X-Google-Smtp-Source: APXvYqz4It+1IXiMxSe01L/CpxiO7/KI5QZol7Hd8X7D1AL/ySFtK7pziCoVWx0h/MNGUn9OvXVWuQ== X-Received: by 2002:a5d:424b:: with SMTP id s11mr3149654wrr.158.1553998177353; Sat, 30 Mar 2019 19:09:37 -0700 (PDT) Received: from localhost.localdomain (ipb218f541.dynamic.kabel-deutschland.de. [178.24.245.65]) by smtp.gmail.com with ESMTPSA id e193sm10228733wmg.18.2019.03.30.19.09.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Mar 2019 19:09:36 -0700 (PDT) From: Eugeniu Rosca X-Google-Original-From: Eugeniu Rosca To: Simon Glass , Tom Rini , Masahiro Yamada , Stefan Roese , Sam Protsenko , Simon Goldschmidt , Marek Vasut , George McCollister , Alexey Brodkin , Alexander Graf , York Sun , Tuomas Tynkkynen , Thomas Petazzoni , Shawn Guo , Paul Kocialkowski , Pantelis Antoniou , Michal Simek , Max Krummenacher , Marcel Ziswiler , Joe Hershberger , Joakim Tjernlund , Heiko Schocher , Hannes Schmelzer , Hannes Schmelzer , Daniel Schwierzeck , Bin Meng , u-boot@lists.denx.de Date: Sun, 31 Mar 2019 04:08:34 +0200 Message-Id: <20190331020838.26683-2-erosca@de.adit-jv.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190331020838.26683-1-erosca@de.adit-jv.com> References: <20190331020838.26683-1-erosca@de.adit-jv.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 31 Mar 2019 11:19:00 +0000 Cc: Eugeniu Rosca , Eugeniu Rosca Subject: [U-Boot] [PATCH 2/6] fdt: boot_get_fdt: really boot w/o FDT when "goto no_fdt" 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" The 'no_fdt' goto label was introduced by v2015.01 commit [0] and it had two review stages [1-2]. The *documented* purpose behind commit [0] is (excerpt from commit description): > allows both FDT and non-FDT kernels to boot by making the > third parameter to the bootm/bootz optional While [1] and [2] share the same goal, they have very different implementations: - [1] was based on a very simple 'argc' check at function error out with returning success to the caller if the third parameter was NOT passed to bootm/bootz command. This approach had the downside of returning success to the caller even in case of legitimate internal errors, which should halt booting. - [2] added the "no_fdt" label and several "goto no_fdt" statements. This allowed to report the legitimate internal errors to the caller. IOW the major difference between [1] and [2] is: - [1] boot w/o FDT if FDT address is not passed to boot{m,z,*} - [2] give *freedom* to the developer to boot w/o FDT from any (more or less) arbitrary point in the function flow (and here comes the peculiar aspect, which looks to be a leftover from [1]) with the precondition that the 3rd argument (FDT address) is NOT provided to boot{m,z,*}. In practice, this means that only a subset of "goto no_fdt" end up booting w/o FDT while the other subset is returning an error to the caller. This patch removes the peculiar behavior described above, such that "goto no_fdt" performs really what it tells to the developer. The motivation of this patch is to decrease the unneeded complexity and increase the readability of boot_get_fdt(). [0] 48aead71c1ad ("fdt: Allow non-FDT kernels to boot when CONFIG_OF_LIBFDT is defined") [1] https://patchwork.ozlabs.org/patch/412923/ ("[U-Boot,v1] fdt: Allow non-FDT kernels to boot when CONFIG_OF_LIBFDT is defined") [2] https://patchwork.ozlabs.org/patch/415635/ ("[U-Boot,v2] fdt: Allow non-FDT kernels to boot when CONFIG_OF_LIBFDT is defined") Signed-off-by: Eugeniu Rosca --- common/image-fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/image-fdt.c b/common/image-fdt.c index 1817ce6bce30..c335e7e2f220 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -489,7 +489,7 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, no_fdt: ok_no_fdt = 1; error: - if (!select && ok_no_fdt) { + if (ok_no_fdt) { debug("Continuing to boot without FDT\n"); return 0; }