]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: Use rwsem for protecting critical sections
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 6 Aug 2013 17:23:11 +0000 (22:53 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 10 Aug 2013 01:24:47 +0000 (03:24 +0200)
commite90c88b4f398cbcc9a473b81937a3b648046efdd
tree92a27a7908110c7bba019c46e5d3427b6dee42fe
parentd71f8bd36cd1cdac54c9c3ff7ce0d87352b6c786
cpufreq: Use rwsem for protecting critical sections

Critical sections of the cpufreq core are protected with the help of
the driver module owner's refcount, which isn't the correct approach,
because it causes rmmod to return an error when some routine has
updated that refcount.

Let's use rwsem for this purpose instead.  Only
cpufreq_unregister_driver() will use write sem
and everybody else will use read sem.

[rjw: Subject & changelog]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c