From patchwork Fri May 4 06:00:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 134948 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp437425lji; Thu, 3 May 2018 23:01:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpFIIes69/kJpHR/OJPLebpEsptFGpgW72pGqakI+PgF8psNBrUZNa9fHRWHkrzfO5vQg3v X-Received: by 10.98.9.145 with SMTP id 17mr25823240pfj.34.1525413714564; Thu, 03 May 2018 23:01:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525413714; cv=none; d=google.com; s=arc-20160816; b=PS2MiDKwt4ldLRA1n94LKl6gboTkXqdY6DbE9KpKx0gZByJatY5UqjM7LJiCVLRZVo VBAwZyDumGg3LfA5BwLX9SlsoLUHcfsgoMxf2MCXw/T/8QWTnnz9r+3lVtQRfixFi40H UdkPHEXSDY9ecQ+Q8OKOD6ncgfshG1s76sdp6Uq5UXDoN7gHrK77XV7W6WEFaViMlqMh LpRhhAmXbKri9I1tTHnlLezEaylCMTo5yGPxERUbC3oP1av+nfyhvjSI8+VtISuP1qgZ gBdmfwwfaBGebzDchX+E1eVeACoapVXxUhB3HtedrfV1aJprQvuF/2n+sNFJ1zoA2xO9 1Xpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=nLeVeiKyGsEeMoTHvhs17H07m/H0FKm9ciRx+OxuJsM=; b=PKUIf/v4pq0vAopR11CRW8OdvdR00jDyk+VES4LIla/PcOZghx+k7pWg/Tr3kNwJQJ DeVV2tUCsuaF3/5YgVUEuKl7/VkzDZJnvYNZ4Cz/BrjLvBvm8Q83Xb5ozGbCIAMK9Ws3 418RzRNehxPvac6zRJUKX/aMiLzPD114Zl+Go/gCfDW+nb5xmdUquoVWy+YSsBD41Bq0 tJDRVSItjVakzt4ybtOM07A5dlXbYQSZCzMXrPv3BdsV2UzBlQV18g4PDSCgwk61I2ZU NnGCxXwRZZIrPKxBob0BvEA8WizI6sCii4gvTLQ096GIoXzhlma+COelZkLTdbr0iE1c VP6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=T3fB0vup; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2-v6si12958816pgm.360.2018.05.03.23.01.54; Thu, 03 May 2018 23:01:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=T3fB0vup; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751268AbeEDGBx (ORCPT + 2 others); Fri, 4 May 2018 02:01:53 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40474 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751777AbeEDGBd (ORCPT ); Fri, 4 May 2018 02:01:33 -0400 Received: by mail-wm0-f68.google.com with SMTP id j5-v6so2532364wme.5 for ; Thu, 03 May 2018 23:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Pd8vuiUTQlz4ADaoQal5KRfctP9hcRTl0q3Xn9YsCZY=; b=T3fB0vupdy9LPbqDgDaG2XnnNaJfDoTexx0UjqwRoYgG8ngXO84vwyPIrX7xj7+lLn cEsLUh67hZ83vFq/HGTBnRZXSJKGkNWkcrqfeuCqtm38Ua6hrFq43BqZU+SthWrzlHKe +zhTN2HyLypejpIGPvTnveVrm34h9DnEDCLfc= 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; bh=Pd8vuiUTQlz4ADaoQal5KRfctP9hcRTl0q3Xn9YsCZY=; b=fXLOGN9iEof5NealZEj2cXeQT8yE1mrJ3C6C4e2NS6KUH5z08iECGd235TOzzWeyyX ukj0IppyswEw4wUkFaslh6gSR0MR5Oyvfm1/2Biqs330PROcVWFi49XZSEr7tY4MjwWP OJOzLfUQcQo/22O5Epid11M+8aTK+Xn1/boYtqeEJfvuNTonXXzwW4Y7WgPDCHINhrF7 6mhmm4GD8vEN8CpFupEWvQYFRljhB7h29O7t5Bzg5QCN6vTMjsoh9UZK20S1ypmn3CqZ BIvf1uc6gc3nQqy+9+vR/3QRIvqpJxOf4jyVegP2nGCmutIZqu/R4bZxh+A0TZDdePLr mhWw== X-Gm-Message-State: ALQs6tAeWB5Wy23nPm9HQf6j95iWXAPvCxPd+canATclLniF4DS4VgLu kW0ILd80p5O0zTunyu90IgkfEfu1sQE= X-Received: by 10.28.21.195 with SMTP id 186mr18050834wmv.39.1525413692442; Thu, 03 May 2018 23:01:32 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:3995:5470:200:1aff:fe1b:b328]) by smtp.gmail.com with ESMTPSA id i30-v6sm32411863wra.38.2018.05.03.23.01.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 May 2018 23:01:31 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Shunyong Yang , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 16/17] efi/capsule-loader: Don't output reset log when reset flags are not set Date: Fri, 4 May 2018 08:00:02 +0200 Message-Id: <20180504060003.19618-17-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180504060003.19618-1-ard.biesheuvel@linaro.org> References: <20180504060003.19618-1-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Shunyong Yang When reset flags in capsule header are not set, it means firmware attempts to immediately process or launch the capsule. Moreover, reset is not needed in this case. The current code will output log to indicate reset. This patch adds a branch to avoid reset log output when the flags are not set. Cc: Joey Zheng Signed-off-by: Shunyong Yang [ardb: use braces in multi-line 'if', clarify comment and commit log] Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/capsule-loader.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c index e456f4602df1..96688986da56 100644 --- a/drivers/firmware/efi/capsule-loader.c +++ b/drivers/firmware/efi/capsule-loader.c @@ -134,10 +134,16 @@ static ssize_t efi_capsule_submit_update(struct capsule_info *cap_info) /* Indicate capsule binary uploading is done */ cap_info->index = NO_FURTHER_WRITE_ACTION; - pr_info("Successfully upload capsule file with reboot type '%s'\n", - !cap_info->reset_type ? "RESET_COLD" : - cap_info->reset_type == 1 ? "RESET_WARM" : - "RESET_SHUTDOWN"); + + if (cap_info->header.flags & EFI_CAPSULE_PERSIST_ACROSS_RESET) { + pr_info("Successfully uploaded capsule file with reboot type '%s'\n", + !cap_info->reset_type ? "RESET_COLD" : + cap_info->reset_type == 1 ? "RESET_WARM" : + "RESET_SHUTDOWN"); + } else { + pr_info("Successfully processed capsule file\n"); + } + return 0; }