On Sunday, January 04, 2015 08:48:21 AM Viresh Kumar wrote:
On 4 January 2015 at 03:28, Rafael J. Wysocki rjw@rjwysocki.net wrote:
On Friday, January 02, 2015 11:16:39 AM Viresh Kumar wrote:
__cpufreq_stats_create_table() is called from:
- policy create notifier: stats will always be NULL here
- cpufreq_stats_init() calls it for all CPUs as cpufreq-stats can be initialized after cpufreq driver. Because CPUs share clock lines, 'stats' will be NULL here for the first cpu only and will return back for others.
While we return for other CPUs, we don't return the right error value. We must return -EEXIST, as that is the case here.
What exactly is wrong with -EBUSY, then?
Its not that could would fail with EBUSY but this is what I thought. Generally:
- Returning EBUSY means: we are busy right not try again. And that might be
immediate.
- Returning EEXIST means: 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.
Now note how much useful the above is than the stuff in your original changelog.
I'd say all depends on whether or not the callers deal with the error code appropriately. If it is propagated all the way to user space, it really should *not* be -EBUSY, but otherwise this is a matter of how the callers handle the given error code.