[PATCH V3 15/16] platform/x86/intel/pmc/ssram: Make PMT registration optional

David E. Box
2026-05-01T23:11:23Z

The SSRAM telemetry driver extracts essential PMC device ID and power
management base address information that intel_pmc_core depends on for core
functionality. If PMT registration failure prevents this critical data from
being available, intel_pmc_core operation would break entirely. Therefore,
PMT registration failures must not block access to this data.

Change the behavior to log a warning when PMT registration fails but
continue with successful driver initialization, ensuring the primary
telemetry data remains accessible to dependent drivers.

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
---
V3 changes:
- Dropped the standalone cleanup-pattern patch from this refreshed
series retaining the simpler ssram pointer flow requested in review.
- Folded PMT-registration-optional handling onto that simpler flow
with no intended functional change.

V2 changes:
- Update commit message for clarity
- Also apply the PCI telemetry path

drivers/platform/x86/intel/pmc/ssram_telemetry.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/intel/pmc/ssram_telemetry.c b/drivers/platform/x86/intel/pmc/ssram_telemetry.c
index a253903b8ea3..9c3af822e262 100644
--- a/drivers/platform/x86/intel/pmc/ssram_telemetry.c
+++ b/drivers/platform/x86/intel/pmc/ssram_telemetry.c
@@ -109,6 +109,7 @@ pmc_ssram_telemetry_get_pmc_pci(struct pci_dev *pcidev, unsigned int pmc_idx, u3
void __iomem __free(pmc_ssram_telemetry_iounmap) *tmp_ssram = NULL;
void __iomem __free(pmc_ssram_telemetry_iounmap) *ssram = NULL;
u64 ssram_base;
+ int ret;

ssram_base = pci_resource_start(pcidev, 0);
tmp_ssram = ioremap(ssram_base, SSRAM_HDR_SIZE);
@@ -128,7 +129,6 @@ pmc_ssram_telemetry_get_pmc_pci(struct pci_dev *pcidev, unsigned int pmc_idx, u3
ssram = ioremap(ssram_base, SSRAM_HDR_SIZE);
if (!ssram)
return -ENOMEM;
-
} else {
ssram = no_free_ptr(tmp_ssram);
}
@@ -136,7 +136,11 @@ pmc_ssram_telemetry_get_pmc_pci(struct pci_dev *pcidev, unsigned int pmc_idx, u3
pmc_ssram_get_devid_pwrmbase(ssram, pmc_idx);

/* Find and register and PMC telemetry entries */
- return pmc_ssram_telemetry_add_pmt(pcidev, ssram_base, ssram);
+ ret = pmc_ssram_telemetry_add_pmt(pcidev, ssram_base, ssram);
+ if (ret)
+ dev_warn(&pcidev->dev, "could not register PMT\n");
+
+ return 0;
}

static int pmc_ssram_telemetry_pci_init(struct pci_dev *pcidev)
@@ -209,7 +213,7 @@ static int pmc_ssram_telemetry_acpi_init(struct pci_dev *pcidev,

ret = intel_vsec_register(&pcidev->dev, &info);
if (ret)
- return ret;
+ dev_warn(&pcidev->dev, "could not register PMT\n");

return pmc_ssram_telemetry_get_pmc_acpi(pcidev, index);
}
--
2.43.0