public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix CPU exception in RedfishRestExDxe
@ 2023-07-05  6:56 Nickle Wang
  2023-07-05  8:42 ` [edk2-devel] " Mike Maslenkin
  0 siblings, 1 reply; 5+ messages in thread
From: Nickle Wang @ 2023-07-05  6:56 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Igor Kulchytskyy, Nick Ramirez

RedfishRestExDxe driver failed to uninstall service binding protocol
when driver binding stop is called. Application drivers may still
use RedfishRestExDxe after it is disconnected in system.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
---
 RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
index ad65ae213ae0..7036aed42683 100644
--- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
+++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
@@ -3,6 +3,7 @@
 
   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -57,6 +58,7 @@ RestExDestroyChildEntryInHandleBuffer (
   ChildHandleBuffer = ((RESTEX_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT *)Context)->ChildHandleBuffer;
 
   if (!NetIsInHandleBuffer (Instance->ChildHandle, NumberOfChildren, ChildHandleBuffer)) {
+    RemoveEntryList (&Instance->Link);
     return EFI_SUCCESS;
   }
 
@@ -563,7 +565,7 @@ RedfishRestExDriverBindingStop (
                                   );
   }
 
-  if ((NumberOfChildren == 0) && IsListEmpty (&RestExSb->RestExChildrenList)) {
+  if (IsListEmpty (&RestExSb->RestExChildrenList)) {
     gBS->UninstallProtocolInterface (
            NicHandle,
            &gEfiRestExServiceBindingProtocolGuid,
-- 
2.17.1


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

* Re: [edk2-devel] [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix CPU exception in RedfishRestExDxe
  2023-07-05  6:56 [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix CPU exception in RedfishRestExDxe Nickle Wang
@ 2023-07-05  8:42 ` Mike Maslenkin
  2023-07-06  8:07   ` Nickle Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Maslenkin @ 2023-07-05  8:42 UTC (permalink / raw)
  To: devel, nicklew; +Cc: Abner Chang, Igor Kulchytskyy, Nick Ramirez

Just one note:
All manipulations with this list are going in conjunction with
RestExSb->RestExChildrenNum.
At first glance it appears this field must be decremented also. But I
see no usage for RestExChildrenNum at all, may be it can be
eliminated?

Regards,
MIke.

On Wed, Jul 5, 2023 at 9:56 AM Nickle Wang via groups.io
<nicklew=nvidia.com@groups.io> wrote:
>
> RedfishRestExDxe driver failed to uninstall service binding protocol
> when driver binding stop is called. Application drivers may still
> use RedfishRestExDxe after it is disconnected in system.
>
> Signed-off-by: Nickle Wang <nicklew@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Nick Ramirez <nramirez@nvidia.com>
> Reviewed-by: Abner Chang <abner.chang@amd.com>
> ---
>  RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> index ad65ae213ae0..7036aed42683 100644
> --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> @@ -3,6 +3,7 @@
>
>    Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
>    (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
> +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -57,6 +58,7 @@ RestExDestroyChildEntryInHandleBuffer (
>    ChildHandleBuffer = ((RESTEX_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT *)Context)->ChildHandleBuffer;
>
>    if (!NetIsInHandleBuffer (Instance->ChildHandle, NumberOfChildren, ChildHandleBuffer)) {
> +    RemoveEntryList (&Instance->Link);
>      return EFI_SUCCESS;
>    }
>
> @@ -563,7 +565,7 @@ RedfishRestExDriverBindingStop (
>                                    );
>    }
>
> -  if ((NumberOfChildren == 0) && IsListEmpty (&RestExSb->RestExChildrenList)) {
> +  if (IsListEmpty (&RestExSb->RestExChildrenList)) {
>      gBS->UninstallProtocolInterface (
>             NicHandle,
>             &gEfiRestExServiceBindingProtocolGuid,
> --
> 2.17.1
>
>
>
> 
>
>

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

* Re: [edk2-devel] [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix CPU exception in RedfishRestExDxe
  2023-07-05  8:42 ` [edk2-devel] " Mike Maslenkin
@ 2023-07-06  8:07   ` Nickle Wang
  2023-07-06 11:00     ` Chang, Abner
  0 siblings, 1 reply; 5+ messages in thread
