From patchwork Mon Sep 9 11:20:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 826583 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp1942999wrb; Mon, 9 Sep 2024 04:21:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX7vR7qFy0v0Hvhp4ofN8GJl5Q76c5PZRLy2NchvShNaZrhfXFJ4HkLIpnaLI4uHvBW29u3BQ==@linaro.org X-Google-Smtp-Source: AGHT+IE+wG4F+6jh8cwZMcBrstx6wn5yueaIjWT3HWOZJyS9UKVQh9L3GQq1ehffMs/5xCuWeJYj X-Received: by 2002:adf:fc88:0:b0:371:8ec6:f2f0 with SMTP id ffacd0b85a97d-378895cb875mr7200997f8f.16.1725880893086; Mon, 09 Sep 2024 04:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725880893; cv=none; d=google.com; s=arc-20240605; b=k8kcrPsO5Pg9M/4oN8Vk0efi5rcdaqIkZsV0WgkVNOgIPaPhZ4yvWxoI2MCZtzfKQI 7T5gByYvWppvpSy6qaQN0AfoKvrfMU6Y98NSECW2nWrBs4O1eTXqoop52H/X1AUYTN+S 4yDNciGHhcv51lV6giutYBU8QD1qtHKQdQfVqukb478/v7AbbI/0BjRFA+GC6W4SmzrG CY+C6I3FGBl8Axr8dnGWVs79fR7ypbTkv/wCdbe0sOM+CtuTGb8MQ/oSqkMwFqQ2qNUJ nppNxRfAiqCh4XniAKYKZwp4KdxjW+pP2jd+tsPrlqvzDJvtfQkbWpQFNuDx6x+0PR7W Lcog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=vOgmLv8HmPDn0W+uQ+79TConf6pnie5tbnIQwwP/h58=; fh=2L6lzFTxXJKn0sJyMiGOHr75auJVv+HSnsI1uFLsQPk=; b=ll9NdzpRjC80ukXq+ROKEcXFrPE8P5a5CzBxbmF2/+8fJrbPiVOWLXCh1c9+4jjNIh WsnhXI3IUaSHhK7Zt7jBumiNHeruiATKL2dGUa8vr/+MeZRY8VOG5qFjfTwTvk48K2HD L5SxFiHV7Yr2hT6jocugDAuqOZxk3oPcziqrAc88kyMrvY49w6JxRcVtaPdVfCPc/nHW yznw/XnH/ZPKA0RaKnj8I4aThVLmQv6ZdgHLJ3oFkjW2/H8lY3blNwYShfRIgzBLLcqZ 0M80X2MTsB/3ILHgW0RI2N2IltDCK21+TD82wySH88MJ1Hj84G/yIweNbPvPBj1qRJhu CkBg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 ffacd0b85a97d-378956b918fsi2069021f8f.697.2024.09.09.04.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 04:21:33 -0700 (PDT) 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; 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=fail (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 406E388DD9; Mon, 9 Sep 2024 13:20:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 48A0288DD9; Mon, 9 Sep 2024 13:20:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 4F48088CBD for ; Mon, 9 Sep 2024 13:20:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 59C2DFEC; Mon, 9 Sep 2024 04:21:17 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D81623F73B; Mon, 9 Sep 2024 04:20:46 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Michal Simek , Ilias Apalodimas , Heinrich Schuchardt , Sughosh Ganu Subject: [PATCH v2 6/6] fwu: print a message if empty capsule checks fail Date: Mon, 9 Sep 2024 16:50:21 +0530 Message-Id: <20240909112021.1962801-7-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240909112021.1962801-1-sughosh.ganu@linaro.org> References: <20240909112021.1962801-1-sughosh.ganu@linaro.org> 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.8 at phobos.denx.de X-Virus-Status: Clean When dealing with processing of the empty capsule, the capsule gets applied only when the checks for the empty capsule pass. Print a message to highlight if empty capsule checks fail, and return an error value, similar to the normal capsules. Signed-off-by: Sughosh Ganu --- Changes since V1: New patch lib/efi_loader/efi_capsule.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 635088f25a..22677f395b 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -563,9 +563,14 @@ static efi_status_t efi_capsule_update_firmware( bool fw_accept_os; if (IS_ENABLED(CONFIG_FWU_MULTI_BANK_UPDATE)) { - if (fwu_empty_capsule_checks_pass() && - fwu_empty_capsule(capsule_data)) - return fwu_empty_capsule_process(capsule_data); + if (fwu_empty_capsule(capsule_data)) { + if (fwu_empty_capsule_checks_pass()) { + return fwu_empty_capsule_process(capsule_data); + } else { + log_err("FWU empty capsule checks failed. Cannot start update\n"); + return EFI_INVALID_PARAMETER; + } + } if (!fwu_update_checks_pass()) { log_err("FWU checks failed. Cannot start update\n");