Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1185720

[PATCH 4/5] x86/uv/time: Migrate to new 'set-state' interface

From Viresh Kumar <viresh.kumar@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 4/5] x86/uv/time: Migrate to new 'set-state' interface
Date 2015-07-16 13:00 +0200
Message-ID <pMP3t-4oJ-35@gated-at.bofh.it> (permalink)
References <pMP3s-4oJ-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 arch/x86/platform/uv/uv_time.c | 37 +++++++++++++------------------------
 1 file changed, 13 insertions(+), 24 deletions(-)

diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c
index a244237f3cfa..2b158a9fa1d7 100644
--- a/arch/x86/platform/uv/uv_time.c
+++ b/arch/x86/platform/uv/uv_time.c
@@ -32,8 +32,7 @@
 
 static cycle_t uv_read_rtc(struct clocksource *cs);
 static int uv_rtc_next_event(unsigned long, struct clock_event_device *);
-static void uv_rtc_timer_setup(enum clock_event_mode,
-				struct clock_event_device *);
+static int uv_rtc_shutdown(struct clock_event_device *evt);
 
 static struct clocksource clocksource_uv = {
 	.name		= RTC_NAME,
@@ -44,14 +43,14 @@ static struct clocksource clocksource_uv = {
 };
 
 static struct clock_event_device clock_event_device_uv = {
-	.name		= RTC_NAME,
-	.features	= CLOCK_EVT_FEAT_ONESHOT,
-	.shift		= 20,
-	.rating		= 400,
-	.irq		= -1,
-	.set_next_event	= uv_rtc_next_event,
-	.set_mode	= uv_rtc_timer_setup,
-	.event_handler	= NULL,
+	.name			= RTC_NAME,
+	.features		= CLOCK_EVT_FEAT_ONESHOT,
+	.shift			= 20,
+	.rating			= 400,
+	.irq			= -1,
+	.set_next_event		= uv_rtc_next_event,
+	.set_state_shutdown	= uv_rtc_shutdown,
+	.event_handler		= NULL,
 };
 
 static DEFINE_PER_CPU(struct clock_event_device, cpu_ced);
@@ -321,24 +320,14 @@ static int uv_rtc_next_event(unsigned long delta,
 }
 
 /*
- * Setup the RTC timer in oneshot mode
+ * Shutdown the RTC timer
  */
-static void uv_rtc_timer_setup(enum clock_event_mode mode,
-			       struct clock_event_device *evt)
+static int uv_rtc_shutdown(struct clock_event_device *evt)
 {
 	int ced_cpu = cpumask_first(evt->cpumask);
 
-	switch (mode) {
-	case CLOCK_EVT_MODE_PERIODIC:
-	case CLOCK_EVT_MODE_ONESHOT:
-	case CLOCK_EVT_MODE_RESUME:
-		/* Nothing to do here yet */
-		break;
-	case CLOCK_EVT_MODE_UNUSED:
-	case CLOCK_EVT_MODE_SHUTDOWN:
-		uv_rtc_unset_timer(ced_cpu, 1);
-		break;
-	}
+	uv_rtc_unset_timer(ced_cpu, 1);
+	return 0;
 }
 
 static void uv_rtc_interrupt(void)
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] X86: Migrate clockevent drivers to 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200
  [PATCH 1/5] x86/apic: Migrate to new 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200
  [PATCH 5/5] x86/xen/time: Migrate to new 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200
  [PATCH 3/5] x86/lguest/timer: Migrate to new 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200
    Re: [PATCH 3/5] x86/lguest/timer: Migrate to new 'set-state' interface Rusty Russell <rusty@rustcorp.com.au> - 2015-07-16 23:20 +0200
  [PATCH 2/5] x86/hpet: Migrate to new 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200
  [PATCH 4/5] x86/uv/time: Migrate to new 'set-state' interface Viresh Kumar <viresh.kumar@linaro.org> - 2015-07-16 13:00 +0200

csiph-web