From nobody Fri Nov 1 12:28:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1517553949584120.53634147062041; Thu, 1 Feb 2018 22:45:49 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 067272239364B; Thu, 1 Feb 2018 22:40:03 -0800 (PST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 037202239363B for ; Thu, 1 Feb 2018 22:40:00 -0800 (PST) Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2018 22:45:39 -0800 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.19]) by fmsmga008.fm.intel.com with ESMTP; 01 Feb 2018 22:45:38 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,447,1511856000"; d="scan'208";a="14900500" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Fri, 2 Feb 2018 14:45:25 +0800 Message-Id: <20180202064530.407028-6-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.15.1.windows.2 In-Reply-To: <20180202064530.407028-1-ruiyu.ni@intel.com> References: <20180202064530.407028-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH 05/10] MdeModulePkg/ResetSystemRuntimeDxe: Add more debug message X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Star Zeng , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The patch adds more debug message in ResetSystem(). It also removes unnecessary check of mResetNotifyDepth. Cc: Liming Gao Cc: Michael D Kinney Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni --- .../Universal/ResetSystemRuntimeDxe/ResetSystem.c | 88 +++++++++++-------= ---- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c b/M= deModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c index 43400e1338..4b5af76999 100644 --- a/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c +++ b/MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c @@ -15,6 +15,10 @@ =20 #include "ResetSystem.h" =20 +GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 *mResetTypeStr[] =3D { + L"Cold", L"Warm", L"Shutdown", L"PlatformSpecific" +}; + // // The current ResetSystem() notification recursion depth // @@ -251,16 +255,6 @@ ResetSystem ( LIST_ENTRY *Link; RESET_NOTIFY_ENTRY *Entry; =20 - // - // Above the maximum recursion depth, so do the smallest amount of - // work to perform a cold reset. - // - if (mResetNotifyDepth >=3D MAX_RESET_NOTIFY_DEPTH) { - ResetCold (); - ASSERT (FALSE); - return; - } - // // Only do REPORT_STATUS_CODE() on first call to ResetSystem() // @@ -272,40 +266,47 @@ ResetSystem ( } =20 mResetNotifyDepth++; - if (!EfiAtRuntime () && mResetNotifyDepth < MAX_RESET_NOTIFY_DEPTH) { - // - // Call reset notification functions registered through the - // EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PROTOCOL. - // - for ( Link =3D GetFirstNode (&mPlatformSpecificResetFilter.ResetNotifi= es) - ; !IsNull (&mPlatformSpecificResetFilter.ResetNotifies, Link) - ; Link =3D GetNextNode (&mPlatformSpecificResetFilter.ResetNotifie= s, Link) - ) { - Entry =3D RESET_NOTIFY_ENTRY_FROM_LINK (Link); - Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); - } - // - // Call reset notification functions registered through the - // EFI_RESET_NOTIFICATION_PROTOCOL. - // - for ( Link =3D GetFirstNode (&mResetNotification.ResetNotifies) - ; !IsNull (&mResetNotification.ResetNotifies, Link) - ; Link =3D GetNextNode (&mResetNotification.ResetNotifies, Link) - ) { - Entry =3D RESET_NOTIFY_ENTRY_FROM_LINK (Link); - Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); - } - // - // call reset notification functions registered through the=20 - // EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PROTOCOL. - // - for ( Link =3D GetFirstNode (&mPlatformSpecificResetHandler.ResetNotif= ies) - ; !IsNull (&mPlatformSpecificResetHandler.ResetNotifies, Link) - ; Link =3D GetNextNode (&mPlatformSpecificResetHandler.ResetNotifi= es, Link) - ) { - Entry =3D RESET_NOTIFY_ENTRY_FROM_LINK (Link); - Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); + DEBUG ((DEBUG_INFO, "DXE ResetSystem2: Reset call depth =3D %d.\n", mRes= etNotifyDepth)); + + if (mResetNotifyDepth <=3D MAX_RESET_NOTIFY_DEPTH) { + if (!EfiAtRuntime ()) { + // + // Call reset notification functions registered through the + // EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PROTOCOL. + // + for ( Link =3D GetFirstNode (&mPlatformSpecificResetFilter.ResetNoti= fies) + ; !IsNull (&mPlatformSpecificResetFilter.ResetNotifies, Link) + ; Link =3D GetNextNode (&mPlatformSpecificResetFilter.ResetNotif= ies, Link) + ) { + Entry =3D RESET_NOTIFY_ENTRY_FROM_LINK (Link); + Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); + } + // + // Call reset notification functions registered through the + // EFI_RESET_NOTIFICATION_PROTOCOL. + // + for ( Link =3D GetFirstNode (&mResetNotification.ResetNotifies) + ; !IsNull (&mResetNotification.ResetNotifies, Link) + ; Link =3D GetNextNode (&mResetNotification.ResetNotifies, Link) + ) { + Entry =3D RESET_NOTIFY_ENTRY_FROM_LINK (Link); + Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); + } + // + // call reset notification functions registered through the=20 + // EDKII_PLATFORM_SPECIFIC_RESET_NOTIFICATION_PROTOCOL. + // + for ( Link =3D GetFirstNode (&mPlatformSpecificResetHandler.ResetNot= ifies) + ; !IsNull (&mPlatformSpecificResetHandler.ResetNotifies, Link) + ; Link =3D GetNextNode (&mPlatformSpecificResetHandler.ResetNoti= fies, Link) + ) { + Entry =3D RESET_NOTIFY_ENTRY_FROM_LINK (Link); + Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData); + } } + } else { + ASSERT (ResetType < ARRAY_SIZE (mResetTypeStr)); + DEBUG ((DEBUG_ERROR, "DXE ResetSystem2: Maximum reset call depth is me= t. Use the current reset type: %s!\n", mResetTypeStr[ResetType])); } =20 switch (ResetType) { @@ -331,7 +332,6 @@ ResetSystem ( } =20 ResetWarm (); - break; =20 case EfiResetCold: --=20 2.15.1.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel