From: tip-bot for Thomas Gleixner <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, john.stultz@linaro.org,
hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de,
magnus.damm@gmail.com
Subject: [tip:timers/core] clockevents: Simplify locking
Date: Mon, 27 May 2013 02:52:43 -0700 [thread overview]
Message-ID: <tip-7126cac426137633e470167524e7bcb590fd49b3@git.kernel.org> (raw)
In-Reply-To: <20130425143436.162888472@linutronix.de>
Commit-ID: 7126cac426137633e470167524e7bcb590fd49b3
Gitweb: http://git.kernel.org/tip/7126cac426137633e470167524e7bcb590fd49b3
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Thu, 25 Apr 2013 20:31:48 +0000
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 16 May 2013 11:09:16 +0200
clockevents: Simplify locking
Now that the notifier chain is gone there are no other users and it's
pointless to nest tick_device_lock inside of clockevents_lock because
there is no other use case.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Link: http://lkml.kernel.org/r/20130425143436.162888472@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/time/tick-common.c | 22 +++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index dbf4e18..170a4bd 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -33,7 +33,6 @@ DEFINE_PER_CPU(struct tick_device, tick_cpu_device);
ktime_t tick_next_period;
ktime_t tick_period;
int tick_do_timer_cpu __read_mostly = TICK_DO_TIMER_BOOT;
-static DEFINE_RAW_SPINLOCK(tick_device_lock);
/*
* Debugging: see timer_list.c
@@ -206,16 +205,14 @@ static void tick_setup_device(struct tick_device *td,
}
/*
- * Check, if the new registered device should be used.
+ * Check, if the new registered device should be used. Called with
+ * clockevents_lock held and interrupts disabled.
*/
void tick_check_new_device(struct clock_event_device *newdev)
{
struct clock_event_device *curdev;
struct tick_device *td;
int cpu;
- unsigned long flags;
-
- raw_spin_lock_irqsave(&tick_device_lock, flags);
cpu = smp_processor_id();
if (!cpumask_test_cpu(cpu, newdev->cpumask))
@@ -273,8 +270,6 @@ void tick_check_new_device(struct clock_event_device *newdev)
tick_setup_device(td, newdev, cpu, cpumask_of(cpu));
if (newdev->features & CLOCK_EVT_FEAT_ONESHOT)
tick_oneshot_notify();
-
- raw_spin_unlock_irqrestore(&tick_device_lock, flags);
return;
out_bc:
@@ -282,7 +277,6 @@ out_bc:
* Can the new device be used as a broadcast device ?
*/
tick_install_broadcast_device(newdev);
- raw_spin_unlock_irqrestore(&tick_device_lock, flags);
}
/*
@@ -311,9 +305,7 @@ static void tick_shutdown(unsigned int *cpup)
{
struct tick_device *td = &per_cpu(tick_cpu_device, *cpup);
struct clock_event_device *dev = td->evtdev;
- unsigned long flags;
- raw_spin_lock_irqsave(&tick_device_lock, flags);
td->mode = TICKDEV_MODE_PERIODIC;
if (dev) {
/*
@@ -325,26 +317,20 @@ static void tick_shutdown(unsigned int *cpup)
dev->event_handler = clockevents_handle_noop;
td->evtdev = NULL;
}
- raw_spin_unlock_irqrestore(&tick_device_lock, flags);
}
static void tick_suspend(void)
{
struct tick_device *td = &__get_cpu_var(tick_cpu_device);
- unsigned long flags;
- raw_spin_lock_irqsave(&tick_device_lock, flags);
clockevents_shutdown(td->evtdev);
- raw_spin_unlock_irqrestore(&tick_device_lock, flags);
}
static void tick_resume(void)
{
struct tick_device *td = &__get_cpu_var(tick_cpu_device);
- unsigned long flags;
int broadcast = tick_resume_broadcast();
- raw_spin_lock_irqsave(&tick_device_lock, flags);
clockevents_set_mode(td->evtdev, CLOCK_EVT_MODE_RESUME);
if (!broadcast) {
@@ -353,9 +339,11 @@ static void tick_resume(void)
else
tick_resume_oneshot();
}
- raw_spin_unlock_irqrestore(&tick_device_lock, flags);
}
+/*
+ * Called with clockevents_lock held and interrupts disabled
+ */
void tick_notify(unsigned long reason, void *dev)
{
switch (reason) {
next prev parent reply other threads:[~2013-05-27 9:53 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-25 20:31 [patch 00/15] clocksource/events: Overhaul (un)registration Thomas Gleixner
2013-04-25 20:31 ` [patch 01/15] clocksource: apb_timer: Remove unsused function Thomas Gleixner
2013-04-26 12:43 ` Jamie Iles
2013-04-30 0:32 ` John Stultz
2013-05-27 9:41 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 02/15] clocksource: Always verify highres capability Thomas Gleixner
2013-04-30 0:34 ` John Stultz
2013-05-27 9:42 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 04/15] clocksource: Add module refcount Thomas Gleixner
2013-04-30 0:51 ` John Stultz
2013-05-27 9:45 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 03/15] clocksource: Let timekeeping_notify return success/error Thomas Gleixner
2013-04-30 0:37 ` John Stultz
2013-05-27 9:43 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 05/15] clocksource: Allow clocksource select to skip current clocksource Thomas Gleixner
2013-04-30 1:00 ` John Stultz
2013-05-15 9:42 ` Thomas Gleixner
2013-05-27 9:46 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 06/15] clocksource: Split out user string input Thomas Gleixner
2013-04-29 23:29 ` John Stultz
2013-05-15 9:41 ` Thomas Gleixner
2013-05-27 9:47 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 08/15] clocksource: Let clocksource_unregister() return success/error Thomas Gleixner
2013-04-30 1:01 ` John Stultz
2013-05-27 9:50 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 07/15] clocksource: Provide unbind interface in sysfs Thomas Gleixner
2013-04-30 1:11 ` John Stultz
2013-05-15 9:47 ` Thomas Gleixner
2013-05-15 16:53 ` John Stultz
2013-05-15 18:41 ` Thomas Gleixner
2013-05-27 9:48 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 09/15] clockevents: Get rid of the notifier chain Thomas Gleixner
2013-05-27 9:51 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 11/15] clockevents: Move the tick_notify() switch case to clockevents_notify() Thomas Gleixner
2013-05-27 9:54 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 10/15] clockevents: Simplify locking Thomas Gleixner
2013-05-27 9:52 ` tip-bot for Thomas Gleixner [this message]
2013-04-25 20:31 ` [patch 12/15] clockevents: Add module refcount Thomas Gleixner
2013-05-27 9:55 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 13/15] clockevents: Provide sysfs interface Thomas Gleixner
2013-04-26 22:37 ` Stephen Boyd
2013-05-15 9:50 ` Thomas Gleixner
2013-05-15 22:30 ` Stephen Boyd
2013-05-27 9:56 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 14/15] clockevents: Split out selection logic Thomas Gleixner
2013-05-27 9:57 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2013-04-25 20:31 ` [patch 15/15] clockevents: Implement unbind functionality Thomas Gleixner
2013-05-27 9:59 ` [tip:timers/core] " tip-bot for Thomas Gleixner
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-7126cac426137633e470167524e7bcb590fd49b3@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome