[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-a272dcca1802a7e265a56e60b0d0a6715b0a8ac2@git.kernel.org>
Date: Fri, 12 Jul 2013 03:39:36 -0700
From: tip-bot for Stephen Boyd <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
linux-arm-kernel@...ts.infradead.org, marc.zyngier@....com,
Mark.Rutland@....com, swarren@...dia.com, sboyd@...eaurora.org,
john.stultz@...aro.org, josephl@...dia.com, tglx@...utronix.de
Subject: [tip:timers/urgent] tick: broadcast:
Check broadcast mode on CPU hotplug
Commit-ID: a272dcca1802a7e265a56e60b0d0a6715b0a8ac2
Gitweb: http://git.kernel.org/tip/a272dcca1802a7e265a56e60b0d0a6715b0a8ac2
Author: Stephen Boyd <sboyd@...eaurora.org>
AuthorDate: Thu, 11 Jul 2013 07:00:59 -0700
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Fri, 12 Jul 2013 12:35:40 +0200
tick: broadcast: Check broadcast mode on CPU hotplug
On ARM systems the dummy clockevent is registered with the cpu
hotplug notifier chain before any other per-cpu clockevent. This
has the side-effect of causing the dummy clockevent to be
registered first in every hotplug sequence. Because the dummy is
first, we'll try to turn the broadcast source on but the code in
tick_device_uses_broadcast() assumes the broadcast source is in
periodic mode and calls tick_broadcast_start_periodic()
unconditionally.
On boot this isn't a problem because we typically haven't
switched into oneshot mode yet (if at all). During hotplug, if
the broadcast source isn't in periodic mode we'll replace the
broadcast oneshot handler with the broadcast periodic handler and
start emulating oneshot mode when we shouldn't. Due to the way
the broadcast oneshot handler programs the next_event it's
possible for it to contain KTIME_MAX and cause us to hang the
system when the periodic handler tries to program the next tick.
Fix this by using the appropriate function to start the broadcast
source.
Reported-by: Stephen Warren <swarren@...dia.com>
Tested-by: Stephen Warren <swarren@...dia.com>
Signed-off-by: Stephen Boyd <sboyd@...eaurora.org>
Cc: Mark Rutland <Mark.Rutland@....com>
Cc: Marc Zyngier <marc.zyngier@....com>
Cc: ARM kernel mailing list <linux-arm-kernel@...ts.infradead.org>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Joseph Lo <josephl@...dia.com>
Link: http://lkml.kernel.org/r/20130711140059.GA27430@codeaurora.org
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
kernel/time/tick-broadcast.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 6d3f916..218bcb5 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -157,7 +157,10 @@ int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu)
dev->event_handler = tick_handle_periodic;
tick_device_setup_broadcast_func(dev);
cpumask_set_cpu(cpu, tick_broadcast_mask);
- tick_broadcast_start_periodic(bc);
+ if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC)
+ tick_broadcast_start_periodic(bc);
+ else
+ tick_broadcast_setup_oneshot(bc);
ret = 1;
} else {
/*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists