]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit28ef5cda58b7b0fbfe06f63e642fe761ca3a12fa
treed561d0cba1de0281c5f5a84148ca8c54622e5a03
parent396d1fd31cd8b229ba0f748dfc7b3c37c95dc675
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