LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>
Cc: linaro-kernel@lists.linaro.org, Kevin Hilman <khilman@linaro.org>,
	Preeti U Murthy <preeti@linux.vnet.ibm.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Frederic Weisbecker <fweisbec@gmail.com>,
	linaro-networking@linaro.org,
	Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH 3/3] clockevents: Don't validate dev->mode against CLOCK_EVT_MODE_UNUSED for new interface
Date: Fri, 27 Feb 2015 17:21:34 +0530	[thread overview]
Message-ID: <c6604fa1a77fe1fc8dcab87769857228fb1dadd5.1425037853.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1425037853.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1425037853.git.viresh.kumar@linaro.org>

It was a requirement in the legacy interface that drivers must initialize ->mode
field to 'CLOCK_EVT_MODE_UNUSED'. This field isn't used anymore by the new
interface and so should be only checked for the legacy interface.

Probably it can be dropped as well as core doesn't rely on it anymore, but lets
keep it to support legacy interface.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 kernel/time/clockevents.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 6e53e9a0c2e8..73689df1e4b8 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -450,6 +450,8 @@ static int clockevents_sanity_check(struct clock_event_device *dev)
 		/* We shouldn't be supporting new modes now */
 		WARN_ON(dev->set_state_periodic || dev->set_state_oneshot ||
 			dev->set_state_shutdown || dev->tick_resume);
+
+		BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
 		return 0;
 	}
 
@@ -479,7 +481,6 @@ void clockevents_register_device(struct clock_event_device *dev)
 {
 	unsigned long flags;
 
-	BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
 	BUG_ON(clockevents_sanity_check(dev));
 
 	/* Initialize state to DETACHED */
-- 
2.3.0.rc0.44.ga94655d


  parent reply	other threads:[~2015-02-27 11:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 11:51 [PATCH 0/3] clockevents: Manage device's state separately for core Viresh Kumar
2015-02-27 11:51 ` [PATCH 1/3] clockevents: Handle tick device's resume separately Viresh Kumar
2015-03-27 11:48   ` [tip:timers/core] clockevents: Handle tick device' s " tip-bot for Viresh Kumar
2015-02-27 11:51 ` [PATCH 2/3] clockevents: Manage device's state separately for the core Viresh Kumar
2015-03-27 11:48   ` [tip:timers/core] clockevents: Manage device' s " tip-bot for Viresh Kumar
2015-02-27 11:51 ` Viresh Kumar [this message]
2015-03-27 11:49   ` [tip:timers/core] clockevents: Don't validate dev-> mode against CLOCK_EVT_MODE_UNUSED for new interface tip-bot for Viresh Kumar
2015-03-10 10:34 ` [PATCH 0/3] clockevents: Manage device's state separately for core Viresh Kumar
2015-03-10 13:05   ` Ingo Molnar
2015-03-10 17:12     ` Peter Zijlstra
2015-03-16  9:14     ` Viresh Kumar
2015-03-26 11:59       ` 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=c6604fa1a77fe1fc8dcab87769857228fb1dadd5.1425037853.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=fweisbec@gmail.com \
    --cc=khilman@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linaro-networking@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --subject='Re: [PATCH 3/3] clockevents: Don'\''t validate dev->mode against CLOCK_EVT_MODE_UNUSED for new interface' \
    /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

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).