public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec
@ 2019-09-12  6:34 Heinrich Schuchardt
  2020-02-19  5:58 ` [edk2-devel] " Dandan Bi
  0 siblings, 1 reply; 5+ messages in thread
From: Heinrich Schuchardt @ 2019-09-12  6:34 UTC (permalink / raw)
  To: EDK II Development, Dandan Bi
  Cc: Eric Jin, Supreeth Venkatesh, Stephano Cetola, Hao A Wu,
	Jian J Wang, Liming Gao, Star Zang, Jiewen Yao, Laszlo Ersek,
	Heinrich Schuchardt

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

The UEFI spec requires that if any error occurs in
UninstallMultipleProtocolInterfaces(), EFI_INVALID_PARAMETER is returned
and not the return code of UninstallProtocolInterface().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
---
v3
        Use @retval instead of @return.
        The protocols are reinstalled in the same order in which they are
        uninstalled.
v2
	Adjust the subject line.
	Adjust the function comments to clarify the behavior.
	This replaces https://edk2.groups.io/g/devel/message/46974
---
 MdeModulePkg/Core/Dxe/Hand/Handle.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/Hand/Handle.c
index b2721b3ab2..81a13c6ae5 100644
--- a/MdeModulePkg/Core/Dxe/Hand/Handle.c
+++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c
@@ -802,20 +802,27 @@ Done:
 
 
 
-
 /**
   Uninstalls a list of protocol interface in the boot services environment.
-  This function calls UnisatllProtocolInterface() in a loop. This is
+  This function calls UninstallProtocolInterface() in a loop. This is
   basically a lib function to save space.
 
-  @param  Handle                 The handle to uninstall the protocol
+  If any errors are generated while the protocol interfaces are being
+  uninstalled, then the protocol interfaces uninstalled prior to the error will
+  be reinstalled and EFI_INVALID_PARAMETER will be returned.
+
+  @param  Handle                 The handle to uninstall the protocol interfaces
+                                 from.
   @param  ...                    EFI_GUID followed by protocol instance. A NULL
-                                 terminates the  list. The pairs are the
+                                 terminates the list. The pairs are the
                                  arguments to UninstallProtocolInterface(). All
                                  the protocols are added to Handle.
 
-  @return Status code
-
+  @retval EFI_SUCCESS            if all protocol interfaces where uninstalled.
+  @retval EFI_INVALID_PARAMETER  if any protocol interface could not be
+                                 uninstalled and an attempt was made to
+                                 reinstall previously uninstalled protocol
+                                 interfaces.
 **/
 EFI_STATUS
 EFIAPI
@@ -864,6 +871,7 @@ CoreUninstallMultipleProtocolInterfaces (
       CoreInstallProtocolInterface (&Handle, Protocol, EFI_NATIVE_INTERFACE, Interface);
     }
     VA_END (Args);
+    Status = EFI_INVALID_PARAMETER;
   }
 
   return Status;
-- 
2.20.1


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

* Re: [edk2-devel] [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec
  2019-09-12  6:34 [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec Heinrich Schuchardt
@ 2020-02-19  5:58 ` Dandan Bi
  2020-02-19  8:56   ` Laszlo Ersek
  2020-02-19 11:50   ` Heinrich Schuchardt
  0 siblings, 2 replies; 5+ messages in thread
From: Dandan Bi @ 2020-02-19  5:58 UTC (permalink / raw)
  To: devel@edk2.groups.io, xypron.glpk@gmx.de
  Cc: Jin, Eric, Supreeth Venkatesh, Stephano Cetola, Wu, Hao A,
	Wang, Jian J, Gao, Liming, Zeng, Star, Yao, Jiewen, Laszlo Ersek

This patch seems be reviewed but not submitted. Hope it can be covered in Q1 stable tag.

