Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86/intel/pmc/mtl: Use return value from pmc_core_ssram_init()

Instead of checking for a NULL regbase, use the return value from
pmc_core_ssram_init() to check if PMC discovery was successful. If not, use
the legacy enumeration method (which only works for the primary PMC).

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231129222132.2331261-15-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

David E. Box and committed by
Hans de Goede
642dd26f a01486dc

+8 -4
+8 -4
drivers/platform/x86/intel/pmc/mtl.c
··· 990 990 mtl_d3_fixup(); 991 991 992 992 pmcdev->resume = mtl_resume; 993 - 994 993 pmcdev->regmap_list = mtl_pmc_info_list; 995 - pmc_core_ssram_init(pmcdev); 996 994 997 - /* If regbase not assigned, set map and discover using legacy method */ 998 - if (!pmc->regbase) { 995 + /* 996 + * If ssram init fails use legacy method to at least get the 997 + * primary PMC 998 + */ 999 + ret = pmc_core_ssram_init(pmcdev); 1000 + if (ret) { 1001 + dev_warn(&pmcdev->pdev->dev, 1002 + "ssram init failed, %d, using legacy init\n", ret); 999 1003 pmc->map = &mtl_socm_reg_map; 1000 1004 ret = get_primary_reg_base(pmc); 1001 1005 if (ret)