Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109370103
D47559.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D47559.diff
View Options
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
+/* unused 0x00000020 */
#define CHN_F_NBIO 0x00000040 /* do non-blocking i/o */
#define CHN_F_MMAP 0x00000080 /* has been mmap()ed */
@@ -381,8 +381,8 @@
"\002ABORTING" \
"\003RUNNING" \
"\004TRIGGERED" \
+ /* \006 */ \
"\005NOTRIGGER" \
- "\006SLEEPING" \
"\007NBIO" \
"\010MMAP" \
"\011BUSY" \
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
@@ -221,8 +221,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
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 5, 4:33 AM (16 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16467114
Default Alt Text
D47559.diff (2 KB)
Attached To
Mode
D47559: sound: Remove CHN_F_SLEEPING
Attached
Detach File
Event Timeline
Log In to Comment