Viresh Kumar viresh.kumar@linaro.org writes:
There is a requirement to add another mode: CLOCK_EVT_MODE_ONESHOT_STOPPED (lkml.org/lkml/2014/5/9/508) to clockevent devices and clockevent-drivers may or maynot support it. Drivers that don't support it can return failure codes on a call to ->set_mode(), which has a return type of 'void' currently.
Following steps are suggested (by tglx) to get this fixed:
- Add another callback ->set_dev_mode(), with return type 'int'.
- Covert clockevent drivers to use ->set_dev_mode() instead of ->set_mode().
- Once all are converted, remove support for ->set_mode().
This patch implements 'part 1' of this approach. It also marks ->set_mode() deprecated as ->set_dev_mode() should be used instead.
In order to propagate error codes to callers of clockevents_set_mode(), change its return type to 'int'. For now just add a WARN_ON() inside clockevents_set_mode() and don't explicitly handle any error codes at call sites, as the current modes are not expected/allowed to fail.
Reviewed-by: Preeti U Murthy preeti@linux.vnet.ibm.com Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
[...]
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index 61ed862..3d854aa 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c @@ -228,8 +228,13 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu) print_name_offset(m, dev->set_next_event); SEQ_printf(m, "\n");
- SEQ_printf(m, " set_mode: ");
nit: there are likely tools using /proc/timer_list, so IMO, it's probably not worth changing this string for this rename.
Kevin