public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
@ 2019-01-09 20:58 Ashish Singhal
  2019-01-09 20:58 ` [PATCH v4 1/2] MdePkg/UefiLib: Abstract driver model " Ashish Singhal
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ashish Singhal @ 2019-01-09 20:58 UTC (permalink / raw)
  To: edk2-devel
  Cc: michael.d.kinney, liming.gao, siyuan.fu, jiaxin.wu,
	Ashish Singhal

An issue was seen in IScsiDxe in NetworkPkg where driver cleanup after
initialization failure was not done right. Bug 1428 was filed in this regard.
As per discussions with Mike, it was also discussed that having UEFILib
provide protocol uninstallation abstraction would help to avoid these
issues in the future. Bug 1429 was found to track this. These 2 patches
take care of this.


Ashish Singhal (2):
  MdePkg/UefiLib: Abstract driver model protocol uninstallation
  NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.

 MdePkg/Include/Library/UefiLib.h         | 103 ++++
 MdePkg/Library/UefiLib/UefiDriverModel.c | 972 ++++++++++++++++++++++++++++++-
 NetworkPkg/IScsiDxe/IScsiDriver.c        |  31 +-
 3 files changed, 1085 insertions(+), 21 deletions(-)

-- 
2.7.4



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

* [PATCH v4 1/2] MdePkg/UefiLib: Abstract driver model protocol uninstallation
  2019-01-09 20:58 [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation Ashish Singhal
@ 2019-01-09 20:58 ` Ashish Singhal
  2019-01-09 20:58 ` [PATCH v4 2/2] NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols Ashish Singhal
  2019-01-10  0:55 ` [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation Kinney, Michael D
  2 siblings, 0 replies; 9+ messages in thread
From: Ashish Singhal @ 2019-01-09 20:58 UTC (permalink / raw)
  To: edk2-devel
  Cc: michael.d.kinney, liming.gao, siyuan.fu, jiaxin.wu,
	Ashish Singhal

Provided functions in UEFILib that abstract driver model protocol
uninstallation. This helps drivers to install and uninstall protocols
using a library to keep things seemless.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1429

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
---
 MdePkg/Include/Library/UefiLib.h         | 103 ++++
 MdePkg/Library/UefiLib/UefiDriverModel.c | 972 ++++++++++++++++++++++++++++++-
 2 files changed, 1074 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h
index 468bffc..08222d4 100644
--- a/MdePkg/Include/Library/UefiLib.h
+++ b/MdePkg/Include/Library/UefiLib.h
@@ -12,6 +12,7 @@
   of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is
   defined, then debug and assert related macros wrapped by it are the NULL implementations.
 
+Copyright (c) 2019, NVIDIA Corporation. All rights reserved.
 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials are licensed and made available under
 the terms and conditions of the BSD License that accompanies this distribution.
@@ -1283,6 +1284,7 @@ AsciiPrintXY (
   ...
   );
 
+
 /**
   Installs and completes the initialization of a Driver Binding Protocol instance.
 
@@ -1316,6 +1318,25 @@ EfiLibInstallDriverBinding (
 
 
 /**
+  Uninstalls a Driver Binding Protocol instance.
+
+  If DriverBinding is NULL, then ASSERT().
+  If DriverBinding can not be uninstalled, then ASSERT().
+
+  @param  DriverBinding        A Driver Binding Protocol instance that this driver produced.
+
+  @retval EFI_SUCCESS           The protocol uninstallation successfully completed.
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().
+
+**/
+EFI_STATUS
+EFIAPI
+EfiLibUninstallDriverBinding (
+  IN EFI_DRIVER_BINDING_PROTOCOL  *DriverBinding
+  );
+
+
+/**
   Installs and completes the initialization of a Driver Binding Protocol instance and
   optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols.
 
@@ -1354,6 +1375,31 @@ EfiLibInstallAllDriverProtocols (
   );
 
 
+/**
+  Uninstalls a Driver Binding Protocol instance and optionally uninstalls the
+  Component Name, Driver Configuration and Driver Diagnostics Protocols.
+
+  If DriverBinding is NULL, then ASSERT().
+  If the uninstallation fails, then ASSERT().
+
+  @param  DriverBinding        A Driver Binding Protocol instance that this driver produced.
+  @param  ComponentName        A Component Name Protocol instance that this driver produced.
+  @param  DriverConfiguration  A Driver Configuration Protocol instance that this driver produced.
+  @param  DriverDiagnostics    A Driver Diagnostics Protocol instance that this driver produced.
+
+  @retval EFI_SUCCESS           The protocol uninstallation successfully completed.
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().
+
+**/
+EFI_STATUS
+EFIAPI
+EfiLibUninstallAllDriverProtocols (
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL
+  IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL  *DriverConfiguration, OPTIONAL
+  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL    *DriverDiagnostics    OPTIONAL
+  );
+
 
 /**
   Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.
@@ -1391,6 +1437,29 @@ EfiLibInstallDriverBindingComponentName2 (
 
 
 /**
+  Uninstalls Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.
+
+  If DriverBinding is NULL, then ASSERT().
+  If the uninstallation fails, then ASSERT().
+
+  @param  DriverBinding        A Driver Binding Protocol instance that this driver produced.
+  @param  ComponentName        A Component Name Protocol instance that this driver produced.
+  @param  ComponentName2       A Component Name 2 Protocol instance that this driver produced.
+
+  @retval EFI_SUCCESS           The protocol installation successfully completed.
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().
+
+**/
+EFI_STATUS
+EFIAPI
+EfiLibUninstallDriverBindingComponentName2 (
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL
+  IN CONST EFI_COMPONENT_NAME2_PROTOCOL       *ComponentName2       OPTIONAL
+  );
+
+
+/**
   Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver
   Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.
 
@@ -1434,6 +1503,40 @@ EfiLibInstallAllDriverProtocols2 (
   IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL   *DriverDiagnostics2    OPTIONAL
   );
 
+
+/**
+  Uninstalls Driver Binding Protocol with optional Component Name, Component Name 2, Driver
+  Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.
+
+  If DriverBinding is NULL, then ASSERT().
+  If the installation fails, then ASSERT().
+
+
+  @param  DriverBinding         A Driver Binding Protocol instance that this driver produced.
+  @param  ComponentName         A Component Name Protocol instance that this driver produced.
+  @param  ComponentName2        A Component Name 2 Protocol instance that this driver produced.
+  @param  DriverConfiguration   A Driver Configuration Protocol instance that this driver produced.
+  @param  DriverConfiguration2  A Driver Configuration Protocol 2 instance that this driver produced.
+  @param  DriverDiagnostics     A Driver Diagnostics Protocol instance that this driver produced.
+  @param  DriverDiagnostics2    A Driver Diagnostics Protocol 2 instance that this driver produced.
+
+  @retval EFI_SUCCESS           The protocol uninstallation successfully completed.
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().
+
+**/
+EFI_STATUS
+EFIAPI
+EfiLibUninstallAllDriverProtocols2 (
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,        OPTIONAL
+  IN CONST EFI_COMPONENT_NAME2_PROTOCOL       *ComponentName2,       OPTIONAL
+  IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL  *DriverConfiguration,  OPTIONAL
+  IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2, OPTIONAL
+  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL    *DriverDiagnostics,    OPTIONAL
+  IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL   *DriverDiagnostics2    OPTIONAL
+  );
+
+
 /**
   Appends a formatted Unicode string to a Null-terminated Unicode string
 
diff --git a/MdePkg/Library/UefiLib/UefiDriverModel.c b/MdePkg/Library/UefiLib/UefiDriverModel.c
index 69581ae..262d8bc 100644
--- a/MdePkg/Library/UefiLib/UefiDriverModel.c
+++ b/MdePkg/Library/UefiLib/UefiDriverModel.c
@@ -1,7 +1,8 @@
 /** @file
   Library functions that abstract driver model protocols
-  installation.
+  installation and uninstallation.
 
+  Copyright (c) 2019, NVIDIA Corporation. All rights reserved.
   Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials are
   licensed and made available under the terms and conditions of the BSD License
@@ -71,6 +72,44 @@ EfiLibInstallDriverBinding (
 }
 
 
+
+/**
+  Uninstalls a Driver Binding Protocol instance.
+
+  If DriverBinding is NULL, then ASSERT().
+  If DriverBinding can not be uninstalled, then ASSERT().
+
+  @param  DriverBinding        A Driver Binding Protocol instance that this driver produced.
+
+  @retval EFI_SUCCESS           The protocol uninstallation successfully completed.
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().
+
+**/
+EFI_STATUS
+EFIAPI
+EfiLibUninstallDriverBinding (
+  IN EFI_DRIVER_BINDING_PROTOCOL  *DriverBinding
+  )
+{
+  EFI_STATUS  Status;
+
+  ASSERT (DriverBinding != NULL);
+
+  Status = gBS->UninstallMultipleProtocolInterfaces (
+                  DriverBinding->DriverBindingHandle,
+                  &gEfiDriverBindingProtocolGuid, DriverBinding,
+                  NULL
+                  );
+  //
+  // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed
+  //
+  ASSERT_EFI_ERROR (Status);
+
+  return Status;
+}
+
+
+
 /**
   Installs and completes the initialization of a Driver Binding Protocol instance and
   optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols.
@@ -204,6 +243,119 @@ EfiLibInstallAllDriverProtocols (
 
 
 /**
+  Uninstalls a Driver Binding Protocol instance and optionally uninstalls the
+  Component Name, Driver Configuration and Driver Diagnostics Protocols.
+
+  If DriverBinding is NULL, then ASSERT().
+  If the uninstallation fails, then ASSERT().
+
+  @param  DriverBinding        A Driver Binding Protocol instance that this driver produced.
+  @param  ComponentName        A Component Name Protocol instance that this driver produced.
+  @param  DriverConfiguration  A Driver Configuration Protocol instance that this driver produced.
+  @param  DriverDiagnostics    A Driver Diagnostics Protocol instance that this driver produced.
+
+  @retval EFI_SUCCESS           The protocol uninstallation successfully completed.
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().
+
+**/
+EFI_STATUS
+EFIAPI
+EfiLibUninstallAllDriverProtocols (
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL
+  IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL  *DriverConfiguration, OPTIONAL
+  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL    *DriverDiagnostics    OPTIONAL
+  )
+{
+  EFI_STATUS  Status;
+
+  ASSERT (DriverBinding != NULL);
+
+  if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {
+    if (DriverConfiguration == NULL) {
+      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+        Status = gBS->UninstallMultipleProtocolInterfaces (
+                        DriverBinding->DriverBindingHandle,
+                        &gEfiDriverBindingProtocolGuid, DriverBinding,
+                        NULL
+                        );
+      } else {
+        Status = gBS->UninstallMultipleProtocolInterfaces (
+                        DriverBinding->DriverBindingHandle,
+                        &gEfiDriverBindingProtocolGuid, DriverBinding,
+                        &gEfiComponentNameProtocolGuid, ComponentName,
+                        NULL
+                        );
+      }
+    } else {
+      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+        Status = gBS->UninstallMultipleProtocolInterfaces (
+                        DriverBinding->DriverBindingHandle,
+                        &gEfiDriverBindingProtocolGuid,       DriverBinding,
+                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                        NULL
+                        );
+      } else {
+        Status = gBS->UninstallMultipleProtocolInterfaces (
+                        DriverBinding->DriverBindingHandle,
+                        &gEfiDriverBindingProtocolGuid,       DriverBinding,
+                        &gEfiComponentNameProtocolGuid,       ComponentName,
+                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                        NULL
+                        );
+      }
+    }
+  } else {
+    if (DriverConfiguration == NULL) {
+      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+        Status = gBS->UninstallMultipleProtocolInterfaces (
+                        DriverBinding->DriverBindingHandle,
+                        &gEfiDriverBindingProtocolGuid,     DriverBinding,
+                        &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                        NULL
+                        );
+      } else {
+        Status = gBS->UninstallMultipleProtocolInterfaces (
+                        DriverBinding->DriverBindingHandle,
+                        &gEfiDriverBindingProtocolGuid,     DriverBinding,
+                        &gEfiComponentNameProtocolGuid,     ComponentName,
+                        &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                        NULL
+                        );
+      }
+    } else {
+      if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+       Status = gBS->UninstallMultipleProtocolInterfaces (
+                        DriverBinding->DriverBindingHandle,
+                        &gEfiDriverBindingProtocolGuid,       DriverBinding,
+                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                        &gEfiDriverDiagnosticsProtocolGuid,   DriverDiagnostics,
+                        NULL
+                        );
+      } else {
+        Status = gBS->UninstallMultipleProtocolInterfaces (
+                        DriverBinding->DriverBindingHandle,
+                        &gEfiDriverBindingProtocolGuid,       DriverBinding,
+                        &gEfiComponentNameProtocolGuid,       ComponentName,
+                        &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                        &gEfiDriverDiagnosticsProtocolGuid,   DriverDiagnostics,
+                        NULL
+                        );
+      }
+    }
+  }
+
+  //
+  // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed
+  //
+  ASSERT_EFI_ERROR (Status);
+
+  return Status;
+}
+
+
+
+/**
   Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.
 
   Initializes a driver by installing the Driver Binding Protocol together with the
@@ -292,6 +444,76 @@ EfiLibInstallDriverBindingComponentName2 (
 
 
 /**
+  Uninstalls Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.
+
+  If DriverBinding is NULL, then ASSERT().
+  If the uninstallation fails, then ASSERT().
+
+  @param  DriverBinding        A Driver Binding Protocol instance that this driver produced.
+  @param  ComponentName        A Component Name Protocol instance that this driver produced.
+  @param  ComponentName2       A Component Name 2 Protocol instance that this driver produced.
+
+  @retval EFI_SUCCESS           The protocol installation successfully completed.
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().
+
+**/
+EFI_STATUS
+EFIAPI
+EfiLibUninstallDriverBindingComponentName2 (
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,       OPTIONAL
+  IN CONST EFI_COMPONENT_NAME2_PROTOCOL       *ComponentName2       OPTIONAL
+  )
+{
+  EFI_STATUS  Status;
+
+  ASSERT (DriverBinding != NULL);
+
+  if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+    if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+      Status = gBS->UninstallMultipleProtocolInterfaces (
+                      DriverBinding->DriverBindingHandle,
+                      &gEfiDriverBindingProtocolGuid, DriverBinding,
+                      NULL
+                      );
+      } else {
+      Status = gBS->UninstallMultipleProtocolInterfaces (
+                      DriverBinding->DriverBindingHandle,
+                      &gEfiDriverBindingProtocolGuid, DriverBinding,
+                      &gEfiComponentName2ProtocolGuid, ComponentName2,
+                      NULL
+                      );
+     }
+  } else {
+     if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+       Status = gBS->UninstallMultipleProtocolInterfaces (
+                       DriverBinding->DriverBindingHandle,
+                       &gEfiDriverBindingProtocolGuid, DriverBinding,
+                       &gEfiComponentNameProtocolGuid, ComponentName,
+                       NULL
+                       );
+     } else {
+       Status = gBS->UninstallMultipleProtocolInterfaces (
+                       DriverBinding->DriverBindingHandle,
+                       &gEfiDriverBindingProtocolGuid, DriverBinding,
+                       &gEfiComponentNameProtocolGuid, ComponentName,
+                       &gEfiComponentName2ProtocolGuid, ComponentName2,
+                       NULL
+                       );
+    }
+  }
+
+  //
+  // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed
+  //
+  ASSERT_EFI_ERROR (Status);
+
+  return Status;
+}
+
+
+
+/**
   Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver
   Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.
 
@@ -1054,3 +1276,751 @@ EfiLibInstallAllDriverProtocols2 (
 
   return Status;
 }
+
+
+
+/**
+  Uninstalls Driver Binding Protocol with optional Component Name, Component Name 2, Driver
+  Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.
+
+  If DriverBinding is NULL, then ASSERT().
+  If the installation fails, then ASSERT().
+
+
+  @param  DriverBinding         A Driver Binding Protocol instance that this driver produced.
+  @param  ComponentName         A Component Name Protocol instance that this driver produced.
+  @param  ComponentName2        A Component Name 2 Protocol instance that this driver produced.
+  @param  DriverConfiguration   A Driver Configuration Protocol instance that this driver produced.
+  @param  DriverConfiguration2  A Driver Configuration Protocol 2 instance that this driver produced.
+  @param  DriverDiagnostics     A Driver Diagnostics Protocol instance that this driver produced.
+  @param  DriverDiagnostics2    A Driver Diagnostics Protocol 2 instance that this driver produced.
+
+  @retval EFI_SUCCESS           The protocol uninstallation successfully completed.
+  @retval Others                Status from gBS->UninstallMultipleProtocolInterfaces().
+
+**/
+EFI_STATUS
+EFIAPI
+EfiLibUninstallAllDriverProtocols2 (
+  IN EFI_DRIVER_BINDING_PROTOCOL              *DriverBinding,
+  IN CONST EFI_COMPONENT_NAME_PROTOCOL        *ComponentName,        OPTIONAL
+  IN CONST EFI_COMPONENT_NAME2_PROTOCOL       *ComponentName2,       OPTIONAL
+  IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL  *DriverConfiguration,  OPTIONAL
+  IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2, OPTIONAL
+  IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL    *DriverDiagnostics,    OPTIONAL
+  IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL   *DriverDiagnostics2    OPTIONAL
+  )
+{
+  EFI_STATUS  Status;
+
+  ASSERT (DriverBinding != NULL);
+
+  if (DriverConfiguration2 == NULL) {
+    if (DriverConfiguration == NULL) {
+      if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {
+        if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              NULL
+                              );
+            }
+          }
+        } else {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          }
+        }
+      } else {
+        if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            }
+          }
+        } else {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          }
+        }
+      }
+    } else {
+      if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {
+        if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              NULL
+                              );
+            }
+          }
+        } else {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          }
+        }
+      } else {
+        if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            }
+          }
+        } else {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          }
+        }
+      }
+    }
+  } else {
+    if (DriverConfiguration == NULL) {
+      if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {
+        if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              NULL
+                              );
+            }
+          }
+        } else {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          }
+        }
+      } else {
+        if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            }
+          }
+        } else {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          }
+        }
+      }
+    } else {
+      if (DriverDiagnostics == NULL || FeaturePcdGet(PcdDriverDiagnosticsDisable)) {
+        if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              NULL
+                              );
+            }
+          }
+        } else {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          }
+        }
+      } else {
+        if (DriverDiagnostics2 == NULL || FeaturePcdGet(PcdDriverDiagnostics2Disable)) {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              NULL
+                              );
+            }
+          }
+        } else {
+          if (ComponentName == NULL || FeaturePcdGet(PcdComponentNameDisable)) {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          } else {
+            if (ComponentName2 == NULL || FeaturePcdGet(PcdComponentName2Disable)) {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            } else {
+              Status = gBS->UninstallMultipleProtocolInterfaces (
+                              DriverBinding->DriverBindingHandle,
+                              &gEfiDriverBindingProtocolGuid, DriverBinding,
+                              &gEfiComponentNameProtocolGuid, ComponentName,
+                              &gEfiComponentName2ProtocolGuid, ComponentName2,
+                              &gEfiDriverConfigurationProtocolGuid, DriverConfiguration,
+                              &gEfiDriverConfiguration2ProtocolGuid, DriverConfiguration2,
+                              &gEfiDriverDiagnosticsProtocolGuid, DriverDiagnostics,
+                              &gEfiDriverDiagnostics2ProtocolGuid, DriverDiagnostics2,
+                              NULL
+                              );
+            }
+          }
+        }
+      }
+    }
+  }
+
+  //
+  // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed
+  //
+  ASSERT_EFI_ERROR (Status);
+
+  return Status;
+}
-- 
2.7.4



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

