From patchwork Fri Jun 4 09:43:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 454006 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp258041jae; Fri, 4 Jun 2021 02:44:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW0qbRknTFlnzGp18Zz3STEb1V+y56MSr2vXbkwzhRE4YpcpjiK5tuET2eEq6HFYAE/i6s X-Received: by 2002:a17:907:7201:: with SMTP id dr1mr3409169ejc.19.1622799843386; Fri, 04 Jun 2021 02:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622799843; cv=none; d=google.com; s=arc-20160816; b=LdNfEMYl+Mv9hKMs7JD2B3e6In6xlR9ee6gO6xHi/e95dX/7j4pxOoPJWueQIfkLvV 2g66b33vV3dyYMbpmYDLX1K1RgAOurQ59IzUFrjju+XqIm4y3d+jqXDibAD9Wjjro2Cx ShYa7vKr71nLBGigQ74nSYAYiz1Z+1DVW7h1mu/2QFVI/7zvyThPN6wfJ28CuNBF4npp qazVEvTdObqhN61yqrseYE9mB5SIlTIMlbr3Xki9rIp33TBat8iV1zCmtALT3CfOI15y zUBfbBGOx4NODol4jjMfHDWoFJnFEXGoB9i+seSa9xmtwAXDzQOv0n/h68uIXz8S14HT gsPg== 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=8m9NcTAg1plykHg8YHgrerRKB9vHyjHnMs3CshDXATg=; b=cYXWmd/Rwd2Nud7M1QNiD7C6nr9if9TvDAQxaUOxQCKSsisJQvKSAXBgWKHRed9H0V OdyVzFnvxwBJwEUAoBwRZpOptAzLu1F6/tjp8erxwrKB9HDSDOZ5VCJ5U+gJwScOmDV/ raG2fnBU1KFMLHqnd/EBciP/V9Jbw7imOtLiAYntTa577uZ9nH5YGrjGPofmXgW0cXpt VldkkdhGDZTy0axmOPxZpfQYz7DMnFffc8LOFIOXT02iA99z2kWVPd+1VLO1KGZV+C1h /g4uhNiIoxZ0zRnRUL7//jc2w2/2aCqCwsXQJ6zto8+HA5/hR2W6XbMRDOJ2KHUSgEjk 9Gxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MhvPulGe; 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 t2si4422377ejf.594.2021.06.04.02.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 02:44:03 -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; dkim=pass header.i=@linaro.org header.s=google header.b=MhvPulGe; 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 5D09382052; Fri, 4 Jun 2021 11:44:01 +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="MhvPulGe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3023082B41; Fri, 4 Jun 2021 11:43:59 +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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) (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 E954C82AD2 for ; Fri, 4 Jun 2021 11:43:51 +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=masami.hiramatsu@linaro.org Received: by mail-pg1-x534.google.com with SMTP id i34so1013007pgl.9 for ; Fri, 04 Jun 2021 02:43:51 -0700 (PDT) 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=8m9NcTAg1plykHg8YHgrerRKB9vHyjHnMs3CshDXATg=; b=MhvPulGejbMRtxxSIqXrFXBfW+VQFOJeaVS4dT4uYb/R4CgWiIrec7J5LL4wynkRlb wSzQbZgQo6/3B6CP3FKmteP+4kWxqSDFwpdyxnNnvt9rvg9D93sBtJuKLeQFKYy2TWLf 1aYZnOAZKXsrHnIk9V6RA0Mv4Q4Pkl5x8xgJlFjIaPjiQInQg7eo7JaGsR5MB7+ekfIK zfN+47nO13rBJh7uMqzp6GyNpjtICUsm3GHi8SM3o+p8tGAlselyl9eI+HNg0YeZxuMf TNnEHT7kO0vpDLnVLuV+q1pxw7dWQwvTBQJLSmRZdPg2cYa9TwNQFUDzy/+ygj6FOd/l jIjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=8m9NcTAg1plykHg8YHgrerRKB9vHyjHnMs3CshDXATg=; b=PN/FjkNeJo4s2UeiSngMxk45+V2HiQpIo767wGXHMgyDaefsPH2UB5qxVciSKhSO6h cGjNx1sBZ0b/CcNNRtje4HspT06R0fyVgUWPt+INles/q7N3Mdeg47JsPtPopHmGZVfh co6VlXZEQJoPSHqVq9oxUlUWsPql+HkRYDDfm1S4eWEKg3CTNnrw9HOUQ4dddmyISXd2 OapdITth2J9N7C6MWIk9XjfRDGJBmyEWL3E0YFAnoE/AuiW/bDhBbPsgN2eC/+kS0ivz EjkGU7H7vccKZZtGoc2xRDINxye/g89bTVpTjcWqB/sN2/jEToEHcMYuHwPwpdBog2Fu wuTQ== X-Gm-Message-State: AOAM531YYA73C+nx6+VmrPZYoPQb2diqtor7k/dmB9ZNwuu3mwYJYl1j QXZ8O1M46yjMo1VMjCF+A4JnGA== X-Received: by 2002:a63:f644:: with SMTP id u4mr4088414pgj.225.1622799829549; Fri, 04 Jun 2021 02:43:49 -0700 (PDT) Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp. [210.141.244.193]) by smtp.gmail.com with ESMTPSA id y138sm1482661pfc.11.2021.06.04.02.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 02:43:49 -0700 (PDT) From: Masami Hiramatsu To: Peng Fan , Simon Glass , Tom Rini , Heinrich Schuchardt , Alexander Graf , Jagan Teki , Vignesh R , Joe Hershberger , Ramon Fried , Sughosh Ganu Cc: Masami Hiramatsu , Jassi Brar , Ilias Apalodimas , Masahisa Kojima , Takahiro Akashi , Tim Harvey , Bin Meng , u-boot@lists.denx.de, Jaehoon Chung Subject: [PATCH v5 03/13] efi: Fix to use null handle to create new handle for efi_fmp_raw Date: Fri, 4 Jun 2021 18:43:44 +0900 Message-Id: <162279982423.518877.15839850397868047932.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <162279979193.518877.11119025270138617301.stgit@localhost> References: <162279979193.518877.11119025270138617301.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 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.102.4 at phobos.denx.de X-Virus-Status: Clean When running the efidebug capsule disk-update command, the efi_fmp_raw protocol installation is failed with 2 (EFI_INVALID_PARAMETER) as below. This is because the code passes efi_root instaed of handle. => efidebug capsule disk-update EFI: Call: efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL) EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbaf5988) EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Entry efi_install_protocol_interface(00000000fbaf5988, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6ee8) EFI: new handle 00000000fbb37520 EFI: Exit: efi_install_protocol_interface: 0 EFI: 0 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Exit: efi_install_multiple_protocol_interfaces: 0 EFI: 0 returned by efi_install_multiple_protocol_interfaces( &handle, &efi_guid_firmware_management_protocol, &efi_fmp_fit, NULL) EFI: Call: efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL) EFI: Entry efi_install_multiple_protocol_interfaces(00000000fbfec648) EFI: Call: efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Entry efi_install_protocol_interface(00000000fbfec648, 86c77a67-0b97-4633-a187-49104d0685c7, 0, 00000000fbfa6f18) EFI: handle 00000000fbaf8520 EFI: Exit: efi_install_protocol_interface: 2 EFI: 2 returned by efi_install_protocol_interface( handle, protocol, EFI_NATIVE_INTERFACE, protocol_interface) EFI: Exit: efi_install_multiple_protocol_interfaces: 2 EFI: 2 returned by efi_install_multiple_protocol_interfaces( &efi_root, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL) Command failed, result=1 To fix this issue, pass the handle variable as same as the efi_fmp_fit installation. Signed-off-by: Masami Hiramatsu --- 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 9ead0d2c78..71d3d1e523 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -939,7 +939,7 @@ efi_status_t __weak arch_efi_load_capsule_drivers(void) if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_RAW)) { handle = NULL; ret = EFI_CALL(efi_install_multiple_protocol_interfaces( - &efi_root, + &handle, &efi_guid_firmware_management_protocol, &efi_fmp_raw, NULL)); }