summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>1999-09-08 17:34:54 +0000
committercg <cg@FreeBSD.org>1999-09-08 17:34:54 +0000
commit4375d2291354c6c2c4120d0bd56a7fddb078bf1b (patch)
treee59b78cbb2e2e8aef7e27903a3c1c3095112d48e /sys
parent9a6860ba7d017bcafe122ba29c95564b68d834fa (diff)
downloadFreeBSD-src-4375d2291354c6c2c4120d0bd56a7fddb078bf1b.zip
FreeBSD-src-4375d2291354c6c2c4120d0bd56a7fddb078bf1b.tar.gz
fix a bug with cat >/dev/{dsp,dspW,audio} hanging
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pcm/channel.c3
-rw-r--r--sys/dev/sound/pcm/channel.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pcm/channel.c b/sys/dev/pcm/channel.c
index 4c91e44..1bc8056 100644
--- a/sys/dev/pcm/channel.c
+++ b/sys/dev/pcm/channel.c
@@ -268,7 +268,7 @@ chn_write(pcm_channel *c, struct uio *buf)
return EBUSY;
}
c->flags |= CHN_F_WRITING;
- while (buf->uio_resid >= DMA_ALIGN_THRESHOLD) {
+ while (buf->uio_resid > 0) {
s = spltty();
chn_dmaupdate(c);
splx(s);
@@ -284,6 +284,7 @@ chn_write(pcm_channel *c, struct uio *buf)
/* ensure we always have a whole number of samples */
l = min(b->fl, b->bufsize - b->fp) & DMA_ALIGN_MASK;
w = c->feeder->feed(c->feeder, b->buf + b->fp, l, buf);
+ if (w == 0) panic("no feed");
s = spltty();
b->rl += w;
b->fl -= w;
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 4c91e44..1bc8056 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -268,7 +268,7 @@ chn_write(pcm_channel *c, struct uio *buf)
return EBUSY;
}
c->flags |= CHN_F_WRITING;
- while (buf->uio_resid >= DMA_ALIGN_THRESHOLD) {
+ while (buf->uio_resid > 0) {
s = spltty();
chn_dmaupdate(c);
splx(s);
@@ -284,6 +284,7 @@ chn_write(pcm_channel *c, struct uio *buf)
/* ensure we always have a whole number of samples */
l = min(b->fl, b->bufsize - b->fp) & DMA_ALIGN_MASK;
w = c->feeder->feed(c->feeder, b->buf + b->fp, l, buf);
+ if (w == 0) panic("no feed");
s = spltty();
b->rl += w;
b->fl -= w;
OpenPOWER on IntegriCloud