cpufreq: stats: Fix concurrency issues while resetting stats
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 1 Feb 2019 06:15:45 +0000 (11:45 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 1 Feb 2019 10:52:11 +0000 (11:52 +0100)
commit9795607dc41e7606e90e48bffe6927bee32cd336
tree5189380ea3c0ac3dfd6e39bce1dd92a09205c89c
parent10b818211d04805da731087e596fc7c6ce199dea
cpufreq: stats: Fix concurrency issues while resetting stats

It is possible for cpufreq_stats_clear_table() and
cpufreq_stats_record_transition() to get called concurrently and they
will try to update same variables simultaneously and may lead to
corruption of data.

Prevent that with the help of existing spinlock.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq_stats.c