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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B05A1EB64D7 for ; Sun, 18 Jun 2023 14:20:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DF103862DE; Sun, 18 Jun 2023 16:20:05 +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="adcxOc6t"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C05D58631F; Sun, 18 Jun 2023 16:20:02 +0200 (CEST) Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 13EB1861A9 for ; Sun, 18 Jun 2023 16:19:59 +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-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f8d258f203so18733225e9.1 for ; Sun, 18 Jun 2023 07:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687097998; x=1689689998; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5dZoLEcvKYOJqRrQz5Mbx8EyaoiCU4rZD3BtchR+3YI=; b=adcxOc6tPJIOUV+jxOwGTzJJDvfLyxQaPy/Nb/4vQSQq5wdn+EOYeMV18eSXVLzpt+ s2DvnMngFUHlDVgBCRJ5Br/YQz4Ov+KfcYyGyWtfvVOrgBLoiybgrvfOCr9q667FU9Lm K9HSi8pH3Kg8qMkq1K8EUB2yCTFBjS4x5SOc8nIfsL4ZaKp44TFat6r1ghbzMYyVn8G1 LmmpxAkIJqIfOIuJ/Y17de9bZxk/NhGvUbmc+6LX9ykBrblDEcJonFksqy2zMqT1LtzH VR4TKyyPJR3rrTJtUOZ3KWCSsipd3mM5xYKrZKYYhCBWM/3jMu/kJ3GvjiLnIdvUvHtt fPoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687097998; x=1689689998; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5dZoLEcvKYOJqRrQz5Mbx8EyaoiCU4rZD3BtchR+3YI=; b=Mv9e8ig+C7XW1P+1etylJViXIsI/5Xwnt89/+g/HvRW/g7QolkmMpyC4NZ3vANJ3aV axegHyBDV3RbWphx3KT2Mamwv/eKn3kR1KPoRXVR9LNXsWpT8buyfGTWkdEL4xUEaXck 0Z1U8jWoF/jCT4wasL4kTs4kVrCJF55KAs6gWqMtMoci3sdfsC5jdulmfaOpuuSRX7aJ j4TuGbvyv097weVuY/DkWcL//7F6kCkMflzlOJYQODQ9LzjDVvydVnBD4T/+GpJz0RQo ObwBDNP0D37Iz5DEoJA8Dpu238D2aTBhdFmNxO+Nvub9U182fbdC2pPHAfUKHC7z8yNt 05LA== X-Gm-Message-State: AC+VfDxQS0Byus9PvfOR/cRHqt4UJcwa7d+WloucaKz8EcEKBbobtZ7f ivoT2yZMCmYfkCw+G09lzxSHPA== X-Google-Smtp-Source: ACHHUZ78MoCLEpgrsh1RRAYaYFP6f/taGG2Yi5FXUBjOFO9ih/sMSM1IMR0Y3YozGYg+pGE3p/U/Jw== X-Received: by 2002:a1c:e914:0:b0:3f8:facf:7626 with SMTP id q20-20020a1ce914000000b003f8facf7626mr4584953wmc.20.1687097998439; Sun, 18 Jun 2023 07:19:58 -0700 (PDT) Received: from hades (ppp089210114029.access.hol.gr. [89.210.114.29]) by smtp.gmail.com with ESMTPSA id v15-20020a1cf70f000000b003f8d770e935sm7994475wmh.0.2023.06.18.07.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jun 2023 07:19:58 -0700 (PDT) Date: Sun, 18 Jun 2023 17:19:55 +0300 From: Ilias Apalodimas To: Heinrich Schuchardt Cc: u-boot@lists.denx.de Subject: Re: [PATCH 1/5] efi_loader: check the status of disconnected drivers Message-ID: References: <20230615143941.416924-1-ilias.apalodimas@linaro.org> <5f0a5f30-ca1f-1aa8-278b-a20c7f379342@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5f0a5f30-ca1f-1aa8-278b-a20c7f379342@gmx.de> 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 On Sun, Jun 18, 2023 at 08:39:27AM +0200, Heinrich Schuchardt wrote: > On 6/15/23 16:39, Ilias Apalodimas wrote: > > efi_uninstall_protocol() calls efi_disconnect_all_drivers() but never > > checks the return value. Honor that and return an appropriate error > > if the associated controllers failed to disconnect > > > > Signed-off-by: Ilias Apalodimas > > --- > > lib/efi_loader/efi_boottime.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c > > index 5006c0e1e4af..68198e6b5ff6 100644 > > --- a/lib/efi_loader/efi_boottime.c > > +++ b/lib/efi_loader/efi_boottime.c > > @@ -1353,7 +1353,11 @@ static efi_status_t efi_uninstall_protocol > > if (r != EFI_SUCCESS) > > goto out; > > /* Disconnect controllers */ > > - efi_disconnect_all_drivers(efiobj, protocol, NULL); > > + r = efi_disconnect_all_drivers(efiobj, protocol, NULL); > > + if (r != EFI_SUCCESS) { > > + r = EFI_DEVICE_ERROR; > > This return code is not foreseen in this case by the UEFI specification. > I only found: > > EFI_ACCESS_DENIED: > The interface was not removed because the interface is still being used > by a driver. > > EDK II sets this code in CoreDisconnectControllersUsingProtocolInterface(). Right, I only looked at DisconnectController() returns values... You are right, I'll switch this and the check in the selftests. Thanks /Ilias > > Best regards > > Heinrich > > > + goto out; > > + } > > /* Close protocol */ > > list_for_each_entry_safe(item, pos, &handler->open_infos, link) { > > if (item->info.attributes == >