From nobody Fri May 17 05:50:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100171+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1676378571987848.003823407835; Tue, 14 Feb 2023 04:42:51 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id eURcYY1788612x2INghX7qqF; Tue, 14 Feb 2023 04:42:51 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.55]) by mx.groups.io with SMTP id smtpd.web10.5705.1676378570573552105 for ; Tue, 14 Feb 2023 04:42:50 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g6HqHQM6snXs9XU4/ABs05RSajrXBeOXPUk0M/PKPjRiOQt0x2Dx2avpV6ijqdMjHH/K1ji4knL9PhcQQLTkrHY8xfsW3m/zvZd3Cl4EhHxVt6zPtYZJfYL5zyUN641tQZDBDvalWMwVNowf+iDnF013ZKijl5vbiycaEyxPaOwn8mxCBGcMetMxMnj+IF3NUBR5j+mshzlBMp+pEWuabJXC8kqVAybqZuNk7ONc1fSbXHeN8x+7FBnVRE/JaBHwh+/A3UZvJYpMPhUD3neti3IvViQrI+sIJMyCTQMvJ6zUxDFb7aLZGTLdm6E3M9PngEcpT7tfnkEBYrro8WdmDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Mf3uRR9P8IFKhetheqjIXa2qynP3+vgOi9C+MVqz2mk=; b=TyYf0MqJ6vvirjzyGTisxDWtH62RVxahPtCoeYpHivpbq6ZT/CALzPNnMj+saZjyysQ/PGZoNA8rEudwFnkfulsyAccodU+tzkjv5fZB3wTR8Sn5MLOswmA4hE5lUPdUQFZidhQe58ACtyxJTDqgNP5xY89W0Sy2Ly16ix3+bAEE6VCmSvFx8xx3KuTUtPtWBIMJg2Ehnt4O8bzB6QNrMdcOxIlsmJD5rH4qFLPiHH4biaNIXawhBCASK63iECZoqJEeLkKy/DKUGRYG0e/uPDqb+lOkiGkHUM+q+HK/Q6zyBdbkqt2AKqXxu3YVwyISIACWxU7RZEBGEUsaLucDsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none X-Received: from MW4PR04CA0119.namprd04.prod.outlook.com (2603:10b6:303:83::34) by BN9PR12MB5225.namprd12.prod.outlook.com (2603:10b6:408:11e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Tue, 14 Feb 2023 12:42:46 +0000 X-Received: from CO1NAM11FT018.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::ba) by MW4PR04CA0119.outlook.office365.com (2603:10b6:303:83::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26 via Frontend Transport; Tue, 14 Feb 2023 12:42:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+100171+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.118.232) by CO1NAM11FT018.mail.protection.outlook.com (10.13.175.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26 via Frontend Transport; Tue, 14 Feb 2023 12:42:46 +0000 X-Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 14 Feb 2023 04:42:38 -0800 X-Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 14 Feb 2023 04:42:37 -0800 X-Received: from NV-CL38DL3.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.36 via Frontend Transport; Tue, 14 Feb 2023 04:42:36 -0800 From: "Nickle Wang via groups.io" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [edk2-devel] [edk2-staging][PATCH] RedfishClientPkg: Add mechanism to reboot system if config is changed Date: Tue, 14 Feb 2023 20:42:36 +0800 Message-ID: <20230214124236.145-1-nicklew@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT018:EE_|BN9PR12MB5225:EE_ X-MS-Office365-Filtering-Correlation-Id: e85a3364-9e91-43d2-ca88-08db0e88f968 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 1ll2TGfjH0M4pP3CdCXGRJLVtbdwHSmM+kT1Y7Ug3tCw6Uk5IhNQ1qG65xs1FXwZU2/1PDTRQEaSU58hsLxsW5zjp7tfmpMbC6GXLQDTbHWv0fs1RtW7jEsUFMV2GSdty0dnBEliAgXqsQNplhvu1pVS9SZDMsAf7yePGA7KUTwjRjPrB3+HeO7Df55N4y0nzZkd7HZefw6+ejgIFwrX3pE/I/IYsaeD4dRvoGuTSLX7B7vsypoov6j4piDz231uFzQ5BcNIF0nh83K3zfUWx9L1GOSMGyComeOD1P5qX1TVLFPk3JMMn2BonSoSk72HM45BZP0CKBktI7Pn2RxKScqphtWRVTYU+Dyzv272Jm6D3wSmoOGQzrS5rjLhTMKJOv2pdxohYtuZsWgf65kLs00jmCFNQirkdWXfWQIuhBYpvZzl1K60x2SB7DFfucPin9cxcZk3ir3FpwLANb2Lv8w4oJp0QlA3KWThWyaJzP57vOx1xrTJpwD3FEqs49fyMaYuvfsl44V+7QXV7rixbI0gmCxC8rU550TV+5h107Xku1hHG9GBq4/S86K77/175WxoYZhudt9d1g9XaB0MqIcubT+Nir882P4iHX2Mj2a9jbX5RwL3OLTwohxU4WBaNxk+n1C0aHuR8wD9lv73m2OQQM3Mpyzt9/QR4umFsuJP53bt6L7z0EIV8gOgblzWdnfXtBE1hBb8hhlIc6h6gA== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 12:42:46.4855 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e85a3364-9e91-43d2-ca88-08db0e88f968 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT018.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5225 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nicklew@nvidia.com X-Gm-Message-State: NwmMeRKUr6CgXnsMmmR9Zxk0x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1676378571; bh=YUPz/t/ioF6KBZFNVvpWEmNBOqr3uVy/YXoTLXLXj8U=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=E7hOYE6yQvMRWbvk4jXxws4wdSCdbBhkODOLNRN5xVJygo7S1e+qAZDIPxAMtFnR+gl Zq50je3qP/1lONhAucR52rXcWr5lCaKPGl07avFdVJAauxjKhnMjWeMXRp1rBzZ1SecKY i1t6HXNZRcGI5clBRDeP6JeCP/0oxTcMJks= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1676378573518100001 Content-Type: text/plain; charset="utf-8" When system configuration is updated from RESTful interface, we need a system reboot so that the changes can be applied. Introduce PCD "PcdSystemRebootRequired" to RedfishClientPkg. RedfishFeatureUtility library will enable this flag when system config is updated. RedfishFeatureCore driver will check this flag and perform cold reboot after all Redfish operations are finished. PCD "PcdSystemRebootTimeout" is used to specify how many second BIOS will wait before reboot system. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../Library/RedfishFeatureUtilityLib.h | 3 + .../RedfishFeatureUtilityLib.c | 65 ++++++++++++++++--- .../RedfishFeatureUtilityLib.inf | 2 + RedfishClientPkg/RedfishClientPkg.dec | 8 ++- .../RedfishFeatureCoreDxe.c | 18 +++++ .../RedfishFeatureCoreDxe.h | 3 + .../RedfishFeatureCoreDxe.inf | 5 ++ 7 files changed, 93 insertions(+), 11 deletions(-) diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h b/= RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h index 1325976d8c..bb5dc4f4ac 100644 --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h @@ -2,6 +2,7 @@ This file defines the Redfish Feature Utility Library interface. =20 (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -14,6 +15,8 @@ #include #include =20 +#define REDFISH_ENABLE_SYSTEM_REBOOT() PcdSetBoolS(PcdSystemRebootRequired= , TRUE) + // // Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG // diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatu= reUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishF= eatureUtilityLib.c index bfd6fff2a7..9883a4d919 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c @@ -2,7 +2,7 @@ Redfish feature utility library implementation =20 (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
- Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -324,7 +324,12 @@ ApplyFeatureSettingsStringType ( RedfishValue.Value.Buffer =3D FeatureValue; =20 Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, RedfishValue); - if (EFI_ERROR (Status)) { + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT(); + } else { DEBUG ((DEBUG_ERROR, "%a, apply %s to %s failed: %r\n", __FUNCTION= __, ConfigureLang, FeatureValue, Status)); } } else { @@ -385,7 +390,12 @@ ApplyFeatureSettingsNumericType ( RedfishValue.Value.Integer =3D (INT64)FeatureValue; =20 Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, RedfishValue); - if (EFI_ERROR (Status)) { + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT(); + } else { DEBUG ((DEBUG_ERROR, "%a, apply %s to 0x%x failed: %r\n", __FUNCTI= ON__, ConfigureLang, FeatureValue, Status)); } } else { @@ -446,7 +456,12 @@ ApplyFeatureSettingsBooleanType ( RedfishValue.Value.Boolean =3D FeatureValue; =20 Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, RedfishValue); - if (EFI_ERROR (Status)) { + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT(); + } else { DEBUG ((DEBUG_ERROR, "%a, apply %s to %a failed: %r\n", __FUNCTION= __, ConfigureLang, (FeatureValue ? "True" : "False"), Status)); } } else { @@ -561,7 +576,12 @@ ApplyFeatureSettingsVagueType ( FreePool (RedfishValue.Value.Buffer); RedfishValue.Value.Buffer =3D CurrentVagueValuePtr->Value->DataV= alue.CharPtr; Status =3D RedfishPlatformConfigSetValue (Schema, Version, Confi= gureKeyLang, RedfishValue); - if (EFI_ERROR (Status)) { + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT(); + } else { DEBUG ((DEBUG_ERROR, "%a, apply %a to %a failed: %r\n", __FUNC= TION__, ConfigureKeyLang, CurrentVagueValuePtr->Value->DataValue.CharPtr, S= tatus)); } } else { @@ -585,7 +605,12 @@ ApplyFeatureSettingsVagueType ( =20 RedfishValue.Value.Boolean =3D (BOOLEAN)*CurrentVagueValuePtr->V= alue->DataValue.BoolPtr; Status =3D RedfishPlatformConfigSetValue (Schema, Version, Confi= gureKeyLang, RedfishValue); - if (EFI_ERROR (Status)) { + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT(); + } else { DEBUG ((DEBUG_ERROR, "%a, apply %s to %a failed: %r\n", __FUNC= TION__, ConfigureKeyLang, (*CurrentVagueValuePtr->Value->DataValue.BoolPtr = ? "True" : "False"), Status)); } } else { @@ -603,7 +628,12 @@ ApplyFeatureSettingsVagueType ( =20 RedfishValue.Value.Integer =3D (INT64)*CurrentVagueValuePtr->Val= ue->DataValue.Int64Ptr; Status =3D RedfishPlatformConfigSetValue (Schema, Version, Confi= gureKeyLang, RedfishValue); - if (EFI_ERROR (Status)) { + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT(); + } else { DEBUG ((DEBUG_ERROR, "%a, apply %s to 0x%x failed: %r\n", __FU= NCTION__, ConfigureKeyLang, *CurrentVagueValuePtr->Value->DataValue.Int64Pt= r, Status)); } } else { @@ -775,7 +805,12 @@ ApplyFeatureSettingsStringArrayType ( ASSERT (Index <=3D RedfishValue.ArrayCount); =20 Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, RedfishValue); - if (EFI_ERROR (Status)) { + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT(); + } else { DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __FUNCTION= __, ConfigureLang, Status)); } } else { @@ -869,7 +904,12 @@ ApplyFeatureSettingsNumericArrayType ( ASSERT (Index <=3D RedfishValue.ArrayCount); =20 Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, RedfishValue); - if (EFI_ERROR (Status)) { + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT(); + } else { DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __FUNCTION= __, ConfigureLang, Status)); } } else { @@ -963,7 +1003,12 @@ ApplyFeatureSettingsBooleanArrayType ( ASSERT (Index <=3D RedfishValue.ArrayCount); =20 Status =3D RedfishPlatformConfigSetValue (Schema, Version, Configure= Lang, RedfishValue); - if (EFI_ERROR (Status)) { + if (!EFI_ERROR (Status)) { + // + // Configuration changed. Enable system reboot flag. + // + REDFISH_ENABLE_SYSTEM_REBOOT(); + } else { DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __FUNCTION= __, ConfigureLang, Status)); } } else { diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatu= reUtilityLib.inf b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/Redfis= hFeatureUtilityLib.inf index 84f338e680..d556990b63 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.inf +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.inf @@ -1,6 +1,7 @@ ## @file # # (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserve= d. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -49,6 +50,7 @@ gEdkIIRedfishConfigLangMapProtocolGuid ## CONSUMED ## =20 [Pcd] + gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootRequired =20 [Guids] =20 diff --git a/RedfishClientPkg/RedfishClientPkg.dec b/RedfishClientPkg/Redfi= shClientPkg.dec index d3c97ecf68..634456e5d5 100644 --- a/RedfishClientPkg/RedfishClientPkg.dec +++ b/RedfishClientPkg/RedfishClientPkg.dec @@ -2,7 +2,7 @@ # Redfish Client Package # # (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
-# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights res= erved. # # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -65,3 +65,9 @@ gEfiRedfishClientPkgTokenSpaceGuid.PcdEdkIIRedfishFeatureDriverStartupEv= entGuid|{0xB3, 0x8F, 0xE8, 0x7C, 0xD7, 0x4B, 0x79, 0x46, 0x87, 0xA8, 0xA8, = 0xD8, 0xDE, 0xE5, 0x0D, 0x2B}|VOID*|0x10000003 ## Default Redfish version string gEfiRedfishClientPkgTokenSpaceGuid.PcdDefaultRedfishVersion|L"v1"|VOID*|= 0x10000004 + ## The number of seconds that the firmware will wait before system reboot + gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootTimeout|5|UINT16|0x200= 00002 + +[PcdsDynamicEx] + ## The flag used to indicate that system reboot is required due to syste= m configuration change + gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootRequired|FALSE|BOOLEAN= |0x20000001 diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c index 3414f0c942..b2b1307b6c 100644 --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c @@ -3,6 +3,7 @@ for EDK2 Redfish Feature driver registration. =20 (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -230,8 +231,10 @@ RedfishFeatureDriverStartup( ) { REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext; + UINT16 RebootTimeout; =20 StartupContext =3D (REDFISH_FEATURE_STARTUP_CONTEXT *)Context; + RebootTimeout =3D PcdGet16 (PcdSystemRebootTimeout); // // Invoke EDK2 Redfish feature driver callback to start up // the Redfish operations. @@ -249,6 +252,11 @@ RedfishFeatureDriverStartup( return; } =20 + // + // Reset PcdSystemRebootRequired flag + // + PcdSetBoolS (PcdSystemRebootRequired, FALSE); + // // Signal event before doing provisioning // @@ -263,6 +271,16 @@ RedfishFeatureDriverStartup( // Signal event after provisioning finished // SignalAfterProvisioningEvent (); + + // + // If system configuration is changed, reboot system. + // + if (PcdGetBool (PcdSystemRebootRequired)) { + Print (L"System configuration is changed from RESTful interface. Reboo= t system in %d seconds...\n", RebootTimeout); + gBS->Stall (RebootTimeout * 1000000U); + gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); + CpuDeadLoop (); + } } =20 /** diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h index 84b5e456d1..af274c01ca 100644 --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h @@ -2,6 +2,7 @@ Definitions of RedfishFeatureCoreDxe =20 (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -17,6 +18,8 @@ #include #include #include +#include +#include #include #include =20 diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.i= nf b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf index ddcf991006..6cf35694fb 100644 --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf @@ -4,6 +4,8 @@ # drivers for the registration. # # (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserve= d. +# # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -40,6 +42,7 @@ RedfishFeatureUtilityLib UefiBootServicesTableLib UefiDriverEntryPoint + UefiRuntimeServicesTableLib UefiLib =20 [Protocols] @@ -47,6 +50,8 @@ =20 [Pcd] gEfiRedfishClientPkgTokenSpaceGuid.PcdEdkIIRedfishFeatureDriverStartupEv= entGuid + gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootRequired + gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootTimeout =20 [Depex] TRUE --=20 2.39.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#100171): https://edk2.groups.io/g/devel/message/100171 Mute This Topic: https://groups.io/mt/96958702/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-