Re: [PATCH v2] cpufreq: Make cpufreq_online() call driver->offline() on errors

From
Viresh Kumar <viresh.kumar@linaro.org>
Date
2021-06-23 03:11:00
Also in
lkml
Reply to
Rafael J. Wysocki, 2021-06-22
On 22-06-21, 21:11, Rafael J. Wysocki wrote:
From: Rafael J. Wysocki <redacted>
Subject: [PATCH] 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: 91a12e91dc39 ("cpufreq: Allow light-weight tear down and bring up of CPUs")
Signed-off-by: Rafael J. Wysocki <redacted>
---

-> v2:
   * Avoid calling ->offline() after a failing ->online().
   * Add a comment regarding the expected state after calling ->init().
   * Edit the changelog a bit.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh
Thread (5 messages) 5 messages, 3 authors, last reply 2021-06-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help