Thanks,
Dandan
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich Schuchardt
Sent: Thursday, September 12, 2019 2:34 PM
To: EDK II Development <devel@edk2.groups.io>; Bi, Dandan <dandan.bi@intel.com>
Cc: Jin, Eric <eric.jin@intel.com>; Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Stephano Cetola <stephano.cetola@linux.intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming <liming.gao@intel.com>; Zeng, Star <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Laszlo Ersek <lersek@redhat.com>; Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: [edk2-devel] [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec

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

The UEFI spec requires that if any error occurs in UninstallMultipleProtocolInterfaces(), EFI_INVALID_PARAMETER is returned and not the return code of UninstallProtocolInterface().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
---
v3
        Use @retval instead of @return.
        The protocols are reinstalled in the same order in which they are
        uninstalled.
v2
	Adjust the subject line.
	Adjust the function comments to clarify the behavior.
	This replaces https://edk2.groups.io/g/devel/message/46974
---
 MdeModulePkg/Core/Dxe/Hand/Handle.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/Hand/Handle.c
index b2721b3ab2..81a13c6ae5 100644
--- a/MdeModulePkg/Core/Dxe/Hand/Handle.c
+++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c
@@ -802,20 +802,27 @@ Done:
   - /**   Uninstalls a list of protocol interface in the boot services environment.-  This function calls UnisatllProtocolInterface() in a loop. This is+  This function calls UninstallProtocolInterface() in a loop. This is   basically a lib function to save space. -  @param  Handle                 The handle to uninstall the protocol+  If any errors are generated while the protocol interfaces are being+  uninstalled, then the protocol interfaces uninstalled prior to the error will+  be reinstalled and EFI_INVALID_PARAMETER will be returned.++  @param  Handle                 The handle to uninstall the protocol interfaces+                                 from.   @param  ...                    EFI_GUID followed by protocol instance. A NULL-                                 terminates the  list. The pairs are the+                                 terminates the list. The pairs are the                                  arguments to UninstallProtocolInterface(). All                                  the protocols are added to Handle. -  @return Status code-+  @retval EFI_SUCCESS            if all protocol interfaces where uninstalled.+  @retval EFI_INVALID_PARAMETER  if any protocol interface could not be+                                 uninstalled and an attempt was made to+                                 reinstall previously uninstalled protocol+                                 interfaces. **/ EFI_STATUS EFIAPI@@ -864,6 +871,7 @@ CoreUninstallMultipleProtocolInterfaces (
       CoreInstallProtocolInterface (&Handle, Protocol, EFI_NATIVE_INTERFACE, Interface);     }     VA_END (Args);+    Status = EFI_INVALID_PARAMETER;   }    return Status;-- 
2.20.1


-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47177): https://edk2.groups.io/g/devel/message/47177
Mute This Topic: https://groups.io/mt/34112406/1768738
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [dandan.bi@intel.com] -=-=-=-=-=-=


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

