Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
872fa3a2
Commit
872fa3a2
authored
Aug 25, 2009
by
Thomas Gleixner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rt: Fix recursive read lock of rw_semaphores
Signed-off-by:
Thomas Gleixner
<
tglx@linutronix.de
>
parent
dcd880ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
kernel/rt.c
kernel/rt.c
+18
-4
No files found.
kernel/rt.c
View file @
872fa3a2
...
@@ -303,6 +303,7 @@ EXPORT_SYMBOL(rt_up_write);
...
@@ -303,6 +303,7 @@ EXPORT_SYMBOL(rt_up_write);
void
rt_up_read
(
struct
rw_semaphore
*
rwsem
)
void
rt_up_read
(
struct
rw_semaphore
*
rwsem
)
{
{
rwsem_release
(
&
rwsem
->
dep_map
,
1
,
_RET_IP_
);
rwsem_release
(
&
rwsem
->
dep_map
,
1
,
_RET_IP_
);
if
(
--
rwsem
->
read_depth
==
0
)
rt_mutex_unlock
(
&
rwsem
->
lock
);
rt_mutex_unlock
(
&
rwsem
->
lock
);
}
}
EXPORT_SYMBOL
(
rt_up_read
);
EXPORT_SYMBOL
(
rt_up_read
);
...
@@ -314,6 +315,7 @@ EXPORT_SYMBOL(rt_up_read);
...
@@ -314,6 +315,7 @@ EXPORT_SYMBOL(rt_up_read);
void
rt_downgrade_write
(
struct
rw_semaphore
*
rwsem
)
void
rt_downgrade_write
(
struct
rw_semaphore
*
rwsem
)
{
{
BUG_ON
(
rt_mutex_real_owner
(
&
rwsem
->
lock
)
!=
current
);
BUG_ON
(
rt_mutex_real_owner
(
&
rwsem
->
lock
)
!=
current
);
rwsem
->
read_depth
=
1
;
}
}
EXPORT_SYMBOL
(
rt_downgrade_write
);
EXPORT_SYMBOL
(
rt_downgrade_write
);
...
@@ -343,18 +345,29 @@ EXPORT_SYMBOL(rt_down_write_nested);
...
@@ -343,18 +345,29 @@ EXPORT_SYMBOL(rt_down_write_nested);
int
rt_down_read_trylock
(
struct
rw_semaphore
*
rwsem
)
int
rt_down_read_trylock
(
struct
rw_semaphore
*
rwsem
)
{
{
int
ret
=
rt_mutex_trylock
(
&
rwsem
->
lock
);
struct
rt_mutex
*
lock
=
&
rwsem
->
lock
;
int
ret
=
1
;
if
(
ret
)
if
(
rt_mutex_real_owner
(
lock
)
!=
current
)
ret
=
rt_mutex_trylock
(
&
rwsem
->
lock
);
if
(
ret
)
{
rwsem
->
read_depth
++
;
rwsem_acquire
(
&
rwsem
->
dep_map
,
0
,
1
,
_RET_IP_
);
rwsem_acquire
(
&
rwsem
->
dep_map
,
0
,
1
,
_RET_IP_
);
}
return
ret
;
return
ret
;
}
}
EXPORT_SYMBOL
(
rt_down_read_trylock
);
EXPORT_SYMBOL
(
rt_down_read_trylock
);
static
void
__rt_down_read
(
struct
rw_semaphore
*
rwsem
,
int
subclass
)
static
void
__rt_down_read
(
struct
rw_semaphore
*
rwsem
,
int
subclass
)
{
{
struct
rt_mutex
*
lock
=
&
rwsem
->
lock
;
rwsem_acquire_read
(
&
rwsem
->
dep_map
,
subclass
,
0
,
_RET_IP_
);
rwsem_acquire_read
(
&
rwsem
->
dep_map
,
subclass
,
0
,
_RET_IP_
);
if
(
rt_mutex_real_owner
(
lock
)
!=
current
)
rt_mutex_lock
(
&
rwsem
->
lock
);
rt_mutex_lock
(
&
rwsem
->
lock
);
rwsem
->
read_depth
++
;
}
}
void
rt_down_read
(
struct
rw_semaphore
*
rwsem
)
void
rt_down_read
(
struct
rw_semaphore
*
rwsem
)
...
@@ -380,6 +393,7 @@ void __rt_rwsem_init(struct rw_semaphore *rwsem, char *name,
...
@@ -380,6 +393,7 @@ void __rt_rwsem_init(struct rw_semaphore *rwsem, char *name,
lockdep_init_map
(
&
rwsem
->
dep_map
,
name
,
key
,
0
);
lockdep_init_map
(
&
rwsem
->
dep_map
,
name
,
key
,
0
);
#endif
#endif
__rt_mutex_init
(
&
rwsem
->
lock
,
name
);
__rt_mutex_init
(
&
rwsem
->
lock
,
name
);
rwsem
->
read_depth
=
0
;
}
}
EXPORT_SYMBOL
(
__rt_rwsem_init
);
EXPORT_SYMBOL
(
__rt_rwsem_init
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment