diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0081-hrtimers-Move-lock-held-region-in-hrtimer_interrupt.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0081-hrtimers-Move-lock-held-region-in-hrtimer_interrupt.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0081-hrtimers-Move-lock-held-region-in-hrtimer_interrupt.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0081-hrtimers-Move-lock-held-region-in-hrtimer_interrupt.patch new file mode 100644 index 00000000..5444d540 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0081-hrtimers-Move-lock-held-region-in-hrtimer_interrupt.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 6783d1f7e46f4450b489d970bbf4d62db9296c1f Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Gleixner <tglx@linutronix.de> | ||
3 | Date: Tue, 10 Jul 2012 18:43:23 -0400 | ||
4 | Subject: [PATCH 081/109] hrtimers: Move lock held region in | ||
5 | hrtimer_interrupt() | ||
6 | |||
7 | commit 196951e91262fccda81147d2bcf7fdab08668b40 upstream. | ||
8 | |||
9 | We need to update the base offsets from this code and we need to do | ||
10 | that under base->lock. Move the lock held region around the | ||
11 | ktime_get() calls. The ktime_get() calls are going to be replaced with | ||
12 | a function which gets the time and the offsets atomically. | ||
13 | |||
14 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
15 | Reviewed-by: Ingo Molnar <mingo@kernel.org> | ||
16 | Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
17 | Acked-by: Prarit Bhargava <prarit@redhat.com> | ||
18 | Signed-off-by: John Stultz <johnstul@us.ibm.com> | ||
19 | Link: http://lkml.kernel.org/r/1341960205-56738-6-git-send-email-johnstul@us.ibm.com | ||
20 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | kernel/hrtimer.c | 5 +++-- | ||
24 | 1 files changed, 3 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c | ||
27 | index 3c24fb2..8f320af 100644 | ||
28 | --- a/kernel/hrtimer.c | ||
29 | +++ b/kernel/hrtimer.c | ||
30 | @@ -1263,11 +1263,10 @@ void hrtimer_interrupt(struct clock_event_device *dev) | ||
31 | cpu_base->nr_events++; | ||
32 | dev->next_event.tv64 = KTIME_MAX; | ||
33 | |||
34 | + raw_spin_lock(&cpu_base->lock); | ||
35 | entry_time = now = ktime_get(); | ||
36 | retry: | ||
37 | expires_next.tv64 = KTIME_MAX; | ||
38 | - | ||
39 | - raw_spin_lock(&cpu_base->lock); | ||
40 | /* | ||
41 | * We set expires_next to KTIME_MAX here with cpu_base->lock | ||
42 | * held to prevent that a timer is enqueued in our queue via | ||
43 | @@ -1344,6 +1343,7 @@ retry: | ||
44 | * interrupt routine. We give it 3 attempts to avoid | ||
45 | * overreacting on some spurious event. | ||
46 | */ | ||
47 | + raw_spin_lock(&cpu_base->lock); | ||
48 | now = ktime_get(); | ||
49 | cpu_base->nr_retries++; | ||
50 | if (++retries < 3) | ||
51 | @@ -1356,6 +1356,7 @@ retry: | ||
52 | */ | ||
53 | cpu_base->nr_hangs++; | ||
54 | cpu_base->hang_detected = 1; | ||
55 | + raw_spin_unlock(&cpu_base->lock); | ||
56 | delta = ktime_sub(now, entry_time); | ||
57 | if (delta.tv64 > cpu_base->max_hang_time.tv64) | ||
58 | cpu_base->max_hang_time = delta; | ||
59 | -- | ||
60 | 1.7.7.6 | ||
61 | |||