brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0125-clockevents-Add-module-refcount.patch
1 From a32b173c1e9039d2ce45a1bb8267bfdd33204461 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/196] 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 diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
25 index 19ee339..b219c9f 100644
26 --- a/kernel/time/tick-broadcast.c
27 +++ b/kernel/time/tick-broadcast.c
28 @@ -92,6 +92,8 @@ void tick_install_broadcast_device(struct clock_event_device *dev)
29  
30         if (!try_module_get(dev->owner))
31                 return;
32 +       if (!try_module_get(dev->owner))
33 +               return;
34  
35         clockevents_exchange_device(cur, dev);
36         if (cur)
37 diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
38 index 086216c..2dcea16 100644
39 --- a/kernel/time/tick-common.c
40 +++ b/kernel/time/tick-common.c
41 @@ -273,6 +273,9 @@ void tick_check_new_device(struct clock_event_device *newdev)
42         if (!try_module_get(newdev->owner))
43                 return;
44  
45 +       if (!try_module_get(newdev->owner))
46 +               return;
47 +
48         /*
49          * Replace the eventually existing device by the new
50          * device. If the current device is the broadcast device, do
51 -- 
52 1.9.1
53