]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: Make cpufreq_online() call driver->offline() on errors
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Jun 2021 19:11:39 +0000 (21:11 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 23 Jun 2021 17:40:56 +0000 (19:40 +0200)
commit77c40e20728db38408eb095a19d989881ed24195
treeccf0289cc800208fe8bf6777abaf17e54d080d41
parent5ee9e12789954a94cbacc61d2a9f5b72cb1197ca
cpufreq: Make cpufreq_online() call driver->offline() on errors

In the CPU removal path the ->offline() callback provided by the
driver is always invoked before ->exit(), but in the cpufreq_online()
error path it is not, so ->exit() is expected to somehow know the
context in which it has been called and act accordingly.

That is less than straightforward, so make cpufreq_online() invoke
the driver's ->offline() callback, if present, on errors before
->exit() too.

This only potentially affects intel_pstate.

Fixes: 4e60e34e0269 ("cpufreq: Allow light-weight tear down and bring up of CPUs")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/cpufreq.c