From patchwork Tue Jul 8 15:54:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 33240 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5F39D2070A for ; Tue, 8 Jul 2014 15:56:22 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id il7sf20689566vcb.0 for ; Tue, 08 Jul 2014 08:56:22 -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:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=h0xhTIhY1BnlEDODR3vTxmTIVfvOYo/X4r5a+6ShcK4=; b=DMzQmvZzDG2pDp8lEXcGquiJgkqfXXKdKPkN6qrYEUGjjBXp0/e/HwNzocIN9/Q96P TGfnexNWdZ0BfZjrVhlIAEZFxo+SRNnAYtN45OHnpXMArpytdkC6YkBf4eCw3guHh0LC LyqMlTiHfCcj2Kbe1Ms3YO35kqCQQ7vdLbEgK9+lt560ArJ7TZRtbXCmP3a2wnYt4UmD twYuf9wS0EeN2uEIUKzF9W7ihXs6Po4EN0IbR9gg9fI68LoZ2WGIWr1yX89N4yXYOZVX S9lY9Pk1kh3gttJdtrwTa3JBOLVoiPerhJ+n+wgCsD7pjqv1QxvO7SQi7q9YTX1NSDXd j+6Q== X-Gm-Message-State: ALoCoQkWe+qJXIBBbaCZFRs7OZ/LcyZMDokqsE1jMmOIvPbVF8g7gMP8NFXovElasfoiV+W7Tbx8 X-Received: by 10.236.203.169 with SMTP id f29mr9503100yho.24.1404834982154; Tue, 08 Jul 2014 08:56:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.53 with SMTP id q50ls2358565qgd.2.gmail; Tue, 08 Jul 2014 08:56:22 -0700 (PDT) X-Received: by 10.58.149.170 with SMTP id ub10mr22412866veb.0.1404834982033; Tue, 08 Jul 2014 08:56:22 -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 6si20330991vct.68.2014.07.08.08.56.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Jul 2014 08:56:22 -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 jw12so5759070veb.25 for ; Tue, 08 Jul 2014 08:56:22 -0700 (PDT) X-Received: by 10.53.1.231 with SMTP id bj7mr1130700vdd.49.1404834981962; Tue, 08 Jul 2014 08:56:21 -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.221.37.5 with SMTP id tc5csp782076vcb; Tue, 8 Jul 2014 08:56:21 -0700 (PDT) X-Received: by 10.66.152.17 with SMTP id uu17mr22291145pab.13.1404834981128; Tue, 08 Jul 2014 08:56:21 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id qp5si6216902pdb.196.2014.07.08.08.56.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jul 2014 08:56:21 -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 1X4XjV-0007f5-0y; Tue, 08 Jul 2014 15:55:05 +0000 Received: from fw-tnat.austin.arm.com ([217.140.110.23] helo=collaborate-mta1.arm.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X4XjS-00075V-Az for linux-arm-kernel@lists.infradead.org; Tue, 08 Jul 2014 15:55:02 +0000 Received: from e102109-lin.cambridge.arm.com (e102109-lin.cambridge.arm.com [10.1.203.182]) by collaborate-mta1.arm.com (Postfix) with ESMTP id 50F3D13F94E; Tue, 8 Jul 2014 10:54:28 -0500 (CDT) From: Catalin Marinas To: Matt Fleming Subject: [PATCH] efi: fdt: Do not report an error during boot if UEFI is not available Date: Tue, 8 Jul 2014 16:54:18 +0100 Message-Id: <1404834858-10706-1-git-send-email-catalin.marinas@arm.com> X-Mailer: git-send-email 1.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140708_085502_430170_DDD70CAB X-CRM114-Status: GOOD ( 15.17 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: linux-efi@vger.kernel.org, Leif Lindholm , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 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: catalin.marinas@arm.com 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 Currently, fdt_find_uefi_params() reports an error if no EFI parameters are found in the DT. This is however a valid case for non-UEFI kernel booting. This patch checks changes the error reporting to a pr_info("UEFI not found") when no EFI parameters are found in the DT. Signed-off-by: Catalin Marinas Acked-by: Leif Lindholm Tested-by: Leif Lindholm --- drivers/firmware/efi/efi.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index eff1a2f22f09..dc79346689e6 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -346,6 +346,7 @@ static __initdata struct { struct param_info { int verbose; + int found; void *params; }; @@ -362,16 +363,12 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname, (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0)) return 0; - pr_info("Getting parameters from FDT:\n"); - 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); + if (!prop) return 0; - } dest = info->params + dt_params[i].offset; + info->found++; val = of_read_number(prop, len / sizeof(u32)); @@ -390,10 +387,21 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname, int __init efi_get_fdt_params(struct efi_fdt_params *params, int verbose) { struct param_info info; + int ret; + + pr_info("Getting EFI parameters from FDT:\n"); info.verbose = verbose; + info.found = 0; info.params = params; - return of_scan_flat_dt(fdt_find_uefi_params, &info); + ret = of_scan_flat_dt(fdt_find_uefi_params, &info); + if (!info.found) + pr_info("UEFI not found.\n"); + else if (!ret) + pr_err("Can't find '%s' in device tree!\n", + dt_params[info.found].name); + + return ret; } #endif /* CONFIG_EFI_PARAMS_FROM_FDT */