* Re: [edk2-devel] [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec
  2020-02-19  5:58 ` [edk2-devel] " Dandan Bi
@ 2020-02-19  8:56   ` Laszlo Ersek
  2020-02-19 15:43     ` Wang, Jian J
  2020-02-19 11:50   ` Heinrich Schuchardt
  1 sibling, 1 reply; 5+ messages in thread
From: Laszlo Ersek @ 2020-02-19  8:56 UTC (permalink / raw)
  To: dandan.bi, Wu, Hao A, Wang, Jian J
  Cc: devel, xypron.glpk, Jin, Eric, Supreeth Venkatesh,
	Stephano Cetola, Gao, Liming, Zeng, Star, Yao, Jiewen

On 02/19/20 06:58, Dandan Bi wrote:
> This patch seems be reviewed but not submitted. Hope it can be covered in Q1 stable tag.

Should have been merged months ago.

Jian, Hao, can you pick up this patch now please?

Thanks
Laszlo

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich Schuchardt
> Sent: Thursday, September 12, 2019 2:34 PM
> To: EDK II Development <devel@edk2.groups.io>; Bi, Dandan <dandan.bi@intel.com>
> Cc: Jin, Eric <eric.jin@intel.com>; Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Stephano Cetola <stephano.cetola@linux.intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming <liming.gao@intel.com>; Zeng, Star <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Laszlo Ersek <lersek@redhat.com>; Heinrich Schuchardt <xypron.glpk@gmx.de>
> Subject: [edk2-devel] [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1869
> 
> The UEFI spec requires that if any error occurs in UninstallMultipleProtocolInterfaces(), EFI_INVALID_PARAMETER is returned and not the return code of UninstallProtocolInterface().
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
> ---
> v3
>         Use @retval instead of @return.
>         The protocols are reinstalled in the same order in which they are
>         uninstalled.
> v2
> 	Adjust the subject line.
> 	Adjust the function comments to clarify the behavior.
> 	This replaces https://edk2.groups.io/g/devel/message/46974
> ---
>  MdeModulePkg/Core/Dxe/Hand/Handle.c | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/Hand/Handle.c
> index b2721b3ab2..81a13c6ae5 100644
> --- a/MdeModulePkg/Core/Dxe/Hand/Handle.c
> +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c
> @@ -802,20 +802,27 @@ Done:
>    - /**   Uninstalls a list of protocol interface in the boot services environment.-  This function calls UnisatllProtocolInterface() in a loop. This is+  This function calls UninstallProtocolInterface() in a loop. This is   basically a lib function to save space. -  @param  Handle                 The handle to uninstall the protocol+  If any errors are generated while the protocol interfaces are being+  uninstalled, then the protocol interfaces uninstalled prior to the error will+  be reinstalled and EFI_INVALID_PARAMETER will be returned.++  @param  Handle                 The handle to uninstall the protocol interfaces+                                 from.   @param  ...                    EFI_GUID followed by protocol instance. A NULL-                                 terminates the  list. The pairs are the+                                 terminates the list. The pairs are the                                  arguments to UninstallProtocolInterface(). All                                  the protocols are added to Handle. -  @return Status code-+  @retval EFI_SUCCESS            if all protocol interfaces where uninstalled.+  @retval EFI_INVALID_PARAMETER  if any protocol interface could not be+                                 uninstalled and an attempt was made to+                                 reinstall previously uninstalled protocol+                                 interfaces. **/ EFI_STATUS EFIAPI@@ -864,6 +871,7 @@ CoreUninstallMultipleProtocolInterfaces (
>        CoreInstallProtocolInterface (&Handle, Protocol, EFI_NATIVE_INTERFACE, Interface);     }     VA_END (Args);+    Status = EFI_INVALID_PARAMETER;   }    return Status;-- 
> 2.20.1
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> 
> View/Reply Online (#47177): https://edk2.groups.io/g/devel/message/47177
> Mute This Topic: https://groups.io/mt/34112406/1768738
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub  [dandan.bi@intel.com] -=-=-=-=-=-=
> 
> 
> 
> 


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

* Re: [edk2-devel] [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec
  2020-02-19  5:58 ` [edk2-devel] " Dandan Bi
  2020-02-19  8:56   ` Laszlo Ersek
@ 2020-02-19 11:50   ` Heinrich Schuchardt
  1 sibling, 0 replies; 5+ messages in thread
From: Heinrich Schuchardt @ 2020-02-19 11:50 UTC (permalink / raw)
  To: Bi, Dandan, devel@edk2.groups.io
  Cc: Jin, Eric, Supreeth Venkatesh, Stephano Cetola, Wu, Hao A,
	Wang, Jian J, Gao, Liming, Zeng, Star, Yao, Jiewen, Laszlo Ersek

On 2/19/20 6:58 AM, Bi, Dandan wrote:
> This patch seems be reviewed but not submitted. Hope it can be covered in Q1 stable tag.

I have reopened
https://bugzilla.tianocore.org/show_bug.cgi?id=1869

>
> Thanks,
> Dandan

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

* Re: [edk2-devel] [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec
  2020-02-19  8:56   ` Laszlo Ersek
@ 2020-02-19 15:43     ` Wang, Jian J
  0 siblings, 0 replies; 5+ messages in thread
From: Wang, Jian J @ 2020-02-19 15:43 UTC (permalink / raw)
  To: devel@edk2.groups.io, lersek@redhat.com, Bi, Dandan, Wu, Hao A
  Cc: xypron.glpk@gmx.de, Jin, Eric, Supreeth Venkatesh,
	Stephano Cetola, Gao, Liming, Zeng, Star, Yao, Jiewen

It's done (pushed at 0997352ddb4761c49dfedf6fef46b4cd15f6c9bf)

Regards,
Jian

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Laszlo Ersek
> Sent: Wednesday, February 19, 2020 4:57 PM
> To: Bi, Dandan <dandan.bi@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> Wang, Jian J <jian.j.wang@intel.com>
> Cc: devel@edk2.groups.io; xypron.glpk@gmx.de; Jin, Eric <eric.jin@intel.com>;
> Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Stephano Cetola
> <stephano.cetola@linux.intel.com>; Gao, Liming <liming.gao@intel.com>; Zeng,
> Star <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Subject: Re: [edk2-devel] [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make
> retval in UninstallMultipleProtocol follow Spec
> 
> On 02/19/20 06:58, Dandan Bi wrote:
> > This patch seems be reviewed but not submitted. Hope it can be covered in Q1
> stable tag.
> 
> Should have been merged months ago.
> 
> Jian, Hao, can you pick up this patch now please?
> 
> Thanks
> Laszlo
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich
> Schuchardt
> > Sent: Thursday, September 12, 2019 2:34 PM
> > To: EDK II Development <devel@edk2.groups.io>; Bi, Dandan
> <dandan.bi@intel.com>
> > Cc: Jin, Eric <eric.jin@intel.com>; Supreeth Venkatesh
> <supreeth.venkatesh@arm.com>; Stephano Cetola
> <stephano.cetola@linux.intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Wang,
> Jian J <jian.j.wang@intel.com>; Gao, Liming <liming.gao@intel.com>; Zeng, Star
> <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>; Laszlo Ersek
> <lersek@redhat.com>; Heinrich Schuchardt <xypron.glpk@gmx.de>
> > Subject: [edk2-devel] [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make retval
> in UninstallMultipleProtocol follow Spec
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1869
> >
> > The UEFI spec requires that if any error occurs in
> UninstallMultipleProtocolInterfaces(), EFI_INVALID_PARAMETER is returned and
> not the return code of UninstallProtocolInterface().
> >
> > Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> > Reviewed-by: Dandan Bi <dandan.bi@intel.com>
> > ---
> > v3
> >         Use @retval instead of @return.
> >         The protocols are reinstalled in the same order in which they are
> >         uninstalled.
> > v2
> > 	Adjust the subject line.
> > 	Adjust the function comments to clarify the behavior.
> > 	This replaces https://edk2.groups.io/g/devel/message/46974
> > ---
> >  MdeModulePkg/Core/Dxe/Hand/Handle.c | 20 ++++++++++++++------
> >  1 file changed, 14 insertions(+), 6 deletions(-)
> >
> > diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c
> b/MdeModulePkg/Core/Dxe/Hand/Handle.c
> > index b2721b3ab2..81a13c6ae5 100644
> > --- a/MdeModulePkg/Core/Dxe/Hand/Handle.c
> > +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c
> > @@ -802,20 +802,27 @@ Done:
> >    - /**   Uninstalls a list of protocol interface in the boot services
> environment.-  This function calls UnisatllProtocolInterface() in a loop. This is+
> This function calls UninstallProtocolInterface() in a loop. This is   basically a lib
> function to save space. -  @param  Handle                 The handle to uninstall the
> protocol+  If any errors are generated while the protocol interfaces are being+
> uninstalled, then the protocol interfaces uninstalled prior to the error will+  be
> reinstalled and EFI_INVALID_PARAMETER will be returned.++  @param  Handle
> The handle to uninstall the protocol interfaces+                                 from.
> @param  ...                    EFI_GUID followed by protocol instance. A NULL-
> terminates the  list. The pairs are the+                                 terminates the list. The
> pairs are the                                  arguments to UninstallProtocolInterface(). All
> the protocols are added to Handle. -  @return Status code-+  @retval
> EFI_SUCCESS            if all protocol interfaces where uninstalled.+  @retval
> EFI_INVALID_PARAMETER  if any protocol interface could not be+
> uninstalled and an attempt was made to+                                 reinstall previously
> uninstalled protocol+                                 interfaces. **/ EFI_STATUS EFIAPI@@ -
> 864,6 +871,7 @@ CoreUninstallMultipleProtocolInterfaces (
> >        CoreInstallProtocolInterface (&Handle, Protocol, EFI_NATIVE_INTERFACE,
> Interface);     }     VA_END (Args);+    Status = EFI_INVALID_PARAMETER;   }
> return Status;--
> > 2.20.1
> >
> >
> > -=-=-=-=-=-=
> > Groups.io Links: You receive all messages sent to this group.
> >
> > View/Reply Online (#47177): https://edk2.groups.io/g/devel/message/47177
> > Mute This Topic: https://groups.io/mt/34112406/1768738
> > Group Owner: devel+owner@edk2.groups.io
> > Unsubscribe: https://edk2.groups.io/g/devel/unsub  [dandan.bi@intel.com] -
> =-=-=-=-=-=
> >
> >
> >
> >
> 
> 
> 


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

end of thread, other threads:[~2020-02-19 15:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-12  6:34 [edk2-core] [PATCH v3 1/1] MdeModulePkg: Make retval in UninstallMultipleProtocol follow Spec Heinrich Schuchardt
2020-02-19  5:58 ` [edk2-devel] " Dandan Bi
2020-02-19  8:56   ` Laszlo Ersek
2020-02-19 15:43     ` Wang, Jian J
2020-02-19 11:50   ` Heinrich Schuchardt

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