brcm2708: update against latest rpi-3.10.y branch
[openwrt/svn-archive/archive.git] / target / linux / brcm2708 / patches-3.10 / 0125-clockevents-Add-module-refcount.patch
1 From 38ca21f81217c14749f190f44709d4f5606ff798 Mon Sep 17 00:00:00 2001
2 From: Thomas Gleixner <tglx@linutronix.de>
3 Date: Thu, 25 Apr 2013 20:31:49 +0000
4 Subject: [PATCH 125/174] clockevents: Add module refcount
5
6 commit ccf33d6880f39a35158fff66db13000ae4943fac upstream.
7
8 We want to be able to remove clockevent modules as well. Add a
9 refcount so we don't remove a module with an active clock event
10 device.
11
12 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
13 Cc: John Stultz <john.stultz@linaro.org>
14 Cc: Magnus Damm <magnus.damm@gmail.com>
15 Link: http://lkml.kernel.org/r/20130425143436.307435149@linutronix.de
16 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
17 Cc: Kim Phillips <kim.phillips@linaro.org>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 ---
20 kernel/time/tick-broadcast.c | 2 ++
21 kernel/time/tick-common.c | 3 +++
22 2 files changed, 5 insertions(+)
23
24 --- a/kernel/time/tick-broadcast.c
25 +++ b/kernel/time/tick-broadcast.c
26 @@ -92,6 +92,8 @@ void tick_install_broadcast_device(struc
27
28 if (!try_module_get(dev->owner))
29 return;
30 + if (!try_module_get(dev->owner))
31 + return;
32
33 clockevents_exchange_device(cur, dev);
34 if (cur)
35 --- a/kernel/time/tick-common.c
36 +++ b/kernel/time/tick-common.c
37 @@ -273,6 +273,9 @@ void tick_check_new_device(struct clock_
38 if (!try_module_get(newdev->owner))
39 return;
40
41 + if (!try_module_get(newdev->owner))
42 + return;
43 +
44 /*
45 * Replace the eventually existing device by the new
46 * device. If the current device is the broadcast device, do