linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Viresh Kumar <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: cl@linux.com, linux-kernel@vger.kernel.org, tglx@linutronix.de,
	hpa@zytor.com, viresh.kumar@linaro.org, tj@kernel.org,
	mingo@kernel.org
Subject: [tip:x86/platform] x86/uv/time: Migrate to new set-state interface
Date: Thu, 30 Jul 2015 12:28:33 -0700	[thread overview]
Message-ID: <tip-ca53d434f7e63352c9edd1ad8cde4dfe11da44aa@git.kernel.org> (raw)
In-Reply-To: <52e04139746222a2e82a96d13953cbc306cfb59b.1437042675.git.viresh.kumar@linaro.org>

Commit-ID:  ca53d434f7e63352c9edd1ad8cde4dfe11da44aa
Gitweb:     http://git.kernel.org/tip/ca53d434f7e63352c9edd1ad8cde4dfe11da44aa
Author:     Viresh Kumar <viresh.kumar@linaro.org>
AuthorDate: Thu, 16 Jul 2015 16:28:47 +0530
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 30 Jul 2015 21:25:38 +0200

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>
---
 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 a244237..2b158a9 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)

  reply	other threads:[~2015-07-30 19:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16 10:58 [PATCH 0/5] X86: Migrate clockevent drivers to 'set-state' interface Viresh Kumar
2015-07-16 10:58 ` [PATCH 1/5] x86/apic: Migrate to new " Viresh Kumar
2015-07-30 19:27   ` [tip:x86/apic] x86/apic: Migrate apic timer to new set_state interface tip-bot for Viresh Kumar
2015-07-16 10:58 ` [PATCH 2/5] x86/hpet: Migrate to new 'set-state' interface Viresh Kumar
2015-07-30 19:30   ` [tip:x86/core] x86/hpet: Migrate to new set_state interface tip-bot for Viresh Kumar
2015-07-16 10:58 ` [PATCH 3/5] x86/lguest/timer: Migrate to new 'set-state' interface Viresh Kumar
2015-07-16 11:59   ` Rusty Russell
2015-07-30 19:28   ` [tip:x86/platform] x86/lguest/timer: Migrate to new set-state interface tip-bot for Viresh Kumar
2015-07-16 10:58 ` [PATCH 4/5] x86/uv/time: Migrate to new 'set-state' interface Viresh Kumar
2015-07-30 19:28   ` tip-bot for Viresh Kumar [this message]
2015-07-30 20:04     ` [tip:x86/platform] x86/uv/time: Migrate to new set-state interface Christoph Lameter
2015-07-30 22:25       ` Thomas Gleixner
2015-07-31  5:21       ` Viresh Kumar
2015-07-31 12:20         ` Dimitri Sivanich
2015-08-04 15:25           ` Nathan Zimmer
2015-08-05  5:15             ` Viresh Kumar
2015-08-05 14:29               ` Nathan Zimmer
2015-07-16 10:58 ` [PATCH 5/5] x86/xen/time: Migrate to new 'set-state' interface Viresh Kumar
2015-07-30 19:28   ` [tip:x86/platform] x86/xen/time: Migrate to new set-state interface tip-bot for Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-ca53d434f7e63352c9edd1ad8cde4dfe11da44aa@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=cl@linux.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).