summaryrefslogtreecommitdiff
path: root/drivers/reset
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2020-10-05 13:26:01 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-10-05 15:13:42 +0200
commit40c3bd4cfa6fe5756344709b98611a1ddd15bf9d (patch)
tree7d305f553fa8340a32e691338a63fda41b3ccffe /drivers/reset
parentfccd2f0e629b357437bebc015810f7f1957a4643 (diff)
cpufreq: stats: Defer stats update to cpufreq_stats_record_transition()
In order to prepare for lock-less stats update, add support to defer any updates to it until cpufreq_stats_record_transition() is called. The stats were updated from two places earlier: - show_time_in_state(): This can be easily deferred, all we need is to calculate the delta duration again in this routine to show the current state's time-in-state. - store_reset(): This is a bit tricky as we need to clear the stats here and avoid races with simultaneous call to cpufreq_stats_record_transition(). Fix that by deferring the reset of the stats (within the code) to the next call to cpufreq_stats_record_transition(), but since we need to keep showing the right stats until that time, we capture the reset time and account for the time since last time reset was called until the time cpufreq_stats_record_transition() update the stats. User space will continue seeing the stats correctly, everything will be 0 after the stats are reset, apart from the time-in-state of the current state, until the time a frequency switch happens. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> [ rjw: Minor changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/reset')
0 files changed, 0 insertions, 0 deletions