platform/x86/intel/pmc: Use each PMC's own status map on S0ix failure
Subsystems (2)
PATCH 1/1 platform/x86/intel/pmc: Use each PMC's own status map on S0ix failure
When S0ix entry fails and warn_on_s0ix_failures is set, pmc_core_resume_common() dumps the latched LPM status registers of every PMC. The loop over pmcdev->pmcs[] however passes the register offset and bit maps of the main PMC to pmc_core_lpm_display() for all of them, so the registers of the secondary PMCs are read at the main PMC's offset and decoded with the main PMC's bit names. On platforms with more than one PMC, such as Arrow Lake-HX with an 800 series PCH, the dump attributes the PCH's power gating state to the wrong IP blocks, which makes it useless for finding the device that blocks S0ix.
Use the status offset and maps of the PMC being displayed.
---
Notes:
Tested on a Lenovo ThinkPad P16 Gen 3 (Core Ultra 9 275HX, JHL9580 Barlow Ridge host, I226 Ethernet), in daily use since 2026-09-17.
drivers/platform/x86/intel/pmc/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/platform/x86/intel/pmc/core.c +3 -3
@@ -2068,8 +2068,6 @@ int pmc_core_resume_common(struct pmc_dev *pmcdev) {struct device *dev = &pmcdev->pdev->dev;struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN ]; -const struct pmc_bit_map **maps = pmc->map->lpm_sts; -int offset = pmc->map->lpm_status_offset;unsigned int pmc_idx, i;/* Check if the syspend used S0ix */
@@ -2114,7 +2112,9 @@ int pmc_core_resume_common(struct pmc_dev *pmcdev)if (!pmc)continue ;if (pmc->map->lpm_sts) -pmc_core_lpm_display (pmc, dev,NULL , offset, pmc_idx,"STATUS" , maps); +pmc_core_lpm_display (pmc, dev,NULL , + pmc->map->lpm_status_offset, + pmc_idx,"STATUS" , pmc->map->lpm_sts); }return 0 ;
base-commit: 32c52ec87d6245ee2d12ed5dd509e40062939b50
Signature · 1 line
2.54.0
Ilpo Järvinen
maintainerQuoted 3 lines · Cole Leavitt
When S0ix entry fails and
warn_on_s0ix_failuresis set,pmc_core_resume_common()dumps the latched LPM status registers of every PMC. The loop over pmcdev->pmcs[] however passes the register offset and
One space is enough.
Quoted 34 lines
bit maps of the main PMC to
pmc_core_lpm_display()for all of them, so the registers of the secondary PMCs are read at the main PMC's offset and decoded with the main PMC's bit names. On platforms with more than one PMC, such as Arrow Lake-HX with an 800 series PCH, the dump attributes the PCH's power gating state to the wrong IP blocks, which makes it useless for finding the device that blocks S0ix.Use the status offset and maps of the PMC being displayed.
Fixes 2bcef4529222 ("platform/x86:intel/pmc: Enable debugfs multiple PMC support")Signed-off-by Cole Leavitt <[email protected]>---
Notes:
Tested on a Lenovo ThinkPad P16 Gen 3 (Core Ultra 9 275HX, JHL9580 Barlow Ridge host, I226 Ethernet), in daily use since 2026-09-17.drivers/platform/x86/intel/pmc/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/platform/x86/intel/pmc/core.c +0
-2@@ -2068,8 +2068,6 @@ int pmc_core_resume_common(struct pmc_dev *pmcdev) {struct device *dev = &pmcdev->pdev->dev;struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN ]; -const struct pmc_bit_map **maps = pmc->map->lpm_sts; -int offset = pmc->map->lpm_status_offset;unsigned int pmc_idx, i;/* Check if the syspend used S0ix */
drivers/platform/x86/intel/pmc/core.c int pmc_core_resume_common(struct pmc_dev *pmcdev) · line 2117
Quoted 7 lines
drivers/platform/x86/intel/pmc/core.c +3
-1@@ -2114,7 +2112,9 @@ int pmc_core_resume_common(struct pmc_dev *pmcdev)if (!pmc)continue ;if (pmc->map->lpm_sts) -pmc_core_lpm_display (pmc, dev,NULL , offset, pmc_idx,"STATUS" , maps); +pmc_core_lpm_display (pmc, dev,NULL , + pmc->map->lpm_status_offset, + pmc_idx,"STATUS" , pmc->map->lpm_sts);
This looks good finding but I suggest you use intermediate variables similar to what the other callers of pmc_core_lpm_display() do. It would also allow converting that if check to use the same local var.
Signature · 1 line
i.