lkml.org 
[lkml]   [2001]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: via82cxxx_audio locking problems
Jeff Garzik schrieb:

> Is there a possibility of do_read being re-entered during that window?
> I agree its a problem but the solution sounds racy?

do_read may be reentered. In that case some of the samples land in one read,
the other part in the other read.

This is not a problem, however. UNIX never made any guarantees about
read from or writes to the same fd. Take pipes for example, they don't
guarantee read or write atomicity either. Well, they do guarantee it
if they are all less than PIPEBUF in size. But so do we, the limit
is not called PIPEBUF, but fragment.

> I disagree; I think the idea at aleast is correct: if contention
> exists, it implies that I/O needs to be completed.

Well, it depends what the semaphore is supposed to do. If you (ab)use
it as a waitqueue, then yes, the idea is correct. If you only use it
to guard short critical sections, then the cost of reissuing the syscall
is greater than just waiting for the semaphore to be released.

This is the patch I've tested yesterday. It worked so far.

There is however an unrelated problem that happens both with and without
patch. Sometimes playback sound is very distorted, until I either press
stop, then the remaining second or so continues undistortedly, or I try
to debug the problem. Debugging is anyway difficult without reasonable
docs. It may be a PCI bridge latency issue, as the VIA northbridge my
board uses is fairly crappy.

Tom[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2005-03-22 13:17    [from the cache]
©2003-2011 Jasper Spaans