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: 30802 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D1D6A2066E for ; Fri, 23 May 2014 15:01:01 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf18576163pab.3 for ; Fri, 23 May 2014 08:01:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:subject:message-id :references:mime-version:in-reply-to:user-agent:cc:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-disposition :content-type:content-transfer-encoding; bh=6Z5KueTc4fiLrct3QRIscnT7kqdXIA4XXppOUVyRNlQ=; b=PCU0HN3AyclqqAFOJ1WPk+/ipWJC39PFJ4xyeTuonvB90r0Xw6xaDm/PjSBKvZzRYu I8ZaoFIqhQu8W3h4Z1aGU5m6CWVm01MKRjgWu3UKG6c9KW1xZNnWobJDwobXAruLthFd Q4VJN4ppbLcRFma509VNzh/tXIfoBnatO+VZR4ckWdeQiaLiXfUhumAIcTfq/5vLvdHq cI0vjSr/TZom+WHp12bqgLc89368EE7mMoY1XzAzh4e6KZ4dBB5COkB5Cl6ktbn45HRF 4msgtQrWHAliAMRppWTolofBheErQ+Bt0HBCH3kV79aaKZ/tbap9JFZjeh9ac29vQAA8 rKmw== X-Gm-Message-State: ALoCoQmD0cojdcbgu0LQgUJRFNA4xMGk5CQw83mbmEbonXz5pfm/EyqE6ymzzKzYNN4pBQIGKrRc X-Received: by 10.67.4.170 with SMTP id cf10mr2290157pad.31.1400857261010; Fri, 23 May 2014 08:01:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.145 with SMTP id o17ls1159277qga.37.gmail; Fri, 23 May 2014 08:01:00 -0700 (PDT) X-Received: by 10.220.249.198 with SMTP id ml6mr1930074vcb.36.1400857260872; Fri, 23 May 2014 08:01:00 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id rl9si1786071vec.18.2014.05.23.08.01.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:01:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id db12so6363749veb.39 for ; Fri, 23 May 2014 08:01:00 -0700 (PDT) X-Received: by 10.220.7.131 with SMTP id d3mr964881vcd.45.1400857260635; Fri, 23 May 2014 08:01:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp38468vcb; Fri, 23 May 2014 08:01:00 -0700 (PDT) X-Received: by 10.140.102.166 with SMTP id w35mr6861136qge.97.1400857259843; Fri, 23 May 2014 08:00:59 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id r2si3907573qas.17.2014.05.23.08.00.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 May 2014 08:00:59 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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-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 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 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Content-Disposition: inline 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)