2014-09-27 19:10:51 +00:00
|
|
|
From a32b173c1e9039d2ce45a1bb8267bfdd33204461 Mon Sep 17 00:00:00 2001
|
2014-02-28 20:30:08 +00:00
|
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
|
|
Date: Thu, 25 Apr 2013 20:31:49 +0000
|
2014-09-27 19:10:51 +00:00
|
|
|
Subject: [PATCH 125/196] clockevents: Add module refcount
|
2014-02-28 20:30:08 +00:00
|
|
|
|
|
|
|
commit ccf33d6880f39a35158fff66db13000ae4943fac upstream.
|
|
|
|
|
|
|
|
We want to be able to remove clockevent modules as well. Add a
|
|
|
|
refcount so we don't remove a module with an active clock event
|
|
|
|
device.
|
|
|
|
|
|
|
|
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.307435149@linutronix.de
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
|
|
Cc: Kim Phillips <kim.phillips@linaro.org>
|
|
|
|
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
|
|
---
|
|
|
|
kernel/time/tick-broadcast.c | 2 ++
|
|
|
|
kernel/time/tick-common.c | 3 +++
|
|
|
|
2 files changed, 5 insertions(+)
|
|
|
|
|
2014-09-27 19:10:51 +00:00
|
|
|
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
|
|
|
|
index 19ee339..b219c9f 100644
|
2014-02-28 20:30:08 +00:00
|
|
|
--- a/kernel/time/tick-broadcast.c
|
|
|
|
+++ b/kernel/time/tick-broadcast.c
|
2014-09-27 19:10:51 +00:00
|
|
|
@@ -92,6 +92,8 @@ void tick_install_broadcast_device(struct clock_event_device *dev)
|
2014-02-28 20:30:08 +00:00
|
|
|
|
|
|
|
if (!try_module_get(dev->owner))
|
|
|
|
return;
|
|
|
|
+ if (!try_module_get(dev->owner))
|
|
|
|
+ return;
|
|
|
|
|
|
|
|
clockevents_exchange_device(cur, dev);
|
|
|
|
if (cur)
|
2014-09-27 19:10:51 +00:00
|
|
|
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
|
|
|
|
index 086216c..2dcea16 100644
|
2014-02-28 20:30:08 +00:00
|
|
|
--- a/kernel/time/tick-common.c
|
|
|
|
+++ b/kernel/time/tick-common.c
|
2014-09-27 19:10:51 +00:00
|
|
|
@@ -273,6 +273,9 @@ void tick_check_new_device(struct clock_event_device *newdev)
|
2014-02-28 20:30:08 +00:00
|
|
|
if (!try_module_get(newdev->owner))
|
|
|
|
return;
|
|
|
|
|
|
|
|
+ if (!try_module_get(newdev->owner))
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* Replace the eventually existing device by the new
|
|
|
|
* device. If the current device is the broadcast device, do
|
2014-09-27 19:10:51 +00:00
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|