From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F151C11F64 for ; Thu, 1 Jul 2021 08:27:59 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBA6F61468 for ; Thu, 1 Jul 2021 08:27:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBA6F61468 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 348F78325E; Thu, 1 Jul 2021 10:27:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="SSDM+kcg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 278758326B; Thu, 1 Jul 2021 10:27:55 +0200 (CEST) Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0609283251 for ; Thu, 1 Jul 2021 10:27:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pj1-x1034.google.com with SMTP id p17-20020a17090b0111b02901723ab8d11fso3482338pjz.1 for ; Thu, 01 Jul 2021 01:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=iUFBHm6B2AmlH7TjAFlsnTTaVp0mavcfZF1njmQoZkU=; b=SSDM+kcgyg5g9uhju+Q3qUMiFuPM2tKE2EUdEz7dDSwX0d0+ItR+kEFXVMhT40n6HO 9dH0ZUbTT+EiXzJ3P7FH9PFVqwEdmKVG1cChcWOZzP1TURgAquCHHUYdeX6DLpMgiWYB P8N6HnDjW8UynwqSKqOnQBfnCYQTQZhlIbkHik9dEwVR6ZzJljAzutGq6jiC6Tcu8udb +BBj3dtA4N1Hf+DpppJSMiT1y/mc9U/p6MnSdUUV+aXNU+OVszEVIGYTbnkkIJ5Q04CA ZoKYD+8P0Z+5SulPJTteH7+nV39YyWXtLeG4YlgFD/rLmmdkBG0GqPfgAhKhn/NxRRiw bP4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=iUFBHm6B2AmlH7TjAFlsnTTaVp0mavcfZF1njmQoZkU=; b=Q8ZKpPaLVysM4LwqTBMnsLuWSuT7gFNlCF2CPAI/+umD/9Y9eGV/cxLN04NGWKMPai sNy8A7D8HV8JWffIn/T5bOKjXqDIbY3UCHiCwBQlFnqQpboztuMdo02mOKlxLKrZkwkz iAONOXt1z5gjHi5/6lLfL8iWpYc4hblyWdOIJAfwrMAsp5w+dyR9tdIZy4qlgtMhx2KT 2aIVVBCX7Iyv4f7+hRW6kcY0KG02bjqkiUiPV3h8FS6iijetH5tPvFwMghA0oMp0OPnN JcDxlIdRyL+m5J1VrDABWKHyS5Ia/HVRB3Wtl/AAKYEQ6yzifEXmZ7aE9PqdTMY6i7+u y5vQ== X-Gm-Message-State: AOAM532U1TOUhDncJv6fafHmpDcJO3bOQatCT5rXFC5jRrsyt9/YqV9V P/UkZs54qhfWkAA2/nsAAeO9ug== X-Google-Smtp-Source: ABdhPJyyt2J+1sH0S17pCVocW0h2z+xFpeCblwpEcxwS8SrEPWbFAiVHPCaTebAL1pQyXn2elANgeA== X-Received: by 2002:a17:90a:a611:: with SMTP id c17mr8619739pjq.184.1625128070040; Thu, 01 Jul 2021 01:27:50 -0700 (PDT) Received: from laputa (p3dd30534.tkyea130.ap.so-net.ne.jp. [61.211.5.52]) by smtp.gmail.com with ESMTPSA id y8sm25692444pfe.162.2021.07.01.01.27.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 01:27:49 -0700 (PDT) Date: Thu, 1 Jul 2021 17:27:46 +0900 From: AKASHI Takahiro To: Heinrich Schuchardt Cc: u-boot@lists.denx.de, Alexander Graf , Ilias Apalodimas Subject: Re: [PATCH v3 1/2] efi_loader: fix set_capsule_result() Message-ID: <20210701082746.GA46337@laputa> Mail-Followup-To: AKASHI Takahiro , Heinrich Schuchardt , u-boot@lists.denx.de, Alexander Graf , Ilias Apalodimas References: <20210701082049.68150-1-xypron.glpk@gmx.de> <20210701082049.68150-2-xypron.glpk@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210701082049.68150-2-xypron.glpk@gmx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean NAK again with the same reason that I gave on v1/v2. Please follow your own rules that you imposed on me. -Takahiro Akashi On Thu, Jul 01, 2021 at 10:20:48AM +0200, Heinrich Schuchardt wrote: > The log category must be LOG_CATEGORY LOGC_EFI. > > efi_set_variable() should be called with EFI_CALL(). Use > efi_set_variable_int() instead. > > A log text "Updating ..." if SetVariable() fails does not make sense for a > variable that is not required to be preexisting. > > Signed-off-by: Heinrich Schuchardt > --- > v3: > no change > --- > lib/efi_loader/efi_capsule.c | 39 +++++++++++++++++++----------------- > 1 file changed, 21 insertions(+), 18 deletions(-) > > diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c > index 2c37a0d97b..f87ef2a514 100644 > --- a/lib/efi_loader/efi_capsule.c > +++ b/lib/efi_loader/efi_capsule.c > @@ -6,6 +6,8 @@ > * Author: AKASHI Takahiro > */ > > +#define LOG_CATEGORY LOGC_EFI > + > #include > #include > #include > @@ -95,13 +97,25 @@ void set_capsule_result(int index, struct efi_capsule_header *capsule, > else > memset(&result.capsule_processed, 0, sizeof(time)); > result.capsule_status = return_status; > - ret = efi_set_variable(variable_name16, &efi_guid_capsule_report, > - EFI_VARIABLE_NON_VOLATILE | > - EFI_VARIABLE_BOOTSERVICE_ACCESS | > - EFI_VARIABLE_RUNTIME_ACCESS, > - sizeof(result), &result); > - if (ret) > - log_err("EFI: creating %ls failed\n", variable_name16); > + ret = efi_set_variable_int(variable_name16, &efi_guid_capsule_report, > + EFI_VARIABLE_NON_VOLATILE | > + EFI_VARIABLE_BOOTSERVICE_ACCESS | > + EFI_VARIABLE_RUNTIME_ACCESS, > + sizeof(result), &result, false); > + if (ret != EFI_SUCCESS) { > + log_err("Setting %ls failed\n", variable_name16); > + return; > + } > + > + /* Variable CapsuleLast must not include terminating 0x0000 */ > + ret = efi_set_variable_int(L"CapsuleLast", &efi_guid_capsule_report, > + EFI_VARIABLE_READ_ONLY | > + EFI_VARIABLE_NON_VOLATILE | > + EFI_VARIABLE_BOOTSERVICE_ACCESS | > + EFI_VARIABLE_RUNTIME_ACCESS, > + 22, variable_name16, false); > + if (ret != EFI_SUCCESS) > + log_err("Setting %ls failed\n", L"CapsuleLast"); > } > > #ifdef CONFIG_EFI_CAPSULE_FIRMWARE_MANAGEMENT > @@ -988,7 +1002,6 @@ efi_status_t efi_launch_capsules(void) > struct efi_capsule_header *capsule = NULL; > u16 **files; > unsigned int nfiles, index, i; > - u16 variable_name16[12]; > efi_status_t ret; > > if (!check_run_capsules()) > @@ -1045,16 +1058,6 @@ efi_status_t efi_launch_capsules(void) > free(files[i]); > free(files); > > - /* CapsuleLast */ > - efi_create_indexed_name(variable_name16, sizeof(variable_name16), > - "Capsule", index - 1); > - efi_set_variable_int(L"CapsuleLast", &efi_guid_capsule_report, > - EFI_VARIABLE_READ_ONLY | > - EFI_VARIABLE_NON_VOLATILE | > - EFI_VARIABLE_BOOTSERVICE_ACCESS | > - EFI_VARIABLE_RUNTIME_ACCESS, > - 22, variable_name16, false); > - > return ret; > } > #endif /* CONFIG_EFI_CAPSULE_ON_DISK */ > -- > 2.30.2 >