summaryrefslogtreecommitdiffstats
path: root/rt-Remove-rwlocks-BUG_ON-and-useless-read_depth-chec.patch
blob: 3a4f3193559ba9c41abf428183329020541f5291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 0c72b6a7533fdf48e066a9fd74a36c6af0b11095 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Sun, 23 Aug 2009 11:49:34 +0200
Subject: [PATCH] rt: Remove rwlocks BUG_ON and useless read_depth check

commit dcd880ed997a25809731ef3e36488a1da3bf4edb in tip.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 kernel/rt.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/rt.c b/kernel/rt.c
index 59ca169..7da3299 100644
--- a/kernel/rt.c
+++ b/kernel/rt.c
@@ -206,7 +206,7 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock)
 	/*
 	 * recursive read locks succeed when current owns the lock
 	 */
-	if (rt_mutex_real_owner(lock) != current || !rwlock->read_depth)
+	if (rt_mutex_real_owner(lock) != current)
 		ret = rt_mutex_trylock(lock);
 
 	if (ret) {
@@ -234,7 +234,7 @@ void __lockfunc rt_read_lock(rwlock_t *rwlock)
 	/*
 	 * recursive read locks succeed when current owns the lock
 	 */
-	if (rt_mutex_real_owner(lock) != current || !rwlock->read_depth)
+	if (rt_mutex_real_owner(lock) != current)
 		__rt_spin_lock(lock);
 	rwlock->read_depth++;
 }
@@ -253,8 +253,6 @@ void __lockfunc rt_read_unlock(rwlock_t *rwlock)
 {
 	rwlock_release(&rwlock->dep_map, 1, _RET_IP_);
 
-	BUG_ON(rwlock->read_depth <= 0);
-
 	/* Release the lock only when read_depth is down to 0 */
 	if (--rwlock->read_depth == 0)
 		__rt_spin_unlock(&rwlock->lock);
-- 
1.7.0.4