Page MenuHomeFreeBSD

D47559.id146396.diff
No OneTemporary

D47559.id146396.diff

diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h
--- a/sys/dev/sound/pcm/channel.h
+++ b/sys/dev/sound/pcm/channel.h
@@ -354,7 +354,7 @@
#define CHN_F_RUNNING 0x00000004 /* dma is running */
#define CHN_F_TRIGGERED 0x00000008
#define CHN_F_NOTRIGGER 0x00000010
-#define CHN_F_SLEEPING 0x00000020
+#define CHN_F_EXCLUSIVE 0x00000020 /* exclusive access */
#define CHN_F_NBIO 0x00000040 /* do non-blocking i/o */
#define CHN_F_MMAP 0x00000080 /* has been mmap()ed */
@@ -374,7 +374,6 @@
#define CHN_F_VIRTUAL 0x10000000 /* not backed by hardware */
#define CHN_F_BITPERFECT 0x20000000 /* un-cooked, Heh.. */
#define CHN_F_PASSTHROUGH 0x40000000 /* passthrough re-config */
-#define CHN_F_EXCLUSIVE 0x80000000 /* exclusive access */
#define CHN_F_BITS "\020" \
"\001CLOSING" \
@@ -382,7 +381,7 @@
"\003RUNNING" \
"\004TRIGGERED" \
"\005NOTRIGGER" \
- "\006SLEEPING" \
+ "\006EXCLUSIVE" \
"\007NBIO" \
"\010MMAP" \
"\011BUSY" \
@@ -395,8 +394,7 @@
"\020VCHAN_ADAPTIVE" \
"\035VIRTUAL" \
"\036BITPERFECT" \
- "\037PASSTHROUGH" \
- "\040EXCLUSIVE"
+ "\037PASSTHROUGH"
#define CHN_F_RESET (CHN_F_BUSY | CHN_F_DEAD | \
CHN_F_VIRTUAL | CHN_F_HAS_VCHAN | \
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -309,14 +309,7 @@
if (CHN_EMPTY(c, children.busy)) {
if (SEL_WAITING(sndbuf_getsel(bs)) && chn_polltrigger(c))
selwakeuppri(sndbuf_getsel(bs), PRIBIO);
- if (c->flags & CHN_F_SLEEPING) {
- /*
- * Ok, I can just panic it right here since it is
- * quite obvious that we never allow multiple waiters
- * from userland. I'm too generous...
- */
- CHN_BROADCAST(&c->intr_cv);
- }
+ CHN_BROADCAST(&c->intr_cv);
} else {
CHN_FOREACH(ch, c, children.busy) {
CHN_LOCK(ch);
@@ -332,15 +325,11 @@
int ret;
CHN_LOCKASSERT(c);
- KASSERT((c->flags & CHN_F_SLEEPING) == 0,
- ("%s(): entered with CHN_F_SLEEPING", __func__));
if (c->flags & CHN_F_DEAD)
return (EINVAL);
- c->flags |= CHN_F_SLEEPING;
ret = cv_timedwait_sig(&c->intr_cv, c->lock, timeout);
- c->flags &= ~CHN_F_SLEEPING;
return ((c->flags & CHN_F_DEAD) ? EINVAL : ret);
}
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -220,8 +220,8 @@
/* Make sure all channels are stopped. */
CHN_FOREACH(ch, d, channels.pcm) {
CHN_LOCK(ch);
- if ((ch->flags & CHN_F_SLEEPING) == 0 &&
- CHN_STOPPED(ch) && ch->inprog == 0) {
+ if (ch->intr_cv.cv_waiters == 0 && CHN_STOPPED(ch) &&
+ ch->inprog == 0) {
CHN_UNLOCK(ch);
continue;
}

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 2, 6:30 AM (14 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30711926
Default Alt Text
D47559.id146396.diff (2 KB)

Event Timeline