public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH 1/5] efi_loader: check the status of disconnected drivers
Date: Sun, 18 Jun 2023 17:19:55 +0300	[thread overview]
Message-ID: <ZI8SizIHCUsta1ms@hades> (raw)
In-Reply-To: <5f0a5f30-ca1f-1aa8-278b-a20c7f379342@gmx.de>

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 <ilias.apalodimas@linaro.org>
> > ---
> >   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 ==
> 

      reply	other threads:[~2023-06-18 14:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 14:39 [PATCH 1/5] efi_loader: check the status of disconnected drivers Ilias Apalodimas
2023-06-15 14:39 ` [PATCH 2/5] efi_loader: reconnect drivers on failure Ilias Apalodimas
2023-06-15 14:39 ` [PATCH 3/5] efi_loader: disconnect all controllers when uninstalling a protocol Ilias Apalodimas
2023-06-19  7:03   ` Heinrich Schuchardt
2023-06-19  7:43     ` Ilias Apalodimas
2023-06-15 14:39 ` [PATCH 4/5] efi_loader: fix the return codes of UninstallProtocol Ilias Apalodimas
2023-06-18  7:08   ` Heinrich Schuchardt
2023-06-15 14:39 ` [PATCH 5/5] efi_selftests: add extra testcases on controller handling Ilias Apalodimas
2023-06-18  6:39 ` [PATCH 1/5] efi_loader: check the status of disconnected drivers Heinrich Schuchardt
2023-06-18 14:19   ` Ilias Apalodimas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZI8SizIHCUsta1ms@hades \
    --to=ilias.apalodimas@linaro.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox