]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cpufreq: acpi-cpufreq: Skip initialization if cpufreq driver is present
authorKyle Meyer <kyle.meyer@hpe.com>
Fri, 21 May 2021 22:19:06 +0000 (17:19 -0500)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 24 May 2021 14:15:08 +0000 (16:15 +0200)
commitc1d6d2fd2f642c67ddc7150aee05d63665fe71ca
tree336663cd9985b611db7e8684074419b284300313
parent9ff6774b9718d1a72d1b7c580fc579f1d9d7071f
cpufreq: acpi-cpufreq: Skip initialization if cpufreq driver is present

Revert part of commit 75c0758137c7a ("acpi-cpufreq: Fail initialization
if driver cannot be registered").

acpi-cpufreq is mutually exclusive with intel_pstate, but
acpi-cpufreq is loaded multiple times during startup while
intel_pstate is enabled.

On systems using systemd the kernel triggers one uevent for each
device as a result of systemd-udev-trigger.service. The service
exists to retrigger all devices as uevents sent by the kernel before
systemd-udevd is running are missed.

The delay caused by systemd-udevd repeatedly loading the driver,
getting a fail return, and unloading the driver twice per logical
CPU has a significant impact on the startup time, and can cause some
devices to be unavailable after reaching the root login prompt.

Load the driver once but skip initialization if a cpufreq driver
exists by changing the return value of cpufreq_get_current_driver()
from -EEXIST to 0.

Fixes: 75c0758137c7a ("acpi-cpufreq: Fail initialization if driver cannot be registered")
Signed-off-by: Kyle Meyer <kyle.meyer@hpe.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/acpi-cpufreq.c