From: Nickle Wang @ 2023-07-06  8:07 UTC (permalink / raw)
  To: Mike Maslenkin, devel@edk2.groups.io, Abner Chang
  Cc: Igor Kulchytskyy, Nick Ramirez

I am ok to remove it since we don't use it. @Abner Chang, comment as driver author?

Thanks,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslenkin@gmail.com>
> Sent: Wednesday, July 5, 2023 4:43 PM
> To: devel@edk2.groups.io; Nickle Wang <nicklew@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy <igork@ami.com>;
> Nick Ramirez <nramirez@nvidia.com>
> Subject: Re: [edk2-devel] [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix CPU
> exception in RedfishRestExDxe
> 
> External email: Use caution opening links or attachments
> 
> 
> Just one note:
> All manipulations with this list are going in conjunction with
> RestExSb->RestExChildrenNum.
> At first glance it appears this field must be decremented also. But I see no usage
> for RestExChildrenNum at all, may be it can be eliminated?
> 
> Regards,
> MIke.
> 
> On Wed, Jul 5, 2023 at 9:56 AM Nickle Wang via groups.io
> <nicklew=nvidia.com@groups.io> wrote:
> >
> > RedfishRestExDxe driver failed to uninstall service binding protocol
> > when driver binding stop is called. Application drivers may still use
> > RedfishRestExDxe after it is disconnected in system.
> >
> > Signed-off-by: Nickle Wang <nicklew@nvidia.com>
> > Cc: Abner Chang <abner.chang@amd.com>
> > Cc: Igor Kulchytskyy <igork@ami.com>
> > Cc: Nick Ramirez <nramirez@nvidia.com>
> > Reviewed-by: Abner Chang <abner.chang@amd.com>
> > ---
> >  RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > index ad65ae213ae0..7036aed42683 100644
> > --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > @@ -3,6 +3,7 @@
> >
> >    Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> >    (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
> > +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
> >
> >    SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > @@ -57,6 +58,7 @@ RestExDestroyChildEntryInHandleBuffer (
> >    ChildHandleBuffer = ((RESTEX_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT
> > *)Context)->ChildHandleBuffer;
> >
> >    if (!NetIsInHandleBuffer (Instance->ChildHandle, NumberOfChildren,
> > ChildHandleBuffer)) {
> > +    RemoveEntryList (&Instance->Link);
> >      return EFI_SUCCESS;
> >    }
> >
> > @@ -563,7 +565,7 @@ RedfishRestExDriverBindingStop (
> >                                    );
> >    }
> >
> > -  if ((NumberOfChildren == 0) && IsListEmpty
> > (&RestExSb->RestExChildrenList)) {
> > +  if (IsListEmpty (&RestExSb->RestExChildrenList)) {
> >      gBS->UninstallProtocolInterface (
> >             NicHandle,
> >             &gEfiRestExServiceBindingProtocolGuid,
> > --
> > 2.17.1
> >
> >
> >
> > 
> >
> >

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

* Re: [edk2-devel] [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix CPU exception in RedfishRestExDxe
  2023-07-06  8:07   ` Nickle Wang
@ 2023-07-06 11:00     ` Chang, Abner
  2023-07-06 12:11       ` Nickle Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Chang, Abner @ 2023-07-06 11:00 UTC (permalink / raw)
  To: Nickle Wang, Mike Maslenkin, devel@edk2.groups.io
  Cc: Igor Kulchytskyy, Nick Ramirez

[AMD Official Use Only - General]

I am also ok to remove this. However please have another patch for this, thus the purpose of change is clear.

Thanks
Abner

> -----Original Message-----
> From: Nickle Wang <nicklew@nvidia.com>
> Sent: Thursday, July 6, 2023 4:08 PM
> To: Mike Maslenkin <mike.maslenkin@gmail.com>; devel@edk2.groups.io;
> Chang, Abner <Abner.Chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>; Nick Ramirez <nramirez@nvidia.com>
> Subject: RE: [edk2-devel] [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix
> CPU exception in RedfishRestExDxe
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> I am ok to remove it since we don't use it. @Abner Chang, comment as driver
> author?
>
> Thanks,
> Nickle
>
> > -----Original Message-----
> > From: Mike Maslenkin <mike.maslenkin@gmail.com>
> > Sent: Wednesday, July 5, 2023 4:43 PM
> > To: devel@edk2.groups.io; Nickle Wang <nicklew@nvidia.com>
> > Cc: Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy
> <igork@ami.com>;
> > Nick Ramirez <nramirez@nvidia.com>
> > Subject: Re: [edk2-devel] [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix
> CPU
> > exception in RedfishRestExDxe
> >
> > External email: Use caution opening links or attachments
> >
> >
> > Just one note:
> > All manipulations with this list are going in conjunction with
> > RestExSb->RestExChildrenNum.
> > At first glance it appears this field must be decremented also. But I see no
> usage
> > for RestExChildrenNum at all, may be it can be eliminated?
> >
> > Regards,
> > MIke.
> >
> > On Wed, Jul 5, 2023 at 9:56 AM Nickle Wang via groups.io
> > <nicklew=nvidia.com@groups.io> wrote:
> > >
> > > RedfishRestExDxe driver failed to uninstall service binding protocol
> > > when driver binding stop is called. Application drivers may still use
> > > RedfishRestExDxe after it is disconnected in system.
> > >
> > > Signed-off-by: Nickle Wang <nicklew@nvidia.com>
> > > Cc: Abner Chang <abner.chang@amd.com>
> > > Cc: Igor Kulchytskyy <igork@ami.com>
> > > Cc: Nick Ramirez <nramirez@nvidia.com>
> > > Reviewed-by: Abner Chang <abner.chang@amd.com>
> > > ---
> > >  RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > > b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > > index ad65ae213ae0..7036aed42683 100644
> > > --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > > +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > > @@ -3,6 +3,7 @@
> > >
> > >    Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> > >    (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
> > > +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> > >
> > >    SPDX-License-Identifier: BSD-2-Clause-Patent
> > >
> > > @@ -57,6 +58,7 @@ RestExDestroyChildEntryInHandleBuffer (
> > >    ChildHandleBuffer =
> ((RESTEX_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT
> > > *)Context)->ChildHandleBuffer;
> > >
> > >    if (!NetIsInHandleBuffer (Instance->ChildHandle, NumberOfChildren,
> > > ChildHandleBuffer)) {
> > > +    RemoveEntryList (&Instance->Link);
> > >      return EFI_SUCCESS;
> > >    }
> > >
> > > @@ -563,7 +565,7 @@ RedfishRestExDriverBindingStop (
> > >                                    );
> > >    }
> > >
> > > -  if ((NumberOfChildren == 0) && IsListEmpty
> > > (&RestExSb->RestExChildrenList)) {
> > > +  if (IsListEmpty (&RestExSb->RestExChildrenList)) {
> > >      gBS->UninstallProtocolInterface (
> > >             NicHandle,
> > >             &gEfiRestExServiceBindingProtocolGuid,
> > > --
> > > 2.17.1
> > >
> > >
> > >
> > > 
> > >
> > >

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

* Re: [edk2-devel] [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix CPU exception in RedfishRestExDxe
  2023-07-06 11:00     ` Chang, Abner
@ 2023-07-06 12:11       ` Nickle Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Nickle Wang @ 2023-07-06 12:11 UTC (permalink / raw)
  To: Chang, Abner, Mike Maslenkin, devel@edk2.groups.io
  Cc: Igor Kulchytskyy, Nick Ramirez

Thanks Abner. Will create a separated patch to remove "RestExSb->RestExChildrenNum".

Regards,
Nickle

> -----Original Message-----
> From: Chang, Abner <Abner.Chang@amd.com>
> Sent: Thursday, July 6, 2023 7:01 PM
> To: Nickle Wang <nicklew@nvidia.com>; Mike Maslenkin
> <mike.maslenkin@gmail.com>; devel@edk2.groups.io
> Cc: Igor Kulchytskyy <igork@ami.com>; Nick Ramirez <nramirez@nvidia.com>
> Subject: RE: [edk2-devel] [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix CPU
> exception in RedfishRestExDxe
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> I am also ok to remove this. However please have another patch for this, thus the
> purpose of change is clear.
> 
> Thanks
> Abner
> 
> > -----Original Message-----
> > From: Nickle Wang <nicklew@nvidia.com>
> > Sent: Thursday, July 6, 2023 4:08 PM
> > To: Mike Maslenkin <mike.maslenkin@gmail.com>; devel@edk2.groups.io;
> > Chang, Abner <Abner.Chang@amd.com>
> > Cc: Igor Kulchytskyy <igork@ami.com>; Nick Ramirez
> > <nramirez@nvidia.com>
> > Subject: RE: [edk2-devel] [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe:
> > fix CPU exception in RedfishRestExDxe
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > I am ok to remove it since we don't use it. @Abner Chang, comment as
> > driver author?
> >
> > Thanks,
> > Nickle
> >
> > > -----Original Message-----
> > > From: Mike Maslenkin <mike.maslenkin@gmail.com>
> > > Sent: Wednesday, July 5, 2023 4:43 PM
> > > To: devel@edk2.groups.io; Nickle Wang <nicklew@nvidia.com>
> > > Cc: Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy
> > <igork@ami.com>;
> > > Nick Ramirez <nramirez@nvidia.com>
> > > Subject: Re: [edk2-devel] [PATCH v2 1/3]
> > > RedfishPkg/RedfishRestExDxe: fix
> > CPU
> > > exception in RedfishRestExDxe
> > >
> > > External email: Use caution opening links or attachments
> > >
> > >
> > > Just one note:
> > > All manipulations with this list are going in conjunction with
> > > RestExSb->RestExChildrenNum.
> > > At first glance it appears this field must be decremented also. But
> > > I see no
> > usage
> > > for RestExChildrenNum at all, may be it can be eliminated?
> > >
> > > Regards,
> > > MIke.
> > >
> > > On Wed, Jul 5, 2023 at 9:56 AM Nickle Wang via groups.io
> > > <nicklew=nvidia.com@groups.io> wrote:
> > > >
> > > > RedfishRestExDxe driver failed to uninstall service binding
> > > > protocol when driver binding stop is called. Application drivers
> > > > may still use RedfishRestExDxe after it is disconnected in system.
> > > >
> > > > Signed-off-by: Nickle Wang <nicklew@nvidia.com>
> > > > Cc: Abner Chang <abner.chang@amd.com>
> > > > Cc: Igor Kulchytskyy <igork@ami.com>
> > > > Cc: Nick Ramirez <nramirez@nvidia.com>
> > > > Reviewed-by: Abner Chang <abner.chang@amd.com>
> > > > ---
> > > >  RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c | 4 +++-
> > > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > > > b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > > > index ad65ae213ae0..7036aed42683 100644
> > > > --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > > > +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
> > > > @@ -3,6 +3,7 @@
> > > >
> > > >    Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> > > >    (C) Copyright 2020 Hewlett Packard Enterprise Development
> > > > LP<BR>
> > > > +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> > > >
> > > >    SPDX-License-Identifier: BSD-2-Clause-Patent
> > > >
> > > > @@ -57,6 +58,7 @@ RestExDestroyChildEntryInHandleBuffer (
> > > >    ChildHandleBuffer =
> > ((RESTEX_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT
> > > > *)Context)->ChildHandleBuffer;
> > > >
> > > >    if (!NetIsInHandleBuffer (Instance->ChildHandle,
> > > > NumberOfChildren,
> > > > ChildHandleBuffer)) {
> > > > +    RemoveEntryList (&Instance->Link);
> > > >      return EFI_SUCCESS;
> > > >    }
> > > >
> > > > @@ -563,7 +565,7 @@ RedfishRestExDriverBindingStop (
> > > >                                    );
> > > >    }
> > > >
> > > > -  if ((NumberOfChildren == 0) && IsListEmpty
> > > > (&RestExSb->RestExChildrenList)) {
> > > > +  if (IsListEmpty (&RestExSb->RestExChildrenList)) {
> > > >      gBS->UninstallProtocolInterface (
> > > >             NicHandle,
> > > >             &gEfiRestExServiceBindingProtocolGuid,
> > > > --
> > > > 2.17.1
> > > >
> > > >
> > > >
> > > > 
> > > >
> > > >

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

end of thread, other threads:[~2023-07-06 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-05  6:56 [PATCH v2 1/3] RedfishPkg/RedfishRestExDxe: fix CPU exception in RedfishRestExDxe Nickle Wang
2023-07-05  8:42 ` [edk2-devel] " Mike Maslenkin
2023-07-06  8:07   ` Nickle Wang
2023-07-06 11:00     ` Chang, Abner
2023-07-06 12:11       ` Nickle Wang

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