]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: stats: return -EEXIST when stats are already allocated
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 6 Jan 2015 15:39:01 +0000 (21:09 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 23 Jan 2015 22:06:43 +0000 (23:06 +0100)
commit6669834eca09d54e6342725091d2bb2fed3015af
treeae16c4a368f9a647e16d0b6f316402c6f8032fd1
parent3ca2b6a363d526227194f3a49e1dea578c50ec54
cpufreq: stats: return -EEXIST when stats are already allocated

__cpufreq_stats_create_table() is called from:

- cpufreq notifier on creation of a new policy. Stats will always be
  NULL here.
- cpufreq_stats_init() for all CPUs as cpufreq-stats might have been
  initialized after cpufreq driver. For any policy, 'stats' will be
  NULL for the first CPU only and will be valid for all other CPUs
  managed by the same policy.

While we return for other CPUs, we don't return the right error value.
It's not that we would fail with -EBUSY. But generally, this is what
these return values mean:
- EBUSY: we are busy right now, try again. And the retry attempt might
  be immediate.
- EEXIST: We already have what you are trying to create and there is no
  need to create it again, and so no more tries are required.

Reviewed-by: Prarit Bhargava <prarit@redhat.com>
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