From patchwork Fri Jan 19 00:45:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 763905 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a08:0:b0:337:62d3:c6d5 with SMTP id m8csp204532wrq; Thu, 18 Jan 2024 16:48:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHp4CoOEVADud4JQ8UlkBaHJLujLSscAWSj2EUyH3iuuQ3VwIzY2O97g/8v7y05IfVikz/3 X-Received: by 2002:a05:600c:143:b0:40e:60c0:d94 with SMTP id w3-20020a05600c014300b0040e60c00d94mr1083152wmm.78.1705625305647; Thu, 18 Jan 2024 16:48:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705625305; cv=none; d=google.com; s=arc-20160816; b=jEFmJp83YVG2DxIUFArmkP8bs7cr/8i1rqfGPM2dOC022cYdRv3idF6aUHaZrZU5nB XBkaQE0YD0Y+IEYVkUQze5ZV6erp1XXVYPQm/YKJsp2tIisHipcWZE+stb6UvdEwvohm xXDOxeC5T87QmDZ71ICU1sr4LPzMfGz2mXA9LWr77TOIdrTskdsyqmS7QevjnMaWRscV Zw5dB6ARWDdHJaltFUXd7K74BTzsv1FcFK3vP1SBpq7bzHmcIquF3sIR+UasylvX9KkZ FTWFTR/657ZjBKTInmXffzWguEgdTX1mo4uevPtgwKBLlwfZykRx7ToWAHahs4PZxUWC bAYA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=987e+i7Eq0JZrNoCQx7+nDA1NxECWTAY1oGiBHOp0Gg=; fh=90lSBw+wRfsPn+xaW0S3z+mfIwOpjwfjrVWi6OXSKN0=; b=yfzVyrntwjzPfv6sgLkBlW9DNP4Zypj7PX3tY+byxV0SbyKp5FxiPei6I03YtZMM8O QYpvXIUEWV+38OptES8bzWvTWeZgJqS0OT+ZomQLJKPaSOfXSXRT4RVv0Yi4HU6/MErD hI/6GU8dnhrsnNZBT2bdvOyT7K8N2fWkSIftjdhuTgo+V8swGKqj7Vc/VL8TWAauqnID UrVRJfvF2ODIuCo98rfneCeH//fyPpmkA2VeSc7pkcPxG8cbl8E1ACga8hUOcB0R8tIu ESgkc1ILjzd/Ix2M2P8AgqB+IbhlUmRX8r++Kmaag0bvem5ftVzYf4ZRpUmO5oPl1hoJ +ixQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="c/Q5B5rs"; 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 r9-20020a05600c458900b0040e72a82703si5948636wmo.134.2024.01.18.16.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 16:48:25 -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="c/Q5B5rs"; 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 AA08187C8F; Fri, 19 Jan 2024 01:48:13 +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="c/Q5B5rs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7DAB487B93; Fri, 19 Jan 2024 01:48:10 +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-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) (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 B32C887C8A for ; Fri, 19 Jan 2024 01:48:01 +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=masahisa.kojima@linaro.org Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6d9b050e88cso266461b3a.0 for ; Thu, 18 Jan 2024 16:48:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705625279; x=1706230079; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=987e+i7Eq0JZrNoCQx7+nDA1NxECWTAY1oGiBHOp0Gg=; b=c/Q5B5rsgZQfTi8BJSq/rKlGfMzKtL9UwB+GXNps4IvRpUSIWZ9RYIfWqLsKvZM6C6 Yvisq4d8S49Znz+ZbmBrIW/RpelLSK8lX4a0mXtAw/ik+OUwTvWwc5Ac/GDrXZ9LMn3R GBmUaZtePH22p0e8nq1fvH+ueMbb//ZwfHKqf66qRlg9OBJXgU+rjEtGT9oZhXRCS17V xOCShuOSddmwPsCjG/nAuO26VIm03AnBCnYC6JdNci7QoK23AwapS2r+zxETqB+P8jzI 4wqypCBaYszuOj6/1+J7OmM8jUOFUrH8RW82t9fVZnRDUpudZs0pJJbToMHAKJuzXNZZ RICg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705625279; x=1706230079; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=987e+i7Eq0JZrNoCQx7+nDA1NxECWTAY1oGiBHOp0Gg=; b=Ut1D1EnZk7O4EsmUNo/6fVKC6aFTOXY5EbPhEa85rT9oOvqeRdp5zsFv/uoByNCtCT Ixjd/7BkHftDsLyZrLFnHTuDxsKjc678Gb0dV+lgdOdtvFhbnBcOBbdWw1bgu24NfNJN QBJNIwfezsUhgvnyHz+6nOjYHQyR/dVAtk1+iPd66UQUNZ6TBg+PivtVFSOaeg2CydeI 1y+dcXkr5CBxZzAnpWaNWH0rXrKzmCa6W4WDTX07tmjfb+kHxZf5fGOLQzi0wJl2OdWe 3oNYNPGBpF2E/MtFYsig1Hf57ZpQH6WrqOUtjlC8T51nimQkjVtWK6+wgsTW5B7VlDgC egNw== X-Gm-Message-State: AOJu0Ywh58VFXN0WHQLTCcRIwfM4oflZ5GBwi41xLKDxFjR0nMWFLRML Pe3WHrilZ1Ce+c/YUbGXMuZCcXs1tedNWJ4y5fLSyHG2st2C2A0JCPx9CYfv9DvZFOA+U38GdpP d X-Received: by 2002:a05:6a00:4b0a:b0:6d9:a651:4b07 with SMTP id kq10-20020a056a004b0a00b006d9a6514b07mr1837305pfb.46.1705625279649; Thu, 18 Jan 2024 16:47:59 -0800 (PST) Received: from localhost ([164.70.16.189]) by smtp.gmail.com with ESMTPSA id a3-20020aa78643000000b006db97e2c4e9sm3874522pfo.181.2024.01.18.16.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 16:47:59 -0800 (PST) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , AKASHI Takahiro , Masahisa Kojima Subject: [PATCH v3 3/3] efi_loader: return immediately in UCLASS_EFI_LOADER removal Date: Fri, 19 Jan 2024 09:45:46 +0900 Message-Id: <20240119004546.1084018-4-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119004546.1084018-1-masahisa.kojima@linaro.org> References: <20240119004546.1084018-1-masahisa.kojima@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 In case of UCLASS_EFI_LOADER, EFI handles are managed by EFI application/driver, we must not delete EFI handles. Signed-off-by: Masahisa Kojima --- lib/efi_loader/efi_disk.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index e2edc69fcf..b1739d9920 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -731,8 +731,14 @@ int efi_disk_remove(void *ctx, struct event *event) switch (id) { case UCLASS_BLK: desc = dev_get_uclass_plat(dev); - if (desc && desc->uclass_id != UCLASS_EFI_LOADER) - diskobj = (struct efi_disk_obj *)handle; + if (desc && desc->uclass_id == UCLASS_EFI_LOADER) + /* + * EFI application/driver manages the EFI handle, + * no need to delete EFI handle. + */ + return 0; + + diskobj = (struct efi_disk_obj *)handle; break; case UCLASS_PARTITION: diskobj = (struct efi_disk_obj *)handle; @@ -744,10 +750,8 @@ int efi_disk_remove(void *ctx, struct event *event) return 0; } - if (diskobj) { - dp = diskobj->dp; - volume = diskobj->volume; - } + dp = diskobj->dp; + volume = diskobj->volume; ret = efi_delete_handle(handle); /* Do not delete DM device if there are still EFI drivers attached. */