From patchwork Tue Jun 20 06:19:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 694427 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp143601wrm; Mon, 19 Jun 2023 23:19:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6QnuflHstvx2q1ih5UjwpYDUozGjtYepoNuzXyIntxYxMJ+rKszmNKv+v4DoItCJQ1vo14 X-Received: by 2002:a92:c80a:0:b0:341:c806:a8cd with SMTP id v10-20020a92c80a000000b00341c806a8cdmr7628650iln.6.1687241986441; Mon, 19 Jun 2023 23:19:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687241986; cv=none; d=google.com; s=arc-20160816; b=WvDnQilYMNgkr5+8SybkVeuA4nsQb7Z/23LoohdmIVbNy2R4/hrvtOUlzhFVvlbZBm uPBweDq5LxIgdXhZWckhrjjEVLzwjATbVCDJAvaRU+z7NA8JrE6yM/7gW7fE52wgdou1 mGjVUpKQblMy2MqG4ZNVBWzNcOWom8UFs6iiAcny8MgOm8vu1d3f7exLDD4EBU8vHBpr wdLgNATXRKYwos7eXeR0l8HuvgAgTgBkfrXCjWwJch+efmLJVgMQAHc32S4vZHjQohfY 9OA7hlM1j4zP2UAEVlZrBXriOkEhNcFYMg080EO4Tk/pV7FrGKummWUQqHuxUL4Ct+f8 FmFw== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=vUOJq+Lt7UX59xxM9Ka0HRV7CbKbylm+/8H7C3gvmtg=; b=cfHM2BE8TGiyCgFi7sLXc6j21UV0zcoqWwk8z9QIZB7yXL/badRgy0L/Ack7J9oPVW V7ODHUdhpYbHQL6CBwXjS3q3EN+p9Hgam186RNrSJrinyzPWZZCM8LWlJF1QYECIUOgT WA014JSW2J9lc6Xp+tuVTYFZrnMvbdpM2hifcSVWg8KlU89MNRIK4PBudgPBtGwpHL/s GF+/AZL5bQr5qsaFGOPdjPyAnVhwAshnvcVdsPOuqcLR1etwvtKbSh9IaWI75zLjI26n idaXrG2cExFVMkJKdtGYtANBSKfOh66B6Q/+rIzW3MwhSsvrflCGptCYHGO2U5Y6up34 Ib9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vAdJIU3M; 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 q18-20020a0566380d1200b00411a364b4b0si698791jaj.25.2023.06.19.23.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 23:19:46 -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=vAdJIU3M; 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 AB10F8634E; Tue, 20 Jun 2023 08:19:40 +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="vAdJIU3M"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E0B2486337; Tue, 20 Jun 2023 08:19:38 +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-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (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 6B86E8632E for ; Tue, 20 Jun 2023 08:19:36 +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-ej1-x633.google.com with SMTP id a640c23a62f3a-9887ebe16d0so299904266b.2 for ; Mon, 19 Jun 2023 23:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687241976; x=1689833976; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vUOJq+Lt7UX59xxM9Ka0HRV7CbKbylm+/8H7C3gvmtg=; b=vAdJIU3MAL0zKSJs8lYNnl8WMTHbAfXuZX1072XAuD0ld8Z/tuJ7UAix1CllrLHYmu ACcZj/WDRA50SncGNfSvu/0Mibwrc8s2oHD3eng5+7ddZGwy7EAzh9TIIMrCYsyddNVs X4weZ2CyAqma4X7a1lihtKqusRnnEdupmzx5lvHoM/juI/PkRnONPF9aob9KsJ3JlFQj YDr1e6WZZ25ksW/hMIMFtJ1BWUZY2lLB59K/A7Cee2FMS7A8R0YRolCZBXqrf6gux3Ku UUc/Yiz6BWsqC27zirzPnl/xU22ufzJJMynF99ptZJ619eFWIaxNBp5840AOlnZ+2bxd ci/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687241976; x=1689833976; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vUOJq+Lt7UX59xxM9Ka0HRV7CbKbylm+/8H7C3gvmtg=; b=INSDxnnrbdLYxwOLeGsdMSiETyWaJ7mwwqcQJrccQkJxaW0aXwZ1e09JUr56mO23uK 1tzSmIeW6vJVczavE2FJbrgGSyOT4e2ubDm5Q+ZXPFyH8OV5CYrHcAU0LAUe7MhFzfFd 7PY3r6Qmdr9AjUlJT/Defr2eMPTrcotx2SymsCbsbDcy+LmrLS04bO8mBEcQmN0Z2XGN JzENEOIwzx1NCi7rQsOWHXsM5ZCHN63njHa3BRV1WLtdz5r8XTyoeXEPlt7L2Zj9PLLe slH4grc6mUceiqpSuMVAoVKEMWaCSvsiubK95pzp7SvUr5agvoqISrhHBZ7DVAdqPxli Dwhg== X-Gm-Message-State: AC+VfDxyAJYovF8zJiLHrSgOh9Sylu5qvV6jn+0G7Tib+aItMMRpPqJd EidyprChNJOO/X8uzCsyAqlo1Mh6D8lu6aclW78j4A== X-Received: by 2002:a17:906:9b88:b0:988:98a3:fd44 with SMTP id dd8-20020a1709069b8800b0098898a3fd44mr4446076ejc.28.1687241975966; Mon, 19 Jun 2023 23:19:35 -0700 (PDT) Received: from localhost.localdomain (ppp089210114029.access.hol.gr. [89.210.114.29]) by smtp.gmail.com with ESMTPSA id a22-20020a1709063a5600b00988e699d07fsm729988ejf.112.2023.06.19.23.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 23:19:35 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt Subject: [PATCH 0/4 v2] Reconnect controllers on failues Date: Tue, 20 Jun 2023 09:19:27 +0300 Message-Id: <20230620061932.113292-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.40.1 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 Hi, This is a resend of [0] trying to reconnect drivers gracefully in case of a protocol removal failure. Changes since v1: - Fix an existing memory leak when uninstalling a protocol. The opened protocol information was never released - Drop a patch that was incorrectly trying to free protocols on the handle that were not associated with the driver being released - Rewrite the sefltests and instead of installing a second driver handle on the controller handle, force the controller to return EFI_DEVICE_ERROR on the first removal. When that happens all the children, that are disconnected before the controller, must be reconnected - Reconnect all controllers on the handle if after disconnecting drivers and closing protocols opened by GET_PROTOCOL, TEST_PROTOCOL, HANDLE_PROTOCOL opened protocols are still present in the handle [0] https://lore.kernel.org/u-boot/20230615143941.416924-1-ilias.apalodimas@linaro.org/ Regards /Ilias Ilias Apalodimas (4): efi_loader: reconnect drivers on failure efi_loader: check the status of disconnected drivers efi_loader: fix the return codes of UninstallProtocol efi_selftests: add extra testcases on controller handling lib/efi_loader/efi_boottime.c | 43 ++++++++++++++++---- lib/efi_selftest/efi_selftest_controllers.c | 44 +++++++++++++++++++-- 2 files changed, 77 insertions(+), 10 deletions(-) --- 2.40.1