From patchwork Thu Feb 3 09:23:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 539592 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp2253073imr; Thu, 3 Feb 2022 01:23:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwq8OTniK5XmzoraFDklVpU4TD/xZf1DgNjao5XyFf+tU3CQidrbmxux2kAHhevEz0ajgtK X-Received: by 2002:a50:a454:: with SMTP id v20mr34301168edb.176.1643880211590; Thu, 03 Feb 2022 01:23:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643880211; cv=none; d=google.com; s=arc-20160816; b=tJM36fNcVb/JyZLlJtQqEwwfB3ffy/7Fm9+tUtH+/HngoBHKLj9mhWGuOWYQVUhCig 0LjAKzk4IH+jXP1d4b9e9j5/QmhZYQzyEqU4D56wdasdU5fLMpIc77oxLZ9lEBXg42kU gqaSzNmVUUJyA4pew44jkL3Il4C0KOHn8qB+tG67dSGKcqGoZV1gn1YKlH9StbYVc/OI qE4pdU4NEiWK9SRH7lvtIHghcRXii8KZJxVWiLJ56yTE8YseVG5xpD/7e9QnOOwjsaeX eU2Rkzi72wuoJSmxgY5BqTlqZuhs7gBNpSTOqXROkmGvoXXZ6L87Ecjolh1UxvRLEr0E WVpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=l8NJ6lrbfovrBaFtwSDKYsM8LpZ8Hu6stUBjuanUvDA=; b=DaDKHJlq5uQFv5inThG7FecypeMCg6fde1fwzNLj2SCqdTfIdxwv78DAr7X88te+7Y c5yPq0vocPAVP1FOcBlGapPM40qCODx2EQk0o5vGX7sjhEOgUqWqnMcDsmapGoGR9VNa 6yK4j+DsBIteV5nEQNWRyDEJ3rdC2BB1zpH521Gk1s650NCtgDx365JtsUmuSciAefAc pi0GudAlo/v8lIBS4f5oYStnj1MMvddr8JZKuy5aQenu22X1negP58JdAby6NsAPEVWr 595+7tKyJe9N/i+KWC7yZMc/pKu4QBMH4axk2SiINWvzSMSvBjEHKi1+2vab2nqdaK+b GdGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l6LCsfpy; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id z64si12530412ede.393.2022.02.03.01.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 01:23:31 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l6LCsfpy; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 69C7B838F9; Thu, 3 Feb 2022 10:23:30 +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="l6LCsfpy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5320483902; Thu, 3 Feb 2022 10:23:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) (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 BA130839E8 for ; Thu, 3 Feb 2022 10:23:23 +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-x62b.google.com with SMTP id s6so1625538plg.12 for ; Thu, 03 Feb 2022 01:23:23 -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=l8NJ6lrbfovrBaFtwSDKYsM8LpZ8Hu6stUBjuanUvDA=; b=l6LCsfpyqBxLm11FOSRaapz8hOQqmS7qyok93wHwWMzlXPBvwrXkTIe7s4CtYl+WCS fWcFIAFcJZYW/lCg3032A+9NkQJf7o4q1h7ceiLtW2OqIHx33LCoFHMA8zq94FYhKmH6 lTNIkVGbY4Q4WMvYzW0J0TEPCF7edbk2F9uvF1IY3f9WWgRUWar8nxuHAmKm22+58DAW BN3rgKxt4lI3gLD+5QcEoLDWEdOER0jsVgx25JICeiQMHfMFy/OS4HvGfQiIFP7GH2Ce wWK1BYVv/sTjgJkTdivYbAOs1Pa/EQWQpr7vceLLyKQS/8Y8jihDa6XmtmSWocyA6siq Alsg== 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=l8NJ6lrbfovrBaFtwSDKYsM8LpZ8Hu6stUBjuanUvDA=; b=zUgZm0vcO6xHGKTa2DitrLyYKbZz+wNFAbTcwliNGMGpG1ZTq2dZZiZuBQNa+2CIcm ZkzqI4vbx32jgpiCkPiX8bIt641WHJ35V+05Tjn4xqzIUwCTjg8pom3xz/NFppe5dFek HIe/BGqWc9bQnKcrCWx7Rd6q+TknDamUo7uZZFUAJx2NiF/7J62cLnrjyym6pqje9Ccq tNeWzc348NeloQIV7eQre5iNvwsFQNTFXKe6/O3qOkY5BE6YN4kbz9IzeARDLr3O4G5Q so2mrur0590++wUpeyn7gdWwHxY/ZQzNA7Z1XCOpZXnHhQ4lA9qZcLaJmKbq56spcAxS JaMA== X-Gm-Message-State: AOAM531VoM2iDdrDCR7Ul0Pj+AHZPq3FXRecDsvB7b/8KzJXAXKGpK4q W7Nkh+aUEZEVr6IuxVy+9Oa1GSZSFYuzsg== X-Received: by 2002:a17:903:2093:: with SMTP id d19mr34454468plc.29.1643880201629; Thu, 03 Feb 2022 01:23:21 -0800 (PST) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id j3sm9198360pgs.0.2022.02.03.01.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 01:23:21 -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 v4 1/2] efi_loader: use efi_update_capsule_firmware() for capsule on disk Date: Thu, 3 Feb 2022 18:23:16 +0900 Message-Id: <164388019634.446835.18271480521485569016.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164388018493.446835.11931101380744085380.stgit@localhost> References: <164388018493.446835.11931101380744085380.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 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 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]);