From patchwork Fri May 23 15:03:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 4233241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8FAAD9F32B for ; Fri, 23 May 2014 15:01:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A2AF203A9 for ; Fri, 23 May 2014 15:01:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A6D142022A for ; Fri, 23 May 2014 15:01:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WnqwO-00041p-4j; Fri, 23 May 2014 14:59:24 +0000 Received: from mail-we0-f172.google.com ([74.125.82.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WnqwL-0003xw-7V for linux-arm-kernel@lists.infradead.org; Fri, 23 May 2014 14:59:22 +0000 Received: by mail-we0-f172.google.com with SMTP id k48so5062944wev.17 for ; Fri, 23 May 2014 07:58:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=G2h0DV0X0SHQk7CFOQNZr+GHcHSSAwEB7HO/O+rK6hU=; b=bJRX480arR0A9dUNVgSPElBrHc5yV/JhtSxdn5VFNz8p+AAdJWo4CEa9HIZ6oLRLoK gem/L0e8+r0DncrjlFP/qG1p2swysah+38Onh153UzKr2SUyoQzwwBHCK8tw0boQ9scS mlRZvjyXPFScEhumSLKVQ1lusOxFpwLdbohzKLqkrtHKwHOtUOFJ0149AE+G28Xs8kNc I42BwqmSR0DXSD26xA9WBFHBTuK7xpRcXSoV3wNrbuKJs2eE1fgGL25sKhdlMP/nTR+a 3Tio+WMVs8fkgffJSZsLjZzAbmc7WH8sl5NcDmEruTXKBlIcUScqEOzsWFYDIWoK/BY/ RyrA== X-Gm-Message-State: ALoCoQkQFhDDRX6SHRZ0mmacJufUGjAsAhS3DxEOLm8Nk4eN7S8w4YsxiBooDbGTlpmXVHF8QIOr X-Received: by 10.194.220.42 with SMTP id pt10mr3637279wjc.60.1400857138957; Fri, 23 May 2014 07:58:58 -0700 (PDT) Received: from bivouac.eciton.net ([2a00:1098:0:86:1000:23:0:2]) by mx.google.com with ESMTPSA id en6sm3344716wib.11.2014.05.23.07.58.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 23 May 2014 07:58:57 -0700 (PDT) Date: Fri, 23 May 2014 16:03:31 +0100 From: Leif Lindholm To: Catalin Marinas Subject: Re: EFI_STUB fails to boot non-EFI on arm64 Message-ID: <20140523150331.GS4179@bivouac.eciton.net> References: <20140523094513.GC9252@arm.com> <20140523131656.GR4179@bivouac.eciton.net> <20140523134720.GA9256@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140523134720.GA9256@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140523_075921_421891_C97C3853 X-CRM114-Status: GOOD ( 23.35 ) X-Spam-Score: -0.7 (/) Cc: Roy Franz , linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mark Salter X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, May 23, 2014 at 02:47:20PM +0100, Catalin Marinas wrote: > That's a first (possibly temporary) step and I think it's fine: > > Acked-by: Catalin Marinas > > But we need some further tweaking to the way we call efi_init(). > Currently it doesn't matter whether Linux booted as an EFI application > or not and efi_init() is always called, causing some pr_err() in > fdt_find_uefi_params(). It's not really an error as we support the same > image booting non-EFI as well. OK. > Can we add another of detecting whether it's an EFI application and > avoid calling efi_init()? I can see x86 sets some efi_loader_signature > string in exit_boot() and checks against it later when calling > efi_init(). Well, I agree that we shouldn't be spewing error messages for expected operation, but efi_init() is the function we call to determine whether we _are_ booting via UEFI - and it sets flags accordingly for the efi_enabled() macro. My view is that this should be fixed in fdt_find_uefi_params(). A single info message that we can't find evidence of UEFI should be printed in the non-error case. Like below? / Leif From 67283e60923c14c024460b4512c49563a92acce7 Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Fri, 23 May 2014 15:50:51 +0100 Subject: [PATCH] efi: fdt: Drop error messages for non-error case Change fdt_find_uefi_params() to only write error messages if actual error encountered, rather than if no UEFI information is encountered. For the non-error case, print a single info message. Signed-off-by: Leif Lindholm --- drivers/firmware/efi/efi.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index cd36deb..4bb42e1e 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -366,11 +366,8 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname, for (i = 0; i < ARRAY_SIZE(dt_params); i++) { prop = of_get_flat_dt_prop(node, dt_params[i].propname, &len); - if (!prop) { - pr_err("Can't find %s in device tree!\n", - dt_params[i].name); - return 0; - } + if (!prop) + goto fail; dest = info->params + dt_params[i].offset; val = of_read_number(prop, len / sizeof(u32)); @@ -385,6 +382,14 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname, dt_params[i].size * 2, val); } return 1; + + fail: + if (i == 0) + pr_info(" UEFI not found.\n"); + else + pr_err("Can't find %s in device tree!\n", dt_params[i].name); + + return 0; } int __init efi_get_fdt_params(struct efi_fdt_params *params, int verbose)