public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Uninstalling Invalid Protocol Interfaces
@ 2019-01-03 23:38 Ashish Singhal
  2019-01-04  0:08 ` Kinney, Michael D
  0 siblings, 1 reply; 6+ messages in thread
From: Ashish Singhal @ 2019-01-03 23:38 UTC (permalink / raw)
  To: edk2-devel@lists.01.org
  Cc: Michael D Kinney, Liming Gao, Siyuan Fu, Jiaxin Wu

Hello,

As part of moving from MdeModulePkg implementation of IScsiDxe to the implementation in NetworkPkg, I started hitting exception in the driver loaded after IScsiDxe if IScsiDxe's installation fails for some reason. Upon debugging, I found out that calls to UninstallMultipleProtocolInterfaces as part of Error 2 as well Error 1 fail while trying to uninstall component name protocol-interface pair and return error code EFI_INVALID_PARAMETER. As per UninstallMultipleProtocolInterfaces's documentation, if uninstallation of any of the input protocol-interface pair fails, it will reinstall any just uninstalled protocol and return EFI_INVALID_PARAMETER which causes the cleanup of this driver corrupt leading to failure in next driver getting loaded. The reason of failure in UninstallMultipleProtocolInterfaces is because the driver uses EfiLibInstallDriverBindingComponentName2 to install interfaces which may not install component name interfaces depending on the value of PCDs PcdComponentNameDisable and PcdComponentName2Disable. I have the following proposals to get around this issue.


  1.  Instead of calling UninstallMultipleProtocolInterfaces once and list all protocol-interface pairs, do it sequentially for every pair so that the once which was installed correctly, gets uninstalled instead of getting reinstalled because of a failure uninstalling another pair. This would however make us not really use use UninstallMultipleProtocolInterfaces API to its full caliber.
  2.  In UEFILib, add a function EfiLibUninstallDriverBindingComponentName2 for uninstalling protocol interfaces taking into consideration the state of PCDs PcdComponentNameDisable and PcdComponentName2Disable.
  3.  In UEFILib, add uninstall functions for all corresponding install APIs to get coverage for all scenarios.

I would certainly prefer option 2 or 3 as they seem to be more correct and would provide a for all drivers which may hit the issue. I am happy to make the code changes as needed and suggested by the maintainers.

Thanks
Ashish

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-01-04 22:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-03 23:38 Uninstalling Invalid Protocol Interfaces Ashish Singhal
2019-01-04  0:08 ` Kinney, Michael D
2019-01-04  0:16   ` Ashish Singhal
2019-01-04 17:15     ` Kinney, Michael D
2019-01-04 17:32       ` Ashish Singhal
2019-01-04 22:17         ` Ashish Singhal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox