From: Eric Dong <eric.dong@intel.com>
To: edk2-devel@lists.01.org
Cc: Ruiyu Ni <ruiyu.ni@intel.com>, Jiewen Yao <jiewen.yao@intel.com>,
Laszlo Ersek <lersek@redhat.com>
Subject: [Patch] UefiCpuPkg/S3Resume2Pei: Handle Communicate Ppi not exist issue.
Date: Thu, 12 Oct 2017 16:37:58 +0800 [thread overview]
Message-ID: <1507797478-13028-1-git-send-email-eric.dong@intel.com> (raw)
Current code assume Communicate Ppi always existed, so it adds
ASSERT to confirm it. Ovmf platform happened not has this Ppi, so
the ASSERT been trig. This patch handle Ppi not existed case.
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
---
UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
index c2171cb..e0c2d36 100644
--- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
+++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
@@ -465,7 +465,7 @@ SignalEndOfS3Resume (
SMM_COMMUNICATE_HEADER_64 Header64;
VOID *CommBuffer;
- DEBUG ((EFI_D_INFO, "SignalEndOfS3Resume - Enter\n"));
+ DEBUG ((DEBUG_INFO, "SignalEndOfS3Resume - Enter\n"));
//
// This buffer consumed in DXE phase, so base on DXE mode to prepare communicate buffer.
@@ -484,29 +484,27 @@ SignalEndOfS3Resume (
}
CopyGuid (CommBuffer, &gEdkiiSmmEndOfS3ResumeProtocolGuid);
- //
- // Get needed resource
- //
Status = PeiServicesLocatePpi (
&gEfiPeiSmmCommunicationPpiGuid,
0,
NULL,
(VOID **)&SmmCommunicationPpi
);
- ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "Locate Smm Communicate Ppi failed (%r)!\n", Status));
+ return Status;
+ }
- //
- // Send command
- //
Status = SmmCommunicationPpi->Communicate (
SmmCommunicationPpi,
(VOID *)CommBuffer,
&CommSize
);
- ASSERT_EFI_ERROR (Status);
-
- DEBUG ((EFI_D_INFO, "SignalEndOfS3Resume - Exit (%r)\n", Status));
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "SmmCommunicationPpi->Communicate return failure (%r)!\n", Status));
+ }
+ DEBUG ((DEBUG_INFO, "SignalEndOfS3Resume - Exit (%r)\n", Status));
return Status;
}
@@ -587,8 +585,7 @@ S3ResumeBootOs (
//
// Signal EndOfS3Resume event.
//
- Status = SignalEndOfS3Resume ();
- ASSERT_EFI_ERROR (Status);
+ SignalEndOfS3Resume ();
//
// report status code on S3 resume
--
2.7.0.windows.1
next reply other threads:[~2017-10-12 8:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 8:37 Eric Dong [this message]
2017-10-12 9:42 ` [Patch] UefiCpuPkg/S3Resume2Pei: Handle Communicate Ppi not exist issue Laszlo Ersek
2017-10-12 9:55 ` Dong, Eric
2017-10-24 9:23 ` Zeng, Star
-- strict thread matches above, loose matches on Subject: below --
2017-10-12 8:33 Eric Dong
2017-10-12 8:35 ` Dong, Eric
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1507797478-13028-1-git-send-email-eric.dong@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox