public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ashish Singhal <ashishsingha@nvidia.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Siyuan Fu <siyuan.fu@intel.com>, Jiaxin Wu <jiaxin.wu@intel.com>
Subject: Uninstalling Invalid Protocol Interfaces
Date: Thu, 3 Jan 2019 23:38:48 +0000	[thread overview]
Message-ID: <BYAPR12MB27433AADA77B5C2EA683CB5FBA8D0@BYAPR12MB2743.namprd12.prod.outlook.com> (raw)

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.
-----------------------------------------------------------------------------------


             reply	other threads:[~2019-01-03 23:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03 23:38 Ashish Singhal [this message]
2019-01-04  0:08 ` Uninstalling Invalid Protocol Interfaces 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

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-list 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=BYAPR12MB27433AADA77B5C2EA683CB5FBA8D0@BYAPR12MB2743.namprd12.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /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