Subrata Banik submitted this change.

View Change

Approvals: Subrata Banik: Looks good to me, approved build bot (Jenkins): Verified Jamie Ryu: Looks good to me, but someone else must approve
soc/intel/cmn/block/pmc: Fix prev_sleep_state string name mapping

commit d078ef2152052b5ce8686249dcd05ebd50010889
("soc/intel/cmn/block/pmc: Add previous sleep state strings in log")
used SLP_TYP numbers to map ACPI sleep state value. This incorrectly
printed wrong string for prev_sleep_state during S5.

ex: after a cold reset the previous sleep state printed was
[DEBUG] prev_sleep_state 5 (S3)

This patch corrects this by using ACPI sleep state numbers for mapping
the prev_sleep_state values.

TEST=test the logs on google/rex board after cold reset
[DEBUG] prev_sleep_state 5 (S5)

Signed-off-by: Anil Kumar <anil.kumar.k@intel.com>
Change-Id: I9bcdacc4d01a8d827a6abdf9af2b9e5d686ed847
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80144
Reviewed-by: Jamie Ryu <jamie.m.ryu@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
---
M src/soc/intel/common/block/pmc/pmclib.c
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c
index f11926c..c58b3a4 100644
--- a/src/soc/intel/common/block/pmc/pmclib.c
+++ b/src/soc/intel/common/block/pmc/pmclib.c
@@ -463,11 +463,11 @@
{
/* Define the sleep state string */
static const char * const acpi_sleep_states[] = {
- [SLP_TYP_S0] = "S0",
- [SLP_TYP_S1] = "S1",
- [SLP_TYP_S3] = "S3",
- [SLP_TYP_S4] = "S4",
- [SLP_TYP_S5] = "S5",
+ [ACPI_S0] = "S0",
+ [ACPI_S1] = "S1",
+ [ACPI_S3] = "S3",
+ [ACPI_S4] = "S4",
+ [ACPI_S5] = "S5",
};

pmc_fill_pm_reg_info(ps);

To view, visit change 80144. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I9bcdacc4d01a8d827a6abdf9af2b9e5d686ed847
Gerrit-Change-Number: 80144
Gerrit-PatchSet: 3
Gerrit-Owner: Anil Kumar K <anil.kumar.k@intel.com>
Gerrit-Reviewer: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Gerrit-Reviewer: Hannah Williams <hannah.williams@intel.com>
Gerrit-Reviewer: Jamie Ryu <jamie.m.ryu@intel.com>
Gerrit-Reviewer: Marx Wang <marx.wang@intel.com>
Gerrit-Reviewer: Ravishankar Sarawadi <ravishankar.sarawadi@intel.com>
Gerrit-Reviewer: Subrata Banik <subratabanik@google.com>
Gerrit-Reviewer: Wonkyu Kim <wonkyu.kim@intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged