Skip to content

Commit 1d62ada

Browse files
rjingarjwrdegoede
authored andcommitted
platform/x86/intel/pmc: Add ssram_init flag in PMC discovery in Meteor Lake
If PMC discovery using pmc_core_ssram_init() was unsuccessful for the Meteor Lake platform, the legacy enumeration method is used. In this case pci device struct for the PMC SSRAM is not available and pmc_core_ssram_get_lpm_reqs() will not work. Add ssram_init flag to indicate if the PMC SSRAM initialization was successful or not. Call pmc_core_ssram_get_lpm_reqs() only if the ssram_init flag is set to true. Signed-off-by: Rajvi Jingar <rajvi.jingar@linux.intel.com> Link: https://lore.kernel.org/r/20231219042216.2592029-6-rajvi.jingar@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent d79c3c8 commit 1d62ada

File tree

1 file changed

+6
-1
lines changed
  • drivers/platform/x86/intel/pmc

1 file changed

+6
-1
lines changed

drivers/platform/x86/intel/pmc/mtl.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,7 @@ int mtl_core_init(struct pmc_dev *pmcdev)
994994
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_SOC];
995995
int ret;
996996
int func = 2;
997+
bool ssram_init = true;
997998

998999
mtl_d3_fixup();
9991000

@@ -1006,6 +1007,7 @@ int mtl_core_init(struct pmc_dev *pmcdev)
10061007
*/
10071008
ret = pmc_core_ssram_init(pmcdev, func);
10081009
if (ret) {
1010+
ssram_init = false;
10091011
dev_warn(&pmcdev->pdev->dev,
10101012
"ssram init failed, %d, using legacy init\n", ret);
10111013
pmc->map = &mtl_socm_reg_map;
@@ -1023,5 +1025,8 @@ int mtl_core_init(struct pmc_dev *pmcdev)
10231025
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
10241026
pmc_core_send_ltr_ignore(pmcdev, 3);
10251027

1026-
return pmc_core_ssram_get_lpm_reqs(pmcdev);
1028+
if (ssram_init)
1029+
return pmc_core_ssram_get_lpm_reqs(pmcdev);
1030+
1031+
return 0;
10271032
}

0 commit comments

Comments
 (0)