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 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 F39EAC433EF for ; Wed, 2 Feb 2022 13:55:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D12D8838D3; Wed, 2 Feb 2022 14:54:43 +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="uzkRlzJk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8B2A4838D6; Wed, 2 Feb 2022 14:54:42 +0100 (CET) Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (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 5B412838D2 for ; Wed, 2 Feb 2022 14:54:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pl1-x634.google.com with SMTP id c9so18271359plg.11 for ; Wed, 02 Feb 2022 05:54:39 -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=GdDnwWdEJ9nsmtC9/E9CFaZrlgdm/njU3nPmztsNGW4=; b=uzkRlzJknGdT9V1e0fJuiJJkQGo6NTPoUAfuAi/WaiM3R0gwTKn8y19aIwHlFgusua 1J+EaZke7L3PxuGs5KcpDjPr4jsOTckp2K4DXwdFrZNtBKq48YHhsHJ0/exfsXGMqjk5 Z3KGbur6jj3ip8CpVxTabRfKpX4WyJcc6GienarGkbGQx8n5RQhFMJFLfVZBnV7JiZRR oTRXGgANNuYsyfGdHbs60+N0SEFUKyntR8ZzcFT8yKDVK2YRHF3ikTbxkT+QdMJ8uQyK 9Zu0Z1s1zoous5df8VWFjJCU3c4wScI6OSKX7+ozllQ/4xM8LuU5hfgV5RR/XG1tsdzy kv+Q== 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=GdDnwWdEJ9nsmtC9/E9CFaZrlgdm/njU3nPmztsNGW4=; b=gYSx8s7D9Sqhd/ztJNhJ9zyZf5+0R/oF2YIeHu/CIalMrilRXxm4Wrkvz/eiv0tumu iYXy6O0nZP23aFi5v9lOnhQsF8GPkn/3YssdtZp2b07qbDgB2/VMIJiuP7vuU/t4JHaJ BF68ZyJEuBqNvyroRtKpWfokadbobJS6mJzqlYp/fqYtTjOaHyW/NmhWWi2BS+iO2GW6 avl1rUbEQxB+QmkCcnOV6alrNa6/McIoPNnPhK34z9hdJmyKq4S7e0qcdeZJZArVhzua 5AvDkjlZs50HxHQoj9MJNEcw2LuBpaCbH4VRiGSZ1cxHc3ZWwR5zs9u5qHroYeWAxVXs 5lgA== X-Gm-Message-State: AOAM532Mj24XDfMo3/xmZh6KKSqBQKxPx5CBWm8tVHPsHdMlpXPiLx6D z9i/L7uLe5Nxffl4D7DtGyC+25ivsuxFZQ== X-Google-Smtp-Source: ABdhPJxBFkAWTJfhGZ6RZK0UzYaW95T4JUneu8a4LjNUfD0YipZe+t/5TzhkXlHHTOA2nQ4y0Z3B+w== X-Received: by 2002:a17:90a:564f:: with SMTP id d15mr8205514pji.238.1643810077633; Wed, 02 Feb 2022 05:54:37 -0800 (PST) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id g20sm4952833pfj.196.2022.02.02.05.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 05:54:37 -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 v2 1/2] efi_loader: use efi_update_capsule_firmware() for capsule on disk Date: Wed, 2 Feb 2022 22:54:33 +0900 Message-Id: <164381007304.420956.13072455526097288152.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164381006265.420956.16575397258903175632.stgit@localhost> References: <164381006265.420956.16575397258903175632.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 at boot time. Suggested-by: AKASHI Takahiro Signed-off-by: Masami Hiramatsu --- Changes in v3: - Update patch description. Changes in v2: - Fix to pass correct pointer to efi_capsule_update_firmware - Remove ESRT generation, because this part anyway will be removed next patch. --- 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 4463ae00fd..1ec7ea29ff 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]);