[edk2-devel] [PATCH] RedfishPkg: fix multiple SMBIOS type 42 version issue

Nickle Wang via groups.io posted 1 patch 1 year, 2 months ago
Failed in applying to current master (apply log)
.../RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c     | 8 ++++++++
1 file changed, 8 insertions(+)
[edk2-devel] [PATCH] RedfishPkg: fix multiple SMBIOS type 42 version issue
Posted by Nickle Wang via groups.io 1 year, 2 months ago
RedfishHostInterfaceDxe does not close protocol notify event in
event callback function. This could cause multiple version of
type 42 records issue if the protocol is installed more than once.
Close the event in callback function so we only create one type 42
record.

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>
---
 .../RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c     | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
index 3e12e0c8b9..872cf3ae06 100644
--- a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
+++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
@@ -7,6 +7,7 @@
   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
   Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -260,6 +261,13 @@ PlatformHostInterfaceInformationReady (
   DEBUG ((DEBUG_INFO, "%a: Platform Redfish Host Interface informtion is ready\n", __FUNCTION__));
 
   RedfishCreateSmbiosTable42 ();
+
+  //
+  // Close event so we don't create multiple type 42 records
+  //
+  gBS->CloseEvent (Event);
+  mPlatformHostInterfaceReadylEvent = NULL;
+
   return;
 }
 
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99377): https://edk2.groups.io/g/devel/message/99377
Mute This Topic: https://groups.io/mt/96668185/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] RedfishPkg: fix multiple SMBIOS type 42 version issue
Posted by Chang, Abner via groups.io 1 year, 2 months ago
[AMD Official Use Only - General]

Reviewed-by: Abner Chang <abner.chang@amd.com>

> -----Original Message-----
> From: Nickle Wang <nicklew@nvidia.com>
> Sent: Wednesday, February 1, 2023 10:30 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <Abner.Chang@amd.com>; Igor Kulchytskyy
> <igork@ami.com>; Nick Ramirez <nramirez@nvidia.com>
> Subject: [PATCH] RedfishPkg: fix multiple SMBIOS type 42 version issue
> 
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
> 
> 
> RedfishHostInterfaceDxe does not close protocol notify event in event callback
> function. This could cause multiple version of type 42 records issue if the
> protocol is installed more than once.
> Close the event in callback function so we only create one type 42 record.
> 
> 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>
> ---
>  .../RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c     | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
> b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
> index 3e12e0c8b9..872cf3ae06 100644
> --- a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
> +++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c
> @@ -7,6 +7,7 @@
>    Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
>    (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
>    Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>
> +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
> 
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -260,6 +261,13 @@ PlatformHostInterfaceInformationReady (
>    DEBUG ((DEBUG_INFO, "%a: Platform Redfish Host Interface informtion is
> ready\n", __FUNCTION__));
> 
>    RedfishCreateSmbiosTable42 ();
> +
> +  //
> +  // Close event so we don't create multiple type 42 records  //
> + gBS->CloseEvent (Event);  mPlatformHostInterfaceReadylEvent = NULL;
> +
>    return;
>  }
> 
> --
> 2.39.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99625): https://edk2.groups.io/g/devel/message/99625
Mute This Topic: https://groups.io/mt/96668185/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-