From patchwork Thu Jun 15 14:39:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 693006 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp562435wru; Thu, 15 Jun 2023 07:40:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64y/AqQWQK7Gdk1KJQGfVUvDipN3lsRowsWaUL787r6oi0hmJwNALHSIQDwpsvAtSnIgMg X-Received: by 2002:a05:6a00:1489:b0:666:5fc4:36b1 with SMTP id v9-20020a056a00148900b006665fc436b1mr5538230pfu.26.1686840028570; Thu, 15 Jun 2023 07:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686840028; cv=none; d=google.com; s=arc-20160816; b=FDJUkbxktO4qwbY9Bz0lINWnkO+8wWfFo9CDiPX0M7R6bPTc2fDfMarFjReTt/9KjP zp9w36Zc9q4SSCS6De5JJzjVgqvDOV0ZJh/bPJzpZuuZugqtYn0JyDF32+rRQ5D481lq JOcW0aMtZjpQsh/lYjoYtqrIDYg//tO+V9MYMQWMNtlAGcZNbRrIGXeBZxZaZTiW/tfQ z2rL3xIkfy7Uqq4GvWCfvkbcziAw2Z3+NwMpPxaAFtpR8sll1b+3og++yATtdcNxLPj/ 0EYcR60FEjOkhUOYf5XAaNU/nlVPpYZ2ZWXAsCzTFesyE+IIkrUMnYG9HBeBJd357Z27 mlSA== 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=/7gUZeDCaSwnyQGc96ye3lpyuyVRmtWbUT9YCC9IOaE=; b=is4E0wizlgLhhXtpw9o1L4BVxVvuSgBJC8T11BXxWZuhjaorPKK7+zQsmd4bew4ECv D3fgYDbggHGBIQXpfbGHEn8+91Mxi6/hOt9D47XSn2A8i7FI96VSYipAmKNhu4EE6aH7 pVzTTmvBCAr05KlLXQRyHtce/fO5ij2kCvNLZAOjaOe7jvb0AyLYljy4GBRFNYBg3A2I oL0hvdDsVzegDf6qBn2ZUlFci4zywl9E/cuo2+g6dTUkBGNtGM4LK473tS9RK84ySigL 6LVTS+nrkUY91vchVZYEgjgrI9haUDaqaexYZYVfE9gKOYY3Zy0K9Y+0koRaBqWo/O/0 e9Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SIztQrfn; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id r26-20020aa79eda000000b00666985d0294si1393669pfq.343.2023.06.15.07.40.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 07:40:28 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SIztQrfn; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 D4A218634C; Thu, 15 Jun 2023 16:39:55 +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="SIztQrfn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 401D286343; Thu, 15 Jun 2023 16:39:50 +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.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-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (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 5E4778631F for ; Thu, 15 Jun 2023 16:39:47 +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=ilias.apalodimas@linaro.org Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f649db9b25so10555674e87.0 for ; Thu, 15 Jun 2023 07:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686839986; x=1689431986; 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=/7gUZeDCaSwnyQGc96ye3lpyuyVRmtWbUT9YCC9IOaE=; b=SIztQrfnv1d42qCn9OFjXdXGL7Rve55PytsXdUf2EdGAGLYLfudwyNpnyBCS0GegVA zV83LYSKrD2fyD3rQGfLjYyf6j+EAmUBHAhngVW+IDhAMIUph0mJxv7RO3y59HYUjfUT GTRlB6T4bzbNT8bSYU7wjmArdN8U9WSawz45lx4h1Wn5BrtuyoIgEIwFkR/IulnO3D7A FVKF4Grf8KshRc0IZ8CFceeCZ/RdqUrqKjzXmt7F79Q7KAby2M/SwKH7TMqiUUitXPLU 9utJ/7rXMqWpdOVqqP/yKqGSM9MSmCK7Dazux3jal8UuXg+0toA3b8UHqpAO4L8E6X4o BYSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686839986; x=1689431986; 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=/7gUZeDCaSwnyQGc96ye3lpyuyVRmtWbUT9YCC9IOaE=; b=K2VVVM6rd2+nYH5tI4u5vlqJwiTMXp+sAkhh0AfwmglU78slP3hCWIMbOck/gLURn8 r3jVSrq+YmlGF28WCVSjXYUL8NVHhfEBt5dyFRV+cTDHTkzvBfpgnM/TdBc7TeDG5GK2 oi43mYH9E2cBfjDBwj5TUIufAvvbW+7nDg2P39gLdtlO3rcH1zgP97UHBbKhw+7qJm/M CkErB0+ZwvJpULylzrJmcS2G/n5nCuScE3pE8Jp7EmUYGQBTHDz/+wMC9LTH7ZLyIh+r h27lwUSZN97emvzOnOwmFAA7CGmhgdwuvPdsgJmxDzCNE106z3hnsvlZh2X9iCf9UGuj 5x3Q== X-Gm-Message-State: AC+VfDxrWYKuhZGprX5oP/5Mhrz518NT3kcTPA2EO+8ZgGdOdvrxajBz gxbFk2GzvcPrS8fB84DBvj7uOHbWtjbWSrIbtC+btQ== X-Received: by 2002:a19:e34f:0:b0:4f6:1c08:e9bb with SMTP id c15-20020a19e34f000000b004f61c08e9bbmr9411871lfk.63.1686839986430; Thu, 15 Jun 2023 07:39:46 -0700 (PDT) Received: from localhost.localdomain (ppp089210114029.access.hol.gr. [89.210.114.29]) by smtp.gmail.com with ESMTPSA id w11-20020a1cf60b000000b003f7ff6b1201sm20601273wmc.29.2023.06.15.07.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 07:39:46 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt Subject: [PATCH 3/5] efi_loader: disconnect all controllers when uninstalling a protocol Date: Thu, 15 Jun 2023 17:39:39 +0300 Message-Id: <20230615143941.416924-3-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230615143941.416924-1-ilias.apalodimas@linaro.org> References: <20230615143941.416924-1-ilias.apalodimas@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 we are trying to uninstall a protocol interface from a controller handle we are trying to disconnect drivers related to that protocol. However, when we call efi_disconnect_all_drivers() we pass the protocol GUID. If 2 different drivers are using the same protocol interface and one of them can't be stopped (e.g by returning EFI_DEVICE_ERROR) we should stop uninstalling it. Instead of explicitly passing the protocol GUID, pass NULL as an argument. That will force efi_get_drivers() to return all drivers consuming the interface regardless of the protocol GUID. While at it call efi_disconnect_all_drivers() with a handle instead of the efiobj Signed-off-by: Ilias Apalodimas --- lib/efi_loader/efi_boottime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.39.2 diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index df675d0ad488..b148824c7ec5 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1374,7 +1374,7 @@ static efi_status_t efi_uninstall_protocol if (r != EFI_SUCCESS) goto out; /* Disconnect controllers */ - r = efi_disconnect_all_drivers(efiobj, protocol, NULL); + r = efi_disconnect_all_drivers(handle, NULL, NULL); if (r != EFI_SUCCESS) { r = EFI_DEVICE_ERROR; goto out;