Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B2C7FC433F5 for ; Wed, 16 Feb 2022 06:16:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 99B5183A5A; Wed, 16 Feb 2022 07:15:58 +0100 (CET) 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="oLO+zBg4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7F7F183A41; Wed, 16 Feb 2022 07:15:54 +0100 (CET) Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (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 904E2839EB for ; Wed, 16 Feb 2022 07:15:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pl1-x62e.google.com with SMTP id u12so1201640plf.13 for ; Tue, 15 Feb 2022 22:15:48 -0800 (PST) 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 :user-agent:mime-version:content-transfer-encoding; bh=XU/XvCB5GBh7rbgCYtx1g1/zzRC3wTTXfCCp8nOMpvY=; b=oLO+zBg4knlJ3UhFeFyHVGR4eDqJJdjjpR1qqzyB5am0CYSF5WbrOAhRAlnKxteLIq oB/vbVBGVNogMcsm8CLyco6ansbUJA/GFEpvs6QNqemqPQQSjmeqeKOBVTfoU3gum5// h1BIq7zEArdfuzAWB3ll0+LjgXQCCtZOgzsJgaDxyKY+9GHZHHMRonMs1/rm+bTgtxEH W37c4q6abocOnUQPYszuvIZR6jcvJOUjgBtYE45k2lJIS/k/R2gArT8RnjrJlHW3ix4W uigYUt0CrZePOJ+gGUuWmiE1TB/eqFIGyEc2xp80viStbVPAjjibqhq3SMzXqtF3XMEN NEAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=XU/XvCB5GBh7rbgCYtx1g1/zzRC3wTTXfCCp8nOMpvY=; b=pxGKITqA5L+WnJ2SyNLexDaVQQy7EEvftusljQwODnKLKzkSgciWQ+Q0rrEmmGdaXj aubHCjTaBqKi4/1XAPH8G0Av59S7MGWsO4EUHQPW3Q7hLap29bD/2jqD9MwiTkp/VBGN mGDJYRTodeQSB1pBih14LAgdXr0MKo5Agj3YO/qW41xW34BocJwqHLjuMmAdN8lgf66E EyXipC6ozaqqLpw+MB6gXBGsNFkgp/lSkguNDgWTj+1SzFLIedoEetNKf4d+IMr4lHL8 zBf4tbLGqPHDxWeXrCa4CcMrp4ElEvrbqoJ251vzXzagnlc7ODHczIfmlTYY43Ra9FQz WG0g== X-Gm-Message-State: AOAM5323M0kHTHU1+dcf6hGRMEIFW9cd8xkY04pR/X02C6NnBwt42gEY sVaVC3EO9miEzoIo9lY9DQSx79HHZMXalw== X-Google-Smtp-Source: ABdhPJwCcxtfzQ3ekpubmrv4pGYwPa4A4uE9VESY1tpCU1WigRcv2wf58XIZi9Kr1Cw2H+AtoJy2bw== X-Received: by 2002:a17:902:e8c2:b0:14d:80cb:dbc with SMTP id v2-20020a170902e8c200b0014d80cb0dbcmr1092043plg.142.1644992146638; Tue, 15 Feb 2022 22:15:46 -0800 (PST) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id a9sm1644421pfl.124.2022.02.15.22.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 22:15:46 -0800 (PST) From: Masami Hiramatsu To: u-boot@lists.denx.de Cc: Masami Hiramatsu , Patrick Delaunay , Patrice Chotard , Heinrich Schuchardt , Alexander Graf , AKASHI Takahiro , Simon Glass , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Tom Rini , Etienne Carriere , Sughosh Ganu , Paul Liu Subject: [PATCH v5 1/4] efi_loader: use efi_update_capsule_firmware() for capsule on disk Date: Wed, 16 Feb 2022 15:15:42 +0900 Message-Id: <164499214202.688621.9498927693969899089.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164499213192.688621.17382243642029677399.stgit@localhost> References: <164499213192.688621.17382243642029677399.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean Since the efi_update_capsule() represents the UpdateCapsule() runtime service, it has to handle the capsule flags and update ESRT. However the capsule-on-disk doesn't need to care about such things. Thus, the capsule-on-disk should use the efi_capsule_update_firmware() directly instead of calling efi_update_capsule(). This means the roles of the efi_update_capsule() and capsule-on-disk are different. We have to keep the efi_update_capsule() for providing runtime service API at boot time. Suggested-by: AKASHI Takahiro Signed-off-by: Masami Hiramatsu Reviewed-by: Heinrich Schuchardt --- Changes in v4: - Update patch description. --- lib/efi_loader/efi_capsule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index f4519c7317..d8141176df 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -1118,7 +1118,7 @@ efi_status_t efi_launch_capsules(void) index = 0; ret = efi_capsule_read_file(files[i], &capsule); if (ret == EFI_SUCCESS) { - ret = EFI_CALL(efi_update_capsule(&capsule, 1, 0)); + ret = efi_capsule_update_firmware(capsule); if (ret != EFI_SUCCESS) log_err("Applying capsule %ls failed\n", files[i]);