cpufreq: make interface functions and lock holding state clear
authorSchspa Shi <schspa@gmail.com>
Mon, 16 May 2022 03:02:51 +0000 (11:02 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 17 May 2022 19:39:05 +0000 (21:39 +0200)
commit514ff1bcd98d7f57361025e2200b803d3ddde6c8
treed561d0cba1de0281c5f5a84148ca8c54622e5a03
parentd4627a287e251efed59f2b4bda82c5950768c963
cpufreq: make interface functions and lock holding state clear

cpufreq_offline() calls offline() and exit() under the policy rwsem
But they are called outside the rwsem in cpufreq_online().

Make cpufreq_online() call offline() and exit() as well as online() and
init() under the policy rwsem to achieve a clear lock relationship.

All of the init() and online() implementations in the tree only
initialize the policy object without attempting to acquire the policy
rwsem and they won't call cpufreq APIs attempting to acquire it.

Signed-off-by: Schspa Shi <schspa@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c