Message ID | 20230615143941.416924-3-ilias.apalodimas@linaro.org |
---|---|
State | New |
Headers | show |
Series | [1/5] efi_loader: check the status of disconnected drivers | expand |
On 6/15/23 16:39, Ilias Apalodimas wrote: > 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 <ilias.apalodimas@linaro.org> > --- > lib/efi_loader/efi_boottime.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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); When uninstalling a *single* protocol we don't want to disconnect drivers for *all* protocols on this handle but only for the specified one. This will not work if you don't pass the protocol GUID to DisconnectController(). Best regards Heinrich > if (r != EFI_SUCCESS) { > r = EFI_DEVICE_ERROR; > goto out; > -- > 2.39.2 >
On Mon, 19 Jun 2023 at 10:04, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote: > > On 6/15/23 16:39, Ilias Apalodimas wrote: > > 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 <ilias.apalodimas@linaro.org> > > --- > > lib/efi_loader/efi_boottime.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > 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); > > When uninstalling a *single* protocol we don't want to disconnect > drivers for *all* protocols on this handle but only for the specified > one. This will not work if you don't pass the protocol GUID to > DisconnectController(). Right, I missread the spec and the selftests are probably wrong as well... I'll fix that on v2 Thanks /Ilias > > Best regards > > Heinrich > > > if (r != EFI_SUCCESS) { > > r = EFI_DEVICE_ERROR; > > goto out; > > -- > > 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;
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 <ilias.apalodimas@linaro.org> --- lib/efi_loader/efi_boottime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.39.2