From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 09BF3AC0E06 for ; Wed, 6 Dec 2023 08:57:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=W2xG+wpuQ4kTAe1OtU4srSHrs2aOfTtHDL5PtDEzjfc=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1701853034; v=1; b=STlIMJ6Vo1I7CFffLxuPdM7SGHPoD7dZDS0it6A18I71ZOraoJ16IRphqENsevIpizl060T1 DF6eiHN9SwApsKZBucn1V83hJ7tmvQhrZxewMjY/7VUP/syzME3ZV7dhWZkcL3FxvNcF3Ru05fu 5F43L9x86nzcD4jbDPaGMEpo= X-Received: by 127.0.0.2 with SMTP id HVgcYY7687511xiQyLmWP7T6; Wed, 06 Dec 2023 00:57:14 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.41]) by mx.groups.io with SMTP id smtpd.web10.27422.1701853034008050970 for ; Wed, 06 Dec 2023 00:57:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZUuHOiR3vddt4LuKmGXJoTOb7O8RPd1Mhuz0/SqXXeMvKr4AUA6ciiIBzsZke04tpbBwpuhgwn7YspTStw6KRvhQe2I6IKDuYIDqspSn5VytEwuqxfSjb2Wk33R+voQgnGjRdouDEFFYw6HN8e0plde+iZcMj2ArTpSBwo/2bqs849opx7r4gP9JzLxnmZegGvbGbUerD2ONpEeVhy79l2ChTn/XTZvm+CRM6J6p5Ksyp+E+ZnSPx+6e9vQieqZboXFdjwlnEPprr8X3gwHR/XN78MmieU0YOn5Qx2bCOqu37HO2r6KMgClKZ0fQRW4kwtnxVDZTsu5QAxqtgYePZA== 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=nxAttV0iNQQp1vi/M0bsYoRNBJXif7FIe+UY1Bp96/c=; b=ShP+oRK/sb35ZwMSMmKBuEIrmIVeTdn1KiNVDW6a4NAnZBp7J8EHbgk6PlTM7FdolszWxDmHH9/xbL23bvQc5q/LX57SpJsxoTO2mL90KogpYRGj2VV/wXyrUciCP0tfL5oMcwp9lEghQ8o0DLGvtluEO55ESPJpDTjlVQ/dIX9CfRWvD4uX+lvLsErxrcSiQ0aqEJG+knZAfHwUwcu4ImFebfWhzCZ89AI3dt1qAokENFItZoo6zah61cB+r4oE/tuNNPoKA2GtW1heSX9Zy46NEhrBr/guFxt2Pr2UCBE5zYpTAhCHAUm30YlrG3T2un+yBRY+1x4H89TDh+66pw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 (0) X-Received: from SA9PR10CA0022.namprd10.prod.outlook.com (2603:10b6:806:a7::27) by BL1PR12MB5349.namprd12.prod.outlook.com (2603:10b6:208:31f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.25; Wed, 6 Dec 2023 08:57:10 +0000 X-Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:806:a7:cafe::bd) by SA9PR10CA0022.outlook.office365.com (2603:10b6:806:a7::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34 via Frontend Transport; Wed, 6 Dec 2023 08:57:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.161) by SN1PEPF0002BA51.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.20 via Frontend Transport; Wed, 6 Dec 2023 08:57:09 +0000 X-Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 6 Dec 2023 00:56:56 -0800 X-Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 6 Dec 2023 00:56:56 -0800 X-Received: from NV-CL38DL3.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Wed, 6 Dec 2023 00:56:55 -0800 From: "Nickle Wang via groups.io" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/RedfishFeatureCoreDxe: fix Redfish event issue. Date: Wed, 6 Dec 2023 16:56:55 +0800 Message-ID: <20231206085655.5304-1-nicklew@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA51:EE_|BL1PR12MB5349:EE_ X-MS-Office365-Filtering-Correlation-Id: dbe9d47f-200f-457a-a730-08dbf63954e6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: hzJXKu3erZiSFKhLCvBnV3Kae6D+hru4DWI/62p3OV4SG+x5WdTpKKxb+p1GQjPNLP436zHu9/VMf46vXMmi9au/8hWGjHDbLD7C2T1H1OkgproQESo+2X1NLYnTWE+T+8l9X8GnmVbnL0yIoeqR9rJkcff3PHVwp9caMhH7ZKZEYwxdZWUoyxnJK7DHQzxeyZveOWDArFEQkMdjWO6CmGG6RKPxQq6vJNJ8hfjr6L8RbFeE+ght2wfYLcn4rWeo82FhfXyQmNwUHA9kfUnO22reYWC24tXd9RtkAUOxCmazQHjwStntndAHjriK92ZVGZD3ql3hGUL1jnKu4xGgUouw+pEAMpBKaez97pu+2G31pn5wlqNAs3JT9ZHvscxbyxwnive3Y/NxWY7/sE83L6uYr2eQ6X1I4ROjWCApLBgfZCu3M6q439T6KaU57QgtPbkcD3elYYHozTBBVpKiGf6QDVAvhVqV4xmzrZ9ky2kZIDNh82D2BZOSaIM+Bnfk/9Q5aJ+MlPb4C6gBgmsPCRtYTHF1Hpnk14JjknIq6mMUlUX9b3yUbUbCsMZHxCpr6tVfMMpzAXJQXntG0tDNVTRG2651882m3ndMdguqpdL4s/UwuoGsso0NBFFnCRnajQzskLh35Vl6T2a2GPSK2eom1d+EjnNnTwpGctQTD8EALyNPc4h1aN/xEi4lZrB7pc2QHWGx1srScZECsNa2U9ABLbBHoTtPcDnS/pVO4SBpWpyr706ymvWy7C+5ZRbn X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2023 08:57:09.9778 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dbe9d47f-200f-457a-a730-08dbf63954e6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA51.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5349 Precedence: Bulk 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 List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: sN5SwgESQh7uAxp5Dn9pFfLMx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-Spam-Flag: yes X-Spam-Level: ************ X-GND-Spam-Score: 190 X-GND-Status: SPAM Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=STlIMJ6V; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io RedfishFeatureDriverStartup is callback function at TPL_CALLBACK level. In this function, Redfish events are signaled. However, Redfish events are created in TPL_CALLBACK level too. As the result, Redfish events cannot be invoked in desired sequence. Decrease the TPL to TPL_APPLICATION level inside RedfishFeatureDriverStartup and restore it to TPL_CALLBACK level before leaving this function. Now, Redfish events are called in correct sequence. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h | 1 + .../RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h index acefa41b..de08d79d 100644 --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h @@ -33,6 +33,7 @@ #define NodeIsCollectionLeftBracket L'{' #define NodeIsCollectionRightBracket L'}' #define NodeIsCollectionSymbol L"/{}" +#define REDFISH_FEATURE_CORE_TPL TPL_CALLBACK =20 typedef struct _REDFISH_FEATURE_INTERNAL_DATA REDFISH_FEATURE_INTERNAL_DAT= A; struct _REDFISH_FEATURE_INTERNAL_DATA { diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c= b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c index f3188ddf..c0c3ec47 100644 --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c @@ -272,6 +272,13 @@ RedfishFeatureDriverStartup ( return; } =20 + // + // Lower the TPL to TPL_APPLICATION so that + // Redfish event and report status code can be + // triggered + // + gBS->RestoreTPL (TPL_APPLICATION); + // // Reset PcdRedfishSystemRebootRequired flag // @@ -321,6 +328,11 @@ RedfishFeatureDriverStartup ( gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); CpuDeadLoop (); } + + // + // Restore to the TPL where this callback handler is called. + // + gBS->RaiseTPL (REDFISH_FEATURE_CORE_TPL); } =20 /** @@ -670,7 +682,7 @@ RedfishFeatureCoreEntryPoint ( =20 Status =3D gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, + REDFISH_FEATURE_CORE_TPL, RedfishFeatureDriverStartup, (CONST VOID *)&mFeatureDriverStartupContext, EventGuid, --=20 2.17.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 (#112100): https://edk2.groups.io/g/devel/message/112100 Mute This Topic: https://groups.io/mt/103009658/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-