]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg/Library: PcdAcpiS3Enable set FALSE cause Assert
authorlijun10x <junx1.li@intel.com>
Thu, 2 Feb 2023 06:20:57 +0000 (14:20 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 15 Feb 2023 06:42:12 +0000 (06:42 +0000)
commit77d6772708541a2ddf093af79816dd1831581388
treed12c28e21dfd118e3a32d6b73f15dce4eb79d5be
parent68c1bedbf297b57a336a2edc046f1f9874ba69fa
MdeModulePkg/Library: PcdAcpiS3Enable set FALSE cause Assert

Some platforms don't support S3 with PcdAcpiS3Enable set as False.
Debug mode bios will ASSERT at this time as Follows.
ASSERT_RETURN_ERROR (Status = Out of Resources)
DXE_ASSERT!: Edk2\MdePkg\Library\BaseS3PciSegmentLib\S3PciSegmentLib.c
(61): !(((INTN)(RETURN_STATUS)(Status)) < 0)

Steps to reproduce the issue:
1.Set PcdAcpiS3Enable to FALSE.
2.Build the bios in debug mode.
3.Power on and Check the serial log.
Note: Prerequisite is that S3PciSegmentLib is Called and
the caller's code is run.

Root Cause:
S3PciSegmentLib call S3BootScriptLib controlled by PcdAcpiS3Enable.
If PcdAcpiS3Enable set as false, S3BootScriptLib will return error
status(Out of Resources).
S3PciSegmentLib will ASSERT if S3BootScriptLib return error.

Solution:
Make S3BootScriptLib return success if PcdAcpiS3Enable was disabled,
which behave as a null S3BootScriptLib instance which just return success
for no action is required to do.

Signed-off-by: JunX1 Li <junx1.li@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sunny Wang <sunny.wang@arm.com>
Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: G Edhaya Chandran <edhaya.chandran@arm.com>
Cc: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c