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 X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B94BC07E94 for ; Fri, 4 Jun 2021 09:44:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9FA22613F4 for ; Fri, 4 Jun 2021 09:44:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FA22613F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de 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) 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-Google-Smtp-Source: ABdhPJyszOnPRjLB7cSMtYEcACo0gbHY9VklBkct618Gppfr+l2iDQYSKfUrXnniSt5Aote3FcpNTw== 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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)); }