Skip to content

Commit efebfa8

Browse files
Shyam Sundar S Kjwrdegoede
authored andcommitted
platform/x86: amd: pmc: provide user message where s0ix is not supported
Some platforms do not support hardware backed s0i3 transitions. When such CPUs are detected, provide a warning message to the user. Suggested-by: Sanket Goswami <Sanket.Goswami@amd.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20230412111500.2602529-1-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent f6e7ac4 commit efebfa8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • drivers/platform/x86/amd

drivers/platform/x86/amd/pmc.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
#define AMD_CPU_ID_YC 0x14B5
9595
#define AMD_CPU_ID_CB 0x14D8
9696
#define AMD_CPU_ID_PS 0x14E8
97+
#define AMD_CPU_ID_SP 0x14A4
9798

9899
#define PMC_MSG_DELAY_MIN_US 50
99100
#define RESPONSE_REGISTER_LOOP_MAX 20000
@@ -886,6 +887,7 @@ static const struct pci_device_id pmc_pci_ids[] = {
886887
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_RN) },
887888
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_PCO) },
888889
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_RV) },
890+
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_SP) },
889891
{ }
890892
};
891893

@@ -964,6 +966,13 @@ static int amd_pmc_probe(struct platform_device *pdev)
964966
}
965967

966968
dev->cpu_id = rdev->device;
969+
970+
if (dev->cpu_id == AMD_CPU_ID_SP) {
971+
dev_warn_once(dev->dev, "S0i3 is not supported on this hardware\n");
972+
err = -ENODEV;
973+
goto err_pci_dev_put;
974+
}
975+
967976
dev->rdev = rdev;
968977
err = amd_smn_read(0, AMD_PMC_BASE_ADDR_LO, &val);
969978
if (err) {

0 commit comments

Comments
 (0)