From: Thomas Sailer <sailer@scs.ch>
To: jgarzik@mandrakesoft.com, linux-kernel@vger.kernel.org
Subject: via82cxxx_audio locking problems
Date: Thu, 20 Sep 2001 10:39:31 +0200 [thread overview]
Message-ID: <3BA9AB43.C26366BF@scs.ch> (raw)
This applies to version 1.1.5 as well as the version in
linux-2.4.10-pre12 and linux-2.4.9-ac12.
1) There is one semaphore (syscall_sem) that is held during
calls from userspace. It is even kept while going to sleep
during read and write syscalls. This locks out other users,
eg. mixers, for a potentially very long time, seconds are
common but it may almost be arbitrarily long. Try changing
the volume with eg. gmix while playing something with eg. xmms.
Dropping and reacquiring syscall_sem around interruptible_sleep_on
in via_dsp_do_read, via_dsp_do_write and via_dsp_drain_playback
should solve the problem. Does anyone see a problem with this?
2) When some kind of error happens during read or write after
some samples have already been dequeued and copied to the user
buffer, the number of copied bytes should be returned instead
of the error code, to avoid loosing samples.
3) The use of interruptible_sleep_on results in a small race where
wake_ups may be lost. Unlikely to hit though.
4) The down_trylock and returning -EAGAIN in via_down_syscall looks
questionable, EAGAIN with O_NONBLOCK normally means I/O has to
be completed first, not that there is contention on some internal
synchronisation primitive.
Jeff, do you object any of this? Would you accept a patch to ameliorate
the situation? Or would you like to fix this yourself?
Tom
PS: Is there any better publicly available chip documentation than
the 120 page PDF file?
next reply other threads:[~2001-09-20 8:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-20 8:39 Thomas Sailer [this message]
2001-09-20 11:33 ` via82cxxx_audio locking problems Nicholas Knight
2001-09-20 12:07 ` Adrian Cox
2001-09-20 12:24 ` Nicholas Knight
2001-09-20 13:40 ` André Dahlqvist
2001-09-20 13:41 ` Thomas Sailer
2001-09-21 9:27 ` Thomas Sailer
2001-09-21 12:06 ` André Dahlqvist
2001-09-21 13:01 ` Lockups fixed! (Was: via82cxxx_audio locking problems) André Dahlqvist
2001-09-20 16:33 ` via82cxxx_audio locking problems Jeff Garzik
2001-09-21 7:50 ` Adrian Cox
2001-09-21 8:36 ` David Chow
2001-09-21 8:50 ` David Chow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3BA9AB43.C26366BF@scs.ch \
--to=sailer@scs.ch \
--cc=jgarzik@mandrakesoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=t.sailer@alumni.ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox