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
Kirill Smelkov
linux
Commits
1c56a583
Commit
1c56a583
authored
Aug 29, 2002
by
Peter Wächtler
Committed by
Linus Torvalds
Aug 29, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] oss/uart6850.c - convert cli to spinlocks
parent
d5ee49df
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
sound/oss/uart6850.c
sound/oss/uart6850.c
+8
-11
No files found.
sound/oss/uart6850.c
View file @
1c56a583
...
...
@@ -23,7 +23,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/spinlock.h>
/* Mon Nov 22 22:38:35 MET 1993 marco@driq.home.usn.nl:
* added 6850 support, used with COVOX SoundMaster II and custom cards.
*/
...
...
@@ -71,6 +71,7 @@ static int uart6850_opened;
static
int
uart6850_irq
;
static
int
uart6850_detected
;
static
int
my_dev
;
static
spinlock_t
lock
=
SPIN_LOCK_UNLOCKED
;
static
void
(
*
midi_input_intr
)
(
int
dev
,
unsigned
char
data
);
static
void
poll_uart6850
(
unsigned
long
dummy
);
...
...
@@ -122,9 +123,7 @@ static void poll_uart6850(unsigned long dummy)
if
(
!
(
uart6850_opened
&
OPEN_READ
))
return
;
/* Device has been closed */
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
lock
,
flags
);
if
(
input_avail
())
uart6850_input_loop
();
...
...
@@ -135,7 +134,7 @@ static void poll_uart6850(unsigned long dummy)
* Come back later
*/
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lock
,
flags
);
}
static
int
uart6850_open
(
int
dev
,
int
mode
,
...
...
@@ -176,13 +175,12 @@ static int uart6850_out(int dev, unsigned char midi_byte)
* Test for input since pending input seems to block the output.
*/
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
lock
,
flags
);
if
(
input_avail
())
uart6850_input_loop
();
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lock
,
flags
);
/*
* Sometimes it takes about 13000 loops before the output becomes ready
...
...
@@ -265,15 +263,14 @@ static void __init attach_uart6850(struct address_info *hw_config)
uart6850_osp
=
hw_config
->
osp
;
uart6850_irq
=
hw_config
->
irq
;
save_flags
(
flags
);
cli
();
spin_lock_irqsave
(
&
lock
,
flags
);
for
(
timeout
=
30000
;
timeout
>
0
&&
!
output_ready
();
timeout
--
);
/*
* Wait
*/
uart6850_cmd
(
UART_MODE_ON
);
ok
=
1
;
restore_flags
(
flags
);
spin_unlock_irqrestore
(
&
lock
,
flags
);
conf_printf
(
"6850 Midi Interface"
,
hw_config
);
...
...
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