summaryrefslogtreecommitdiff
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2022-04-11 17:38:20 +0300
committerHans de Goede <hdegoede@redhat.com>2022-04-13 14:49:48 +0300
commitb0c07116c894325d40a218f558047f925e4b3bdb (patch)
treedfb652a1c62db1b7582c7f6cfa0c19212146d87c /drivers/platform/x86
parent63585d5958dacd1f2ac73bff0f1f37a98ba348e4 (diff)
downloadlinux-b0c07116c894325d40a218f558047f925e4b3bdb.tar.xz
platform/x86: amd-pmc: Avoid reading SMU version at probe time
Currently the SMU version only used to determine whether the SMU supports reading the idle mask. To speed up startup, move it to the first time the idle mask is read. This decreases the startup time from ~28500us to 100us. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20220411143820.13971-3-mario.limonciello@amd.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/amd-pmc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
index 73275e6b21e0..668a1d6c11ee 100644
--- a/drivers/platform/x86/amd-pmc.c
+++ b/drivers/platform/x86/amd-pmc.c
@@ -422,6 +422,13 @@ static int amd_pmc_idlemask_show(struct seq_file *s, void *unused)
struct amd_pmc_dev *dev = s->private;
int rc;
+ /* we haven't yet read SMU version */
+ if (!dev->major) {
+ rc = amd_pmc_get_smu_version(dev);
+ if (rc)
+ return rc;
+ }
+
if (dev->major > 56 || (dev->major >= 55 && dev->minor >= 37)) {
rc = amd_pmc_idlemask_read(dev, NULL, s);
if (rc)
@@ -875,7 +882,6 @@ static int amd_pmc_probe(struct platform_device *pdev)
return err;
}
- amd_pmc_get_smu_version(dev);
platform_set_drvdata(pdev, dev);
#ifdef CONFIG_SUSPEND
err = acpi_register_lps0_dev(&amd_pmc_s2idle_dev_ops);