Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
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-2.6.23
Commits
b771bc38
Commit
b771bc38
authored
Sep 19, 2008
by
Jorge Zapata
Committed by
Jean-Paul Saman
Jan 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix NON BLOCKING issue with the sound driver
Signed-off-by:
Jean-Paul Saman
<
jpsaman@videolan.org
>
parent
8184f9f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
sound/oss/davinci-audio.c
sound/oss/davinci-audio.c
+17
-5
No files found.
sound/oss/davinci-audio.c
View file @
b771bc38
...
@@ -507,6 +507,7 @@ audio_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
...
@@ -507,6 +507,7 @@ audio_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
audio_state_t
*
state
=
file
->
private_data
;
audio_state_t
*
state
=
file
->
private_data
;
audio_stream_t
*
s
=
state
->
output_stream
;
audio_stream_t
*
s
=
state
->
output_stream
;
int
chunksize
,
ret
=
0
;
int
chunksize
,
ret
=
0
;
unsigned
long
flags
;
DPRINTK
(
"audio_write: count=%d
\n
"
,
count
);
DPRINTK
(
"audio_write: count=%d
\n
"
,
count
);
if
(
*
ppos
!=
file
->
f_pos
)
{
if
(
*
ppos
!=
file
->
f_pos
)
{
...
@@ -528,9 +529,14 @@ audio_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
...
@@ -528,9 +529,14 @@ audio_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
/* Wait for a buffer to become free */
/* Wait for a buffer to become free */
if
(
file
->
f_flags
&
O_NONBLOCK
)
{
if
(
file
->
f_flags
&
O_NONBLOCK
)
{
ret
=
-
EAGAIN
;
if
(
!
s
->
wfc
.
done
)
{
if
(
!
s
->
wfc
.
done
)
ret
=
-
EAGAIN
;
break
;
break
;
}
else
{
local_irq_save
(
flags
);
s
->
wfc
.
done
--
;
local_irq_restore
(
flags
);
}
}
else
{
}
else
{
ret
=
-
ERESTARTSYS
;
ret
=
-
ERESTARTSYS
;
if
(
wait_for_completion_interruptible
(
&
s
->
wfc
))
if
(
wait_for_completion_interruptible
(
&
s
->
wfc
))
...
@@ -558,13 +564,14 @@ audio_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
...
@@ -558,13 +564,14 @@ audio_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
}
}
/* Update pointers and send current fragment to DMA */
/* Update pointers and send current fragment to DMA */
local_irq_save
(
flags
);
b
->
offset
=
0
;
b
->
offset
=
0
;
if
(
++
s
->
usr_head
>=
s
->
nbfrags
)
if
(
++
s
->
usr_head
>=
s
->
nbfrags
)
s
->
usr_head
=
0
;
s
->
usr_head
=
0
;
/* Add the num of frags pending */
/* Add the num of frags pending */
s
->
pending_frags
++
;
s
->
pending_frags
++
;
s
->
active
=
1
;
s
->
active
=
1
;
local_irq_restore
(
flags
);
audio_process_dma
(
s
);
audio_process_dma
(
s
);
}
}
...
@@ -614,9 +621,14 @@ audio_read(struct file *file, char *buffer, size_t count, loff_t * ppos)
...
@@ -614,9 +621,14 @@ audio_read(struct file *file, char *buffer, size_t count, loff_t * ppos)
/* Wait for a buffer to become full */
/* Wait for a buffer to become full */
if
(
file
->
f_flags
&
O_NONBLOCK
)
{
if
(
file
->
f_flags
&
O_NONBLOCK
)
{
ret
=
-
EAGAIN
;
if
(
!
s
->
wfc
.
done
)
{
if
(
!
s
->
done_flag
)
ret
=
-
EAGAIN
;
break
;
break
;
}
else
{
local_irq_save
(
flags
);
s
->
wfc
.
done
--
;
local_irq_restore
(
flags
);
}
}
else
{
}
else
{
ret
=
-
ERESTARTSYS
;
ret
=
-
ERESTARTSYS
;
if
(
wait_for_completion_interruptible
(
&
s
->
wfc
))
if
(
wait_for_completion_interruptible
(
&
s
->
wfc
))
...
...
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