* [PATCH v4 2/2] NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.
  2019-01-09 20:58 [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation Ashish Singhal
  2019-01-09 20:58 ` [PATCH v4 1/2] MdePkg/UefiLib: Abstract driver model " Ashish Singhal
@ 2019-01-09 20:58 ` Ashish Singhal
  2019-01-10  0:55 ` [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation Kinney, Michael D
  2 siblings, 0 replies; 9+ messages in thread
From: Ashish Singhal @ 2019-01-09 20:58 UTC (permalink / raw)
  To: edk2-devel
  Cc: michael.d.kinney, liming.gao, siyuan.fu, jiaxin.wu,
	Ashish Singhal

During cleanup in case of initialization failure, some driver
bindings are not installed. Using abstractions in UEFILib takes
care of it.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1428

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
---
 NetworkPkg/IScsiDxe/IScsiDriver.c | 31 +++++++++++--------------------
 1 file changed, 11 insertions(+), 20 deletions(-)

diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c b/NetworkPkg/IScsiDxe/IScsiDriver.c
index 91176e6..8747de7 100644
--- a/NetworkPkg/IScsiDxe/IScsiDriver.c
+++ b/NetworkPkg/IScsiDxe/IScsiDriver.c
@@ -1,6 +1,7 @@
 /** @file
   The entry point of IScsi driver.
 
+Copyright (c) 2019, NVIDIA Corporation. All rights reserved.
 Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
 (C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>
 
@@ -1861,28 +1862,18 @@ Error3:
          );
 
 Error2:
-  gBS->UninstallMultipleProtocolInterfaces (
-         gIScsiIp6DriverBinding.DriverBindingHandle,
-         &gEfiDriverBindingProtocolGuid,
-         &gIScsiIp6DriverBinding,
-         &gEfiComponentName2ProtocolGuid,
-         &gIScsiComponentName2,
-         &gEfiComponentNameProtocolGuid,
-         &gIScsiComponentName,
-         NULL
-         );
+  EfiLibUninstallDriverBindingComponentName2 (
+    &gIScsiIp6DriverBinding,
+    &gIScsiComponentName,
+    &gIScsiComponentName2
+    );
 
 Error1:
-  gBS->UninstallMultipleProtocolInterfaces (
-         ImageHandle,
-         &gEfiDriverBindingProtocolGuid,
-         &gIScsiIp4DriverBinding,
-         &gEfiComponentName2ProtocolGuid,
-         &gIScsiComponentName2,
-         &gEfiComponentNameProtocolGuid,
-         &gIScsiComponentName,
-         NULL
-         );
+  EfiLibUninstallDriverBindingComponentName2 (
+    &gIScsiIp4DriverBinding,
+    &gIScsiComponentName,
+    &gIScsiComponentName2
+    );
 
   return Status;
 }
-- 
2.7.4



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

* Re: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
  2019-01-09 20:58 [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation Ashish Singhal
  2019-01-09 20:58 ` [PATCH v4 1/2] MdePkg/UefiLib: Abstract driver model " Ashish Singhal
  2019-01-09 20:58 ` [PATCH v4 2/2] NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols Ashish Singhal
@ 2019-01-10  0:55 ` Kinney, Michael D
  2019-01-10  1:18   ` Ashish Singhal
  2 siblings, 1 reply; 9+ messages in thread
From: Kinney, Michael D @ 2019-01-10  0:55 UTC (permalink / raw)
  To: Ashish Singhal, edk2-devel@lists.01.org, Kinney, Michael D
  Cc: Gao, Liming, Fu, Siyuan, Wu, Jiaxin

Hi Ashish,

This V4 version of the patch produces the expected size 
results for platform and driver builds.

There are some very minor issues with some extra carriage
returns, but those can be handled by Liming when the patch
series is committed.

I may be good to have an additional BZ to use these new
APIs from all UEFI Driver Model drivers that have failure
paths in their entry point or support the unload feature.
Those updates can be done later.

Thanks,

Mike

> -----Original Message-----
> From: Ashish Singhal [mailto:ashishsingha@nvidia.com]
> Sent: Wednesday, January 9, 2019 12:59 PM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao,
> Liming <liming.gao@intel.com>; Fu, Siyuan
> <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>;
> Ashish Singhal <ashishsingha@nvidia.com>
> Subject: [PATCH v4 0/2] Provide UEFILib functions for
> protocol uninstallation
> 
> An issue was seen in IScsiDxe in NetworkPkg where driver
> cleanup after
> initialization failure was not done right. Bug 1428 was
> filed in this regard.
> As per discussions with Mike, it was also discussed that
> having UEFILib
> provide protocol uninstallation abstraction would help
> to avoid these
> issues in the future. Bug 1429 was found to track this.
> These 2 patches
> take care of this.
> 
> 
> Ashish Singhal (2):
>   MdePkg/UefiLib: Abstract driver model protocol
> uninstallation
>   NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall
> protocols.
> 
>  MdePkg/Include/Library/UefiLib.h         | 103 ++++
>  MdePkg/Library/UefiLib/UefiDriverModel.c | 972
> ++++++++++++++++++++++++++++++-
>  NetworkPkg/IScsiDxe/IScsiDriver.c        |  31 +-
>  3 files changed, 1085 insertions(+), 21 deletions(-)
> 
> --
> 2.7.4



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

* Re: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
  2019-01-10  0:55 ` [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation Kinney, Michael D
@ 2019-01-10  1:18   ` Ashish Singhal
  2019-01-10 15:22     ` Gao, Liming
  0 siblings, 1 reply; 9+ messages in thread
From: Ashish Singhal @ 2019-01-10  1:18 UTC (permalink / raw)
  To: Kinney, Michael D, edk2-devel@lists.01.org
  Cc: Gao, Liming, Fu, Siyuan, Wu, Jiaxin

Thanks Mike. Hope to see the patches merged soon. Please let me know if you want me to file the BZ.

Hi Liming,

Please let me know if you need me to take care of anything in the patch before you push it.

Hi Siyuan/Jiaxin,

I think you reviewed the changes in PATCH v2 which is same as in PATCH v4. Please let me know if you have any issues with this going in.

Thanks
Ashish

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Wednesday, January 9, 2019 5:56 PM
To: Ashish Singhal <ashishsingha@nvidia.com>; edk2-devel@lists.01.org; Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Gao, Liming <liming.gao@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: RE: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation

Hi Ashish,

This V4 version of the patch produces the expected size results for platform and driver builds.

There are some very minor issues with some extra carriage returns, but those can be handled by Liming when the patch series is committed.

I may be good to have an additional BZ to use these new APIs from all UEFI Driver Model drivers that have failure paths in their entry point or support the unload feature.
Those updates can be done later.

Thanks,

Mike

> -----Original Message-----
> From: Ashish Singhal [mailto:ashishsingha@nvidia.com]
> Sent: Wednesday, January 9, 2019 12:59 PM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming 
> <liming.gao@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin 
> <jiaxin.wu@intel.com>; Ashish Singhal <ashishsingha@nvidia.com>
> Subject: [PATCH v4 0/2] Provide UEFILib functions for protocol 
> uninstallation
> 
> An issue was seen in IScsiDxe in NetworkPkg where driver cleanup after 
> initialization failure was not done right. Bug 1428 was filed in this 
> regard.
> As per discussions with Mike, it was also discussed that having 
> UEFILib provide protocol uninstallation abstraction would help to 
> avoid these issues in the future. Bug 1429 was found to track this.
> These 2 patches
> take care of this.
> 
> 
> Ashish Singhal (2):
>   MdePkg/UefiLib: Abstract driver model protocol uninstallation
>   NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.
> 
>  MdePkg/Include/Library/UefiLib.h         | 103 ++++
>  MdePkg/Library/UefiLib/UefiDriverModel.c | 972
> ++++++++++++++++++++++++++++++-
>  NetworkPkg/IScsiDxe/IScsiDriver.c        |  31 +-
>  3 files changed, 1085 insertions(+), 21 deletions(-)
> 
> --
> 2.7.4

-----------------------------------------------------------------------------------
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] 9+ messages in thread

* Re: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
  2019-01-10  1:18   ` Ashish Singhal
@ 2019-01-10 15:22     ` Gao, Liming
  2019-01-10 15:33       ` Ashish Singhal
  0 siblings, 1 reply; 9+ messages in thread
From: Gao, Liming @ 2019-01-10 15:22 UTC (permalink / raw)
  To: Ashish Singhal, Kinney, Michael D, edk2-devel@lists.01.org
  Cc: Fu, Siyuan, Wu, Jiaxin

Ashish:
  The MdePkg change is good to me. Reviewed-by: Liming Gao <liming.gao@intel.com>
  Please help submit another BZ to update UefiDriver to uninstall protocol when failure with new APIs. 
  
  If Siyuan/Jiaxin has no other comments, I will help push this patch set. 

Thanks
Liming
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ashish Singhal
> Sent: Thursday, January 10, 2019 9:19 AM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: Re: [edk2] [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
> 
> Thanks Mike. Hope to see the patches merged soon. Please let me know if you want me to file the BZ.
> 
> Hi Liming,
> 
> Please let me know if you need me to take care of anything in the patch before you push it.
> 
> Hi Siyuan/Jiaxin,
> 
> I think you reviewed the changes in PATCH v2 which is same as in PATCH v4. Please let me know if you have any issues with this going in.
> 
> Thanks
> Ashish
> 
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Wednesday, January 9, 2019 5:56 PM
> To: Ashish Singhal <ashishsingha@nvidia.com>; edk2-devel@lists.01.org; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Gao, Liming <liming.gao@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: RE: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
> 
> Hi Ashish,
> 
> This V4 version of the patch produces the expected size results for platform and driver builds.
> 
> There are some very minor issues with some extra carriage returns, but those can be handled by Liming when the patch series is
> committed.
> 
> I may be good to have an additional BZ to use these new APIs from all UEFI Driver Model drivers that have failure paths in their entry
> point or support the unload feature.
> Those updates can be done later.
> 
> Thanks,
> 
> Mike
> 
> > -----Original Message-----
> > From: Ashish Singhal [mailto:ashishsingha@nvidia.com]
> > Sent: Wednesday, January 9, 2019 12:59 PM
> > To: edk2-devel@lists.01.org
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> > <liming.gao@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin
> > <jiaxin.wu@intel.com>; Ashish Singhal <ashishsingha@nvidia.com>
> > Subject: [PATCH v4 0/2] Provide UEFILib functions for protocol
> > uninstallation
> >
> > An issue was seen in IScsiDxe in NetworkPkg where driver cleanup after
> > initialization failure was not done right. Bug 1428 was filed in this
> > regard.
> > As per discussions with Mike, it was also discussed that having
> > UEFILib provide protocol uninstallation abstraction would help to
> > avoid these issues in the future. Bug 1429 was found to track this.
> > These 2 patches
> > take care of this.
> >
> >
> > Ashish Singhal (2):
> >   MdePkg/UefiLib: Abstract driver model protocol uninstallation
> >   NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.
> >
> >  MdePkg/Include/Library/UefiLib.h         | 103 ++++
> >  MdePkg/Library/UefiLib/UefiDriverModel.c | 972
> > ++++++++++++++++++++++++++++++-
> >  NetworkPkg/IScsiDxe/IScsiDriver.c        |  31 +-
> >  3 files changed, 1085 insertions(+), 21 deletions(-)
> >
> > --
> > 2.7.4
> 
> -----------------------------------------------------------------------------------
> 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.
> -----------------------------------------------------------------------------------
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


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

* Re: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
  2019-01-10 15:22     ` Gao, Liming
@ 2019-01-10 15:33       ` Ashish Singhal
  2019-01-10 15:39         ` Gao, Liming
  0 siblings, 1 reply; 9+ messages in thread
From: Ashish Singhal @ 2019-01-10 15:33 UTC (permalink / raw)
  To: Gao, Liming, Kinney, Michael D, edk2-devel@lists.01.org
  Cc: Fu, Siyuan, Wu, Jiaxin

Thanks Liming. I have files BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1444 to update UEFI drivers to use new APIs. I have not assigned it to anyone as there are many drivers across packages that need to be looked at. I would try to fix the ones I hit an issue with.

Over the weekend Siyuan approved the patch from PATCH v2 which is exactly same as in PATCH v4.

Thanks
Ashish

-----Original Message-----
From: Gao, Liming <liming.gao@intel.com> 
Sent: Thursday, January 10, 2019 8:23 AM
To: Ashish Singhal <ashishsingha@nvidia.com>; Kinney, Michael D <michael.d.kinney@intel.com>; edk2-devel@lists.01.org
Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: RE: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation

Ashish:
  The MdePkg change is good to me. Reviewed-by: Liming Gao <liming.gao@intel.com>
  Please help submit another BZ to update UefiDriver to uninstall protocol when failure with new APIs. 
  
  If Siyuan/Jiaxin has no other comments, I will help push this patch set. 

Thanks
Liming
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of 
> Ashish Singhal
> Sent: Thursday, January 10, 2019 9:19 AM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; 
> edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin 
> <jiaxin.wu@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: Re: [edk2] [PATCH v4 0/2] Provide UEFILib functions for 
> protocol uninstallation
> 
> Thanks Mike. Hope to see the patches merged soon. Please let me know if you want me to file the BZ.
> 
> Hi Liming,
> 
> Please let me know if you need me to take care of anything in the patch before you push it.
> 
> Hi Siyuan/Jiaxin,
> 
> I think you reviewed the changes in PATCH v2 which is same as in PATCH v4. Please let me know if you have any issues with this going in.
> 
> Thanks
> Ashish
> 
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Wednesday, January 9, 2019 5:56 PM
> To: Ashish Singhal <ashishsingha@nvidia.com>; edk2-devel@lists.01.org; 
> Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Gao, Liming <liming.gao@intel.com>; Fu, Siyuan 
> <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: RE: [PATCH v4 0/2] Provide UEFILib functions for protocol 
> uninstallation
> 
> Hi Ashish,
> 
> This V4 version of the patch produces the expected size results for platform and driver builds.
> 
> There are some very minor issues with some extra carriage returns, but 
> those can be handled by Liming when the patch series is committed.
> 
> I may be good to have an additional BZ to use these new APIs from all 
> UEFI Driver Model drivers that have failure paths in their entry point or support the unload feature.
> Those updates can be done later.
> 
> Thanks,
> 
> Mike
> 
> > -----Original Message-----
> > From: Ashish Singhal [mailto:ashishsingha@nvidia.com]
> > Sent: Wednesday, January 9, 2019 12:59 PM
> > To: edk2-devel@lists.01.org
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming 
> > <liming.gao@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin 
> > <jiaxin.wu@intel.com>; Ashish Singhal <ashishsingha@nvidia.com>
> > Subject: [PATCH v4 0/2] Provide UEFILib functions for protocol 
> > uninstallation
> >
> > An issue was seen in IScsiDxe in NetworkPkg where driver cleanup 
> > after initialization failure was not done right. Bug 1428 was filed 
> > in this regard.
> > As per discussions with Mike, it was also discussed that having 
> > UEFILib provide protocol uninstallation abstraction would help to 
> > avoid these issues in the future. Bug 1429 was found to track this.
> > These 2 patches
> > take care of this.
> >
> >
> > Ashish Singhal (2):
> >   MdePkg/UefiLib: Abstract driver model protocol uninstallation
> >   NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.
> >
> >  MdePkg/Include/Library/UefiLib.h         | 103 ++++
> >  MdePkg/Library/UefiLib/UefiDriverModel.c | 972
> > ++++++++++++++++++++++++++++++-
> >  NetworkPkg/IScsiDxe/IScsiDriver.c        |  31 +-
> >  3 files changed, 1085 insertions(+), 21 deletions(-)
> >
> > --
> > 2.7.4
> 
> ----------------------------------------------------------------------
> ------------- 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.
> ----------------------------------------------------------------------
> ------------- _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


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

* Re: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
  2019-01-10 15:33       ` Ashish Singhal
@ 2019-01-10 15:39         ` Gao, Liming
  2019-01-10 15:40           ` Ashish Singhal
  0 siblings, 1 reply; 9+ messages in thread
From: Gao, Liming @ 2019-01-10 15:39 UTC (permalink / raw)
  To: Ashish Singhal, Kinney, Michael D, edk2-devel@lists.01.org
  Cc: Fu, Siyuan, Wu, Jiaxin

Pushed them at 0290fca..15666b

> -----Original Message-----
> From: Ashish Singhal [mailto:ashishsingha@nvidia.com]
> Sent: Thursday, January 10, 2019 11:33 PM
> To: Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: RE: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
> 
> Thanks Liming. I have files BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1444 to update UEFI drivers to use new APIs. I have not
> assigned it to anyone as there are many drivers across packages that need to be looked at. I would try to fix the ones I hit an issue with.
> 
> Over the weekend Siyuan approved the patch from PATCH v2 which is exactly same as in PATCH v4.
> 
> Thanks
> Ashish
> 
> -----Original Message-----
> From: Gao, Liming <liming.gao@intel.com>
> Sent: Thursday, January 10, 2019 8:23 AM
> To: Ashish Singhal <ashishsingha@nvidia.com>; Kinney, Michael D <michael.d.kinney@intel.com>; edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: RE: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
> 
> Ashish:
>   The MdePkg change is good to me. Reviewed-by: Liming Gao <liming.gao@intel.com>
>   Please help submit another BZ to update UefiDriver to uninstall protocol when failure with new APIs.
> 
>   If Siyuan/Jiaxin has no other comments, I will help push this patch set.
> 
> Thanks
> Liming
> > -----Original Message-----
> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> > Ashish Singhal
> > Sent: Thursday, January 10, 2019 9:19 AM
> > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > edk2-devel@lists.01.org
> > Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin
> > <jiaxin.wu@intel.com>; Gao, Liming <liming.gao@intel.com>
> > Subject: Re: [edk2] [PATCH v4 0/2] Provide UEFILib functions for
> > protocol uninstallation
> >
> > Thanks Mike. Hope to see the patches merged soon. Please let me know if you want me to file the BZ.
> >
> > Hi Liming,
> >
> > Please let me know if you need me to take care of anything in the patch before you push it.
> >
> > Hi Siyuan/Jiaxin,
> >
> > I think you reviewed the changes in PATCH v2 which is same as in PATCH v4. Please let me know if you have any issues with this going
> in.
> >
> > Thanks
> > Ashish
> >
> > -----Original Message-----
> > From: Kinney, Michael D <michael.d.kinney@intel.com>
> > Sent: Wednesday, January 9, 2019 5:56 PM
> > To: Ashish Singhal <ashishsingha@nvidia.com>; edk2-devel@lists.01.org;
> > Kinney, Michael D <michael.d.kinney@intel.com>
> > Cc: Gao, Liming <liming.gao@intel.com>; Fu, Siyuan
> > <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> > Subject: RE: [PATCH v4 0/2] Provide UEFILib functions for protocol
> > uninstallation
> >
> > Hi Ashish,
> >
> > This V4 version of the patch produces the expected size results for platform and driver builds.
> >
> > There are some very minor issues with some extra carriage returns, but
> > those can be handled by Liming when the patch series is committed.
> >
> > I may be good to have an additional BZ to use these new APIs from all
> > UEFI Driver Model drivers that have failure paths in their entry point or support the unload feature.
> > Those updates can be done later.
> >
> > Thanks,
> >
> > Mike
> >
> > > -----Original Message-----
> > > From: Ashish Singhal [mailto:ashishsingha@nvidia.com]
> > > Sent: Wednesday, January 9, 2019 12:59 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> > > <liming.gao@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin
> > > <jiaxin.wu@intel.com>; Ashish Singhal <ashishsingha@nvidia.com>
> > > Subject: [PATCH v4 0/2] Provide UEFILib functions for protocol
> > > uninstallation
> > >
> > > An issue was seen in IScsiDxe in NetworkPkg where driver cleanup
> > > after initialization failure was not done right. Bug 1428 was filed
> > > in this regard.
> > > As per discussions with Mike, it was also discussed that having
> > > UEFILib provide protocol uninstallation abstraction would help to
> > > avoid these issues in the future. Bug 1429 was found to track this.
> > > These 2 patches
> > > take care of this.
> > >
> > >
> > > Ashish Singhal (2):
> > >   MdePkg/UefiLib: Abstract driver model protocol uninstallation
> > >   NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.
> > >
> > >  MdePkg/Include/Library/UefiLib.h         | 103 ++++
> > >  MdePkg/Library/UefiLib/UefiDriverModel.c | 972
> > > ++++++++++++++++++++++++++++++-
> > >  NetworkPkg/IScsiDxe/IScsiDriver.c        |  31 +-
> > >  3 files changed, 1085 insertions(+), 21 deletions(-)
> > >
> > > --
> > > 2.7.4
> >
> > ----------------------------------------------------------------------
> > ------------- 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.
> > ----------------------------------------------------------------------
> > ------------- _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel


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

* Re: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
  2019-01-10 15:39         ` Gao, Liming
@ 2019-01-10 15:40           ` Ashish Singhal
  0 siblings, 0 replies; 9+ messages in thread
From: Ashish Singhal @ 2019-01-10 15:40 UTC (permalink / raw)
  To: Gao, Liming, Kinney, Michael D, edk2-devel@lists.01.org
  Cc: Fu, Siyuan, Wu, Jiaxin

Thanks everyone.

-----Original Message-----
From: Gao, Liming <liming.gao@intel.com> 
Sent: Thursday, January 10, 2019 8:39 AM
To: Ashish Singhal <ashishsingha@nvidia.com>; Kinney, Michael D <michael.d.kinney@intel.com>; edk2-devel@lists.01.org
Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: RE: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation

Pushed them at 0290fca..15666b

> -----Original Message-----
> From: Ashish Singhal [mailto:ashishsingha@nvidia.com]
> Sent: Thursday, January 10, 2019 11:33 PM
> To: Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: RE: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
> 
> Thanks Liming. I have files BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1444 to update UEFI drivers to use new APIs. I have not
> assigned it to anyone as there are many drivers across packages that need to be looked at. I would try to fix the ones I hit an issue with.
> 
> Over the weekend Siyuan approved the patch from PATCH v2 which is exactly same as in PATCH v4.
> 
> Thanks
> Ashish
> 
> -----Original Message-----
> From: Gao, Liming <liming.gao@intel.com>
> Sent: Thursday, January 10, 2019 8:23 AM
> To: Ashish Singhal <ashishsingha@nvidia.com>; Kinney, Michael D <michael.d.kinney@intel.com>; edk2-devel@lists.01.org
> Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: RE: [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation
> 
> Ashish:
>   The MdePkg change is good to me. Reviewed-by: Liming Gao <liming.gao@intel.com>
>   Please help submit another BZ to update UefiDriver to uninstall protocol when failure with new APIs.
> 
>   If Siyuan/Jiaxin has no other comments, I will help push this patch set.
> 
> Thanks
> Liming
> > -----Original Message-----
> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> > Ashish Singhal
> > Sent: Thursday, January 10, 2019 9:19 AM
> > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > edk2-devel@lists.01.org
> > Cc: Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin
> > <jiaxin.wu@intel.com>; Gao, Liming <liming.gao@intel.com>
> > Subject: Re: [edk2] [PATCH v4 0/2] Provide UEFILib functions for
> > protocol uninstallation
> >
> > Thanks Mike. Hope to see the patches merged soon. Please let me know if you want me to file the BZ.
> >
> > Hi Liming,
> >
> > Please let me know if you need me to take care of anything in the patch before you push it.
> >
> > Hi Siyuan/Jiaxin,
> >
> > I think you reviewed the changes in PATCH v2 which is same as in PATCH v4. Please let me know if you have any issues with this going
> in.
> >
> > Thanks
> > Ashish
> >
> > -----Original Message-----
> > From: Kinney, Michael D <michael.d.kinney@intel.com>
> > Sent: Wednesday, January 9, 2019 5:56 PM
> > To: Ashish Singhal <ashishsingha@nvidia.com>; edk2-devel@lists.01.org;
> > Kinney, Michael D <michael.d.kinney@intel.com>
> > Cc: Gao, Liming <liming.gao@intel.com>; Fu, Siyuan
> > <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> > Subject: RE: [PATCH v4 0/2] Provide UEFILib functions for protocol
> > uninstallation
> >
> > Hi Ashish,
> >
> > This V4 version of the patch produces the expected size results for platform and driver builds.
> >
> > There are some very minor issues with some extra carriage returns, but
> > those can be handled by Liming when the patch series is committed.
> >
> > I may be good to have an additional BZ to use these new APIs from all
> > UEFI Driver Model drivers that have failure paths in their entry point or support the unload feature.
> > Those updates can be done later.
> >
> > Thanks,
> >
> > Mike
> >
> > > -----Original Message-----
> > > From: Ashish Singhal [mailto:ashishsingha@nvidia.com]
> > > Sent: Wednesday, January 9, 2019 12:59 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> > > <liming.gao@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin
> > > <jiaxin.wu@intel.com>; Ashish Singhal <ashishsingha@nvidia.com>
> > > Subject: [PATCH v4 0/2] Provide UEFILib functions for protocol
> > > uninstallation
> > >
> > > An issue was seen in IScsiDxe in NetworkPkg where driver cleanup
> > > after initialization failure was not done right. Bug 1428 was filed
> > > in this regard.
> > > As per discussions with Mike, it was also discussed that having
> > > UEFILib provide protocol uninstallation abstraction would help to
> > > avoid these issues in the future. Bug 1429 was found to track this.
> > > These 2 patches
> > > take care of this.
> > >
> > >
> > > Ashish Singhal (2):
> > >   MdePkg/UefiLib: Abstract driver model protocol uninstallation
> > >   NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols.
> > >
> > >  MdePkg/Include/Library/UefiLib.h         | 103 ++++
> > >  MdePkg/Library/UefiLib/UefiDriverModel.c | 972
> > > ++++++++++++++++++++++++++++++-
> > >  NetworkPkg/IScsiDxe/IScsiDriver.c        |  31 +-
> > >  3 files changed, 1085 insertions(+), 21 deletions(-)
> > >
> > > --
> > > 2.7.4
> >
> > ----------------------------------------------------------------------
> > ------------- 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.
> > ----------------------------------------------------------------------
> > ------------- _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel


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

end of thread, other threads:[~2019-01-10 15:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-09 20:58 [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation Ashish Singhal
2019-01-09 20:58 ` [PATCH v4 1/2] MdePkg/UefiLib: Abstract driver model " Ashish Singhal
2019-01-09 20:58 ` [PATCH v4 2/2] NetworkPkg/IScsiDxe: Use UEFILib APIs to uninstall protocols Ashish Singhal
2019-01-10  0:55 ` [PATCH v4 0/2] Provide UEFILib functions for protocol uninstallation Kinney, Michael D
2019-01-10  1:18   ` Ashish Singhal
2019-01-10 15:22     ` Gao, Liming
2019-01-10 15:33       ` Ashish Singhal
2019-01-10 15:39         ` Gao, Liming
2019-01-10 15:40           ` Ashish Singhal

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