Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
7c4efa69
Commit
7c4efa69
authored
Apr 27, 2003
by
Maksim Krasnyanskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bluetooth] Fix race condition in RFCOMM session and dcl scheduler.
This fixes random RFCOMM freezes reported by some people.
parent
46acabae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
include/net/bluetooth/rfcomm.h
include/net/bluetooth/rfcomm.h
+2
-3
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/core.c
+4
-3
No files found.
include/net/bluetooth/rfcomm.h
View file @
7c4efa69
...
...
@@ -220,10 +220,9 @@ static inline void rfcomm_schedule(uint event)
{
if
(
!
rfcomm_thread
)
return
;
//set_bit(event, &rfcomm_event);
if
(
!
test_and_set_bit
(
RFCOMM_SCHED_WAKEUP
,
&
rfcomm_event
))
wake_up_process
(
rfcomm_thread
);
set_bit
(
RFCOMM_SCHED_WAKEUP
,
&
rfcomm_event
);
wake_up_process
(
rfcomm_thread
);
}
extern
struct
semaphore
rfcomm_sem
;
...
...
net/bluetooth/rfcomm/core.c
View file @
7c4efa69
...
...
@@ -1483,9 +1483,9 @@ static inline int rfcomm_process_tx(struct rfcomm_dlc *d)
d
->
rx_credits
=
d
->
credits
;
}
}
else
{
/* CFC disabled.
/* CFC disabled.
* Give ourselves some credits */
d
->
tx_credits
=
RFCOMM_MAX_CREDITS
;
d
->
tx_credits
=
5
;
}
if
(
test_bit
(
RFCOMM_TX_THROTTLED
,
&
d
->
flags
))
...
...
@@ -1651,7 +1651,7 @@ static void rfcomm_worker(void)
BT_DBG
(
""
);
while
(
!
atomic_read
(
&
terminate
))
{
if
(
!
test_
and_clear_
bit
(
RFCOMM_SCHED_WAKEUP
,
&
rfcomm_event
))
{
if
(
!
test_bit
(
RFCOMM_SCHED_WAKEUP
,
&
rfcomm_event
))
{
/* No pending events. Let's sleep.
* Incomming connections and data will wake us up. */
set_current_state
(
TASK_INTERRUPTIBLE
);
...
...
@@ -1659,6 +1659,7 @@ static void rfcomm_worker(void)
}
/* Process stuff */
clear_bit
(
RFCOMM_SCHED_WAKEUP
,
&
rfcomm_event
);
rfcomm_process_sessions
();
}
set_current_state
(
TASK_RUNNING
);
...
...
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