提交 b0c07116 编写于 作者: M Mario Limonciello 提交者: Hans de Goede

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: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NMario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20220411143820.13971-3-mario.limonciello@amd.comSigned-off-by: NHans de Goede <hdegoede@redhat.com>
上级 63585d59
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册