Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/uv/time: Migrate to new set-state interface

Migrate uv driver to the new 'set-state' interface provided by
clockevents core, the earlier 'set-mode' interface is marked obsolete
now.

This also enables us to implement callbacks for new states of clockevent
devices, for example: ONESHOT_STOPPED.

We weren't doing anything while switching modes other than in shutdown
mode and so those are not implemented.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linaro-kernel@lists.linaro.org
Cc: Christoph Lameter <cl@linux.com>
Cc: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/52e04139746222a2e82a96d13953cbc306cfb59b.1437042675.git.viresh.kumar@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Viresh Kumar and committed by
Thomas Gleixner
ca53d434 c2e13cc2

+13 -24
+13 -24
arch/x86/platform/uv/uv_time.c
··· 32 32 33 33 static cycle_t uv_read_rtc(struct clocksource *cs); 34 34 static int uv_rtc_next_event(unsigned long, struct clock_event_device *); 35 - static void uv_rtc_timer_setup(enum clock_event_mode, 36 - struct clock_event_device *); 35 + static int uv_rtc_shutdown(struct clock_event_device *evt); 37 36 38 37 static struct clocksource clocksource_uv = { 39 38 .name = RTC_NAME, ··· 43 44 }; 44 45 45 46 static struct clock_event_device clock_event_device_uv = { 46 - .name = RTC_NAME, 47 - .features = CLOCK_EVT_FEAT_ONESHOT, 48 - .shift = 20, 49 - .rating = 400, 50 - .irq = -1, 51 - .set_next_event = uv_rtc_next_event, 52 - .set_mode = uv_rtc_timer_setup, 53 - .event_handler = NULL, 47 + .name = RTC_NAME, 48 + .features = CLOCK_EVT_FEAT_ONESHOT, 49 + .shift = 20, 50 + .rating = 400, 51 + .irq = -1, 52 + .set_next_event = uv_rtc_next_event, 53 + .set_state_shutdown = uv_rtc_shutdown, 54 + .event_handler = NULL, 54 55 }; 55 56 56 57 static DEFINE_PER_CPU(struct clock_event_device, cpu_ced); ··· 320 321 } 321 322 322 323 /* 323 - * Setup the RTC timer in oneshot mode 324 + * Shutdown the RTC timer 324 325 */ 325 - static void uv_rtc_timer_setup(enum clock_event_mode mode, 326 - struct clock_event_device *evt) 326 + static int uv_rtc_shutdown(struct clock_event_device *evt) 327 327 { 328 328 int ced_cpu = cpumask_first(evt->cpumask); 329 329 330 - switch (mode) { 331 - case CLOCK_EVT_MODE_PERIODIC: 332 - case CLOCK_EVT_MODE_ONESHOT: 333 - case CLOCK_EVT_MODE_RESUME: 334 - /* Nothing to do here yet */ 335 - break; 336 - case CLOCK_EVT_MODE_UNUSED: 337 - case CLOCK_EVT_MODE_SHUTDOWN: 338 - uv_rtc_unset_timer(ced_cpu, 1); 339 - break; 340 - } 330 + uv_rtc_unset_timer(ced_cpu, 1); 331 + return 0; 341 332 } 342 333 343 334 static void uv_rtc_interrupt(void)