Commit 8ce1fbb8 authored by Schspa Shi's avatar Schspa Shi Committed by Jinjie Ruan
Browse files

cpufreq: make interface functions and lock holding state clear

mainline inclusion
from mainline-v5.19-rc1
commit 514ff1bc
category: cleanup
bugzilla: https://gitee.com/openeuler/kernel/issues/I8EI9L
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=514ff1bcd98d7f57361025e2200b803d3ddde6c8



--------------------------------

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: default avatarSchspa Shi <schspa@gmail.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
[ rjw: Changelog edits ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>

Conflicts:
	drivers/cpufreq/cpufreq.c

Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
parent c8c0484f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment