]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpufreq: Reference count policy in cpufreq_update_limits()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 28 Mar 2025 20:39:08 +0000 (21:39 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 1 Apr 2025 16:44:12 +0000 (18:44 +0200)
commit9e4e249018d208678888bdf22f6b652728106528
treeec8a7d37973e058126a960f5c7d35f4f700a5ea3
parent7d20aa5c32ac8bd272b5470ddbd7ac6e0cb35714
cpufreq: Reference count policy in cpufreq_update_limits()

Since acpi_processor_notify() can be called before registering a cpufreq
driver or even in cases when a cpufreq driver is not registered at all,
cpufreq_update_limits() needs to check if a cpufreq driver is present
and prevent it from being unregistered.

For this purpose, make it call cpufreq_cpu_get() to obtain a cpufreq
policy pointer for the given CPU and reference count the corresponding
policy object, if present.

Fixes: 5a25e3f7cc53 ("cpufreq: intel_pstate: Driver-specific handling of _PPC updates")
Closes: https://lore.kernel.org/linux-acpi/Z-ShAR59cTow0KcR@mail-itl
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://patch.msgid.link/1928789.tdWV9SEqCh@rjwysocki.net
drivers/cpufreq/cpufreq.c