Page MenuHomeFreeBSD

D60121.diff
No OneTemporary

D60121.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
@@ -122,8 +122,6 @@
* lock.
*/
unsigned int inprog;
- /* Incrememnt/decrement around cv_timedwait_sig() in chn_sleep(). */
- unsigned int sleeping;
/**
* Special channel operations should examine @c inprog after acquiring
* lock. If zero, operations may continue. Else, thread should
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
@@ -342,9 +342,7 @@
if (c->flags & CHN_F_DEAD)
return (EINVAL);
- c->sleeping++;
ret = cv_timedwait_sig(&c->intr_cv, &c->lock, timeout);
- c->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
@@ -151,36 +151,21 @@
pcm_shutdownchans(struct snddev_info *d)
{
struct pcm_channel *ch;
- bool again;
KASSERT(!PCM_REGISTERED(d), ("%s(): still registered\n", __func__));
- for (;;) {
- again = false;
- /* Make sure all channels are woken up and stopped. */
- CHN_FOREACH(ch, d, channels.pcm) {
- CHN_LOCK(ch);
- if (ch->inprog == 0 && ch->sleeping == 0 &&
- CHN_STOPPED(ch)) {
- CHN_UNLOCK(ch);
- continue;
- }
- chn_shutdown(ch);
- if (ch->direction == PCMDIR_PLAY)
- chn_flush(ch);
- else
- chn_abort(ch);
+ CHN_FOREACH(ch, d, channels.pcm) {
+ CHN_LOCK(ch);
+ if (ch->inprog == 0 && CHN_STOPPED(ch)) {
CHN_UNLOCK(ch);
- again = true;
+ continue;
}
- /*
- * Some channels are still active. Sleep for a bit and try
- * again.
- */
- if (again)
- pause_sbt("pcmshutdownchans", mstosbt(5), 0, 0);
+ chn_shutdown(ch);
+ if (ch->direction == PCMDIR_PLAY)
+ chn_flush(ch);
else
- break;
+ chn_abort(ch);
+ CHN_UNLOCK(ch);
}
}

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 30, 12:43 PM (13 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39945423
Default Alt Text
D60121.diff (1 KB)

Event Timeline