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@xxxxxxxxxx> Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx> --- v1->v2: * Add tag drivers/platform/x86/amd-pmc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c index 1f68a3cb1973..be781b4e2ce3 100644 --- a/drivers/platform/x86/amd-pmc.c +++ b/drivers/platform/x86/amd-pmc.c @@ -418,6 +418,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) @@ -867,7 +874,6 @@ static int amd_pmc_probe(struct platform_device *pdev) return err; } - amd_pmc_get_smu_version(dev); platform_set_drvdata(pdev, dev); err = acpi_register_lps0_dev(&amd_pmc_s2idle_dev_ops); if (err) -- 2